Bug 329070 - Support -l (no recursive) mode with fact-update. r=benjamin

This commit is contained in:
silver%warwickcompsoc.co.uk 2006-04-08 22:55:53 +00:00
Родитель a7f77479db
Коммит 1326db6cf5
3 изменённых файлов: 18 добавлений и 7 удалений

Просмотреть файл

@ -114,8 +114,10 @@ AVAILABLE_PROJECTS = \
macbrowser \
$(NULL)
# Trailing / on top-level mozilla dir required to stop fast-update thinking
# it is a module name.
MODULES_NS_core := \
mozilla \
mozilla/ \
mozilla/js \
mozilla/js/src \
mozilla/js/jsd \

Просмотреть файл

@ -13,6 +13,7 @@ my $start_time = time();
my $branch;
my @modules;
my @dirs;
my $dirlocal = 0;
print "$0: (".join(')(',@ARGV).")\n";
while (scalar(@ARGV)) {
@ -32,6 +33,11 @@ while (scalar(@ARGV)) {
#print "branch = $branch\n";
next;
}
elsif ($val eq '-l') {
$dirlocal = 1;
#print "dirlocal = $dirlocal\n";
next;
}
elsif ($val =~ /^-/) {
print "*** unknown switch: $val\n";
exit 1;
@ -57,12 +63,12 @@ if (!$branch) {
my $status = 0;
foreach my $mod (@modules) {
my $cmd = "config/fast-update.pl -r $branch -m $mod";
my $cmd = "config/fast-update.pl -r $branch -m $mod" . ($dirlocal ? " -l" : "");
#print "system \"$cmd\"\n";
$status |= system $cmd;
}
foreach my $d (@dirs) {
my $cmd = "config/fast-update.pl -r $branch -d $d -m all";
my $cmd = "config/fast-update.pl -r $branch -d $d -m all" . ($dirlocal ? " -l" : "");
#print "system \"$cmd\"\n";
$status |= system $cmd;
}

Просмотреть файл

@ -25,10 +25,11 @@ my $maxdirs=5;
my $rootdir = "";
my $hours = 0;
my $dir = '';
my $dirlocal = 0;
&GetOptions('d=s' => \$dir, 'h=s' => \$hours, 'm=s' => \$module, 'r=s' => \$branch);
&GetOptions('d=s' => \$dir, 'h=s' => \$hours, 'm=s' => \$module, 'r=s' => \$branch, 'l' => \$dirlocal);
#print "dir = ($dir), hours = ($hours), module = ($module), branch = ($branch)\n";
#print "dir = ($dir), hours = ($hours), module = ($module), branch = ($branch), dirlocal = ($dirlocal)\n";
if ($dir) {
chdir '..';
chdir $dir;
@ -106,6 +107,7 @@ print "Contacting bonsai for updates to ${module} ";
print "on the ${branch} branch " if ($branch);
print "in the last ${hours} hours ";
print "within the $rootdir directory..\n" if ($rootdir);
print "\n" unless ($rootdir);
#print "url = $url\n";
# first try wget, then try lynx, then try curl
@ -167,7 +169,8 @@ foreach $dir (sort @dirlist) {
if ($dir eq $rootdir) {
$strippeddir = ".";
} else {
} elsif (!$dirlocal) {
# for local-only updates, skip all sub-dirs
$strippeddir = substr($dir,(length $rootdir) + 1 );
}
@ -183,7 +186,7 @@ foreach $dir (sort @dirlist) {
my $status = 0;
if (scalar(@uniquedirs)) {
print "Updating tree..($#uniquedirs directories)\n";
print "Updating tree... (" . scalar(@uniquedirs) . " directories)\n";
my $i=0;
my $dirlist = "";
foreach $dir (sort @uniquedirs) {