Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
7cffbee5
Commit
7cffbee5
authored
Sep 19, 2002
by
Robert Ricci
Browse files
Add a new 'rand' option that causes the output to be done in random
order. To be used to by the testsuite.
parent
d6a3dcbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
db/avail.in
View file @
7cffbee5
...
...
@@ -20,13 +20,14 @@ my $d = 0; #debug mode
if
(
$#ARGV
>=
0
&&
$ARGV
[
0
]
=~
/^-?h/i
)
{
die
("
Usage:
\n
avail [help] [type[=<type>]] [OS[=<OS>]] [ver[=<OS_ver>]]
\n
"
.
"
[includevirt]
\n
"
.
"
[includevirt]
[rand]
\n
"
.
#" [deltas=<delta[,delta,...]>]".
# " [fixes=<fix_name[,fix_name,...]>]".
"
\n
"
.
"
type
\t
= pc | shark
\n
"
.
"
OS
\t
= Linux | FreeBSD | NetBSD | ...
\n
"
.
"
ver
\t
= 6.2 | 3.4 | 4.0 | 5.2 | ...
\n
"
.
#"deltas \t= anetd | ...\n".
"
includevirt: Include virtual nodes
\n
"
.
"
rand: Randomize result order
\n
"
.
# "fixes \t\t= cron_off | sendmail_off | ...\n"
"
A field name alone will show that field in the display of available
\n
"
.
"
nodes. A field name with '=' followed by a string will match nodes
\n
"
.
...
...
@@ -63,6 +64,12 @@ if ($args{"includevirt"}) {
$cond
.=
"
)
";
}
if
(
$args
{"
rand
"})
{
$order
=
"
rand()
";
}
else
{
$order
=
"
priority
";
}
my
$os
=
0
;
my
$delta
=
0
;
...
...
@@ -99,7 +106,7 @@ if ($os) {
# }
my
$cmd
=
"
select
$cols
from
$join
where
$cond
order by
priority
";
my
$cmd
=
"
select
$cols
from
$join
where
$cond
order by
$order
";
print
"
Sending cmd:
\n
$cmd
\n
"
if
$d
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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