Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
15d309bf
Commit
15d309bf
authored
Aug 03, 2012
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add -c (check syntax) option.
parent
2485339b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
db/dbupdate.in
db/dbupdate.in
+12
-4
No files found.
db/dbupdate.in
View file @
15d309bf
#!/usr/bin/perl -w
#
# EMULAB-COPYRIGHT
# Copyright (c) 2009-201
0
University of Utah and the Flux Group.
# Copyright (c) 2009-201
2
University of Utah and the Flux Group.
# All rights reserved.
#
use
strict
;
...
...
@@ -13,14 +13,15 @@ use Getopt::Std;
#
sub
usage
()
{
print
STDERR
"
Usage: dbupdate [-v] [-s] [-f] <dbname> [<version>]
\n
";
print
STDERR
"
Usage: dbupdate [-v] [-
c] [-
s] [-f] <dbname> [<version>]
\n
";
exit
(
-
1
);
}
my
$optlist
=
"
dsfvp:q
";
my
$optlist
=
"
dsfvp:q
c
";
my
$debug
=
0
;
my
$force
=
0
;
my
$single
=
0
;
my
$verify
=
0
;
my
$check
=
0
;
my
$quiet
=
0
;
my
$path
;
my
$dbname
;
...
...
@@ -86,6 +87,9 @@ if (defined($options{"q"})) {
if
(
defined
(
$options
{"
v
"}))
{
$verify
=
1
;
}
if
(
defined
(
$options
{"
c
"}))
{
$check
=
1
;
}
if
(
defined
(
$options
{"
p
"}))
{
$path
=
$options
{"
p
"};
chdir
(
$path
)
or
...
...
@@ -207,7 +211,8 @@ foreach my $file (@files) {
next
;
}
print
"
Processing update
$fullpath
\n
";
print
""
.
(
$check
?
"
Syntax checking
"
:
"
Processing
")
.
"
update
$fullpath
\n
";
# Undefine this to make sure we get a new version each file.
undef
&DoUpdate
;
...
...
@@ -218,6 +223,9 @@ foreach my $file (@files) {
Fatal
("
could not parse
$file
: $@
")
if
$@
;
Fatal
("
could not do
$file
: $!
")
if
$!
;
}
next
if
(
$check
);
# Then we run it.
if
(
DoUpdate
(
$dbnumber
,
$dbname
,
$revision
)
!=
0
)
{
Fatal
("
returned non-zero; aborting.
\n
");
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment