File new.php changed (mode: 100644) (index cdc197e..b757648) |
... |
... |
if (sizeof($argv) < 3) { |
25 |
25 |
|
|
26 |
26 |
$name = $argv[1]; |
$name = $argv[1]; |
27 |
27 |
$revision = $argv[2]; |
$revision = $argv[2]; |
|
28 |
|
$builders = array_slice($argv, 3); |
28 |
29 |
|
|
29 |
30 |
if (substr($name, 0, strlen('fragile/')) === 'fragile/') { |
if (substr($name, 0, strlen('fragile/')) === 'fragile/') { |
30 |
31 |
$command = substr($name, strlen('fragile/')); |
$command = substr($name, strlen('fragile/')); |
31 |
|
switch ($command) { |
|
|
32 |
|
$pieces = explode('%', $command); |
|
33 |
|
switch ($pieces[0]) { |
32 |
34 |
case 'clean': |
case 'clean': |
33 |
35 |
// XXX: ideally, this would only schedule the operation for the |
// XXX: ideally, this would only schedule the operation for the |
34 |
36 |
// daemon; currently, we can change FS in parallel with it |
// daemon; currently, we can change FS in parallel with it |
35 |
37 |
Utils::delTree(BUILDS_PATH); |
Utils::delTree(BUILDS_PATH); |
36 |
38 |
exit("Cleaned ".BUILDS_PATH); |
exit("Cleaned ".BUILDS_PATH); |
|
39 |
|
case 'repeat': |
|
40 |
|
if (sizeof($pieces) != 2) { |
|
41 |
|
die('repeat command expects an argument'); |
|
42 |
|
} |
|
43 |
|
|
|
44 |
|
$buildset = Buildset::get($pieces[1]); |
|
45 |
|
if ($buildset === null) { |
|
46 |
|
die("repeat command expects a valid buildset id as an ". |
|
47 |
|
"argument\ngot: ${pieces[1]}"); |
|
48 |
|
} |
|
49 |
|
|
|
50 |
|
$name = $buildset->name; |
|
51 |
|
$revision = $buildset->revision; |
|
52 |
|
$builders = []; |
|
53 |
|
|
|
54 |
|
print "Repeating $name@$revision from #{$pieces[1]}\n"; |
|
55 |
|
break; |
37 |
56 |
|
|
38 |
57 |
default: |
default: |
39 |
|
exit("Unknown command: .$command"); |
|
|
58 |
|
exit("Unknown command: $command"); |
40 |
59 |
} |
} |
41 |
60 |
} |
} |
42 |
61 |
|
|
43 |
62 |
$buildset = Buildset::create($name, $revision); |
$buildset = Buildset::create($name, $revision); |
44 |
63 |
|
|
45 |
|
if (sizeof($argv) > 3) { |
|
46 |
|
$builders = scheduleBuilders($buildset, BUILDERS_PATH, |
|
47 |
|
array_slice($argv, 3)); |
|
|
64 |
|
if (!empty($builders)) { |
|
65 |
|
$builders = scheduleBuilders($buildset, BUILDERS_PATH, $builders); |
48 |
66 |
} else { |
} else { |
49 |
67 |
$builders = scheduleBuildersIn($buildset, BUILDERS_PATH, ''); |
$builders = scheduleBuildersIn($buildset, BUILDERS_PATH, ''); |
50 |
68 |
$builders = array_merge($builders, |
$builders = array_merge($builders, |