зеркало из https://github.com/mozilla/pjs.git
Bug 329070 - Support -l (no recursive) mode with fact-update. r=benjamin
This commit is contained in:
Родитель
9bdba482bb
Коммит
bb4cf2d506
|
@ -114,8 +114,10 @@ AVAILABLE_PROJECTS = \
|
||||||
macbrowser \
|
macbrowser \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
|
# Trailing / on top-level mozilla dir required to stop fast-update thinking
|
||||||
|
# it is a module name.
|
||||||
MODULES_NS_core := \
|
MODULES_NS_core := \
|
||||||
mozilla \
|
mozilla/ \
|
||||||
mozilla/js \
|
mozilla/js \
|
||||||
mozilla/js/src \
|
mozilla/js/src \
|
||||||
mozilla/js/jsd \
|
mozilla/js/jsd \
|
||||||
|
|
|
@ -13,6 +13,7 @@ my $start_time = time();
|
||||||
my $branch;
|
my $branch;
|
||||||
my @modules;
|
my @modules;
|
||||||
my @dirs;
|
my @dirs;
|
||||||
|
my $dirlocal = 0;
|
||||||
|
|
||||||
print "$0: (".join(')(',@ARGV).")\n";
|
print "$0: (".join(')(',@ARGV).")\n";
|
||||||
while (scalar(@ARGV)) {
|
while (scalar(@ARGV)) {
|
||||||
|
@ -32,6 +33,11 @@ while (scalar(@ARGV)) {
|
||||||
#print "branch = $branch\n";
|
#print "branch = $branch\n";
|
||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
|
elsif ($val eq '-l') {
|
||||||
|
$dirlocal = 1;
|
||||||
|
#print "dirlocal = $dirlocal\n";
|
||||||
|
next;
|
||||||
|
}
|
||||||
elsif ($val =~ /^-/) {
|
elsif ($val =~ /^-/) {
|
||||||
print "*** unknown switch: $val\n";
|
print "*** unknown switch: $val\n";
|
||||||
exit 1;
|
exit 1;
|
||||||
|
@ -57,12 +63,12 @@ if (!$branch) {
|
||||||
|
|
||||||
my $status = 0;
|
my $status = 0;
|
||||||
foreach my $mod (@modules) {
|
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";
|
#print "system \"$cmd\"\n";
|
||||||
$status |= system $cmd;
|
$status |= system $cmd;
|
||||||
}
|
}
|
||||||
foreach my $d (@dirs) {
|
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";
|
#print "system \"$cmd\"\n";
|
||||||
$status |= system $cmd;
|
$status |= system $cmd;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,10 +25,11 @@ my $maxdirs=5;
|
||||||
my $rootdir = "";
|
my $rootdir = "";
|
||||||
my $hours = 0;
|
my $hours = 0;
|
||||||
my $dir = '';
|
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) {
|
if ($dir) {
|
||||||
chdir '..';
|
chdir '..';
|
||||||
chdir $dir;
|
chdir $dir;
|
||||||
|
@ -106,6 +107,7 @@ print "Contacting bonsai for updates to ${module} ";
|
||||||
print "on the ${branch} branch " if ($branch);
|
print "on the ${branch} branch " if ($branch);
|
||||||
print "in the last ${hours} hours ";
|
print "in the last ${hours} hours ";
|
||||||
print "within the $rootdir directory..\n" if ($rootdir);
|
print "within the $rootdir directory..\n" if ($rootdir);
|
||||||
|
print "\n" unless ($rootdir);
|
||||||
#print "url = $url\n";
|
#print "url = $url\n";
|
||||||
|
|
||||||
# first try wget, then try lynx, then try curl
|
# first try wget, then try lynx, then try curl
|
||||||
|
@ -167,7 +169,8 @@ foreach $dir (sort @dirlist) {
|
||||||
|
|
||||||
if ($dir eq $rootdir) {
|
if ($dir eq $rootdir) {
|
||||||
$strippeddir = ".";
|
$strippeddir = ".";
|
||||||
} else {
|
} elsif (!$dirlocal) {
|
||||||
|
# for local-only updates, skip all sub-dirs
|
||||||
$strippeddir = substr($dir,(length $rootdir) + 1 );
|
$strippeddir = substr($dir,(length $rootdir) + 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,7 +186,7 @@ foreach $dir (sort @dirlist) {
|
||||||
|
|
||||||
my $status = 0;
|
my $status = 0;
|
||||||
if (scalar(@uniquedirs)) {
|
if (scalar(@uniquedirs)) {
|
||||||
print "Updating tree..($#uniquedirs directories)\n";
|
print "Updating tree... (" . scalar(@uniquedirs) . " directories)\n";
|
||||||
my $i=0;
|
my $i=0;
|
||||||
my $dirlist = "";
|
my $dirlist = "";
|
||||||
foreach $dir (sort @uniquedirs) {
|
foreach $dir (sort @uniquedirs) {
|
||||||
|
|
Загрузка…
Ссылка в новой задаче