зеркало из https://github.com/mozilla/gecko-dev.git
r=pedemont, sr=dveditz Remove 99.9% OS/2 stuff from Packager.pm - we're going to take the Unix path
This commit is contained in:
Родитель
0b41e09793
Коммит
a4796d58a1
|
@ -33,7 +33,7 @@ my($line) = ""; # line being processed
|
||||||
my($srcdir) = ""; # root directory being copied from
|
my($srcdir) = ""; # root directory being copied from
|
||||||
my($destdir) = ""; # root directory being copied to
|
my($destdir) = ""; # root directory being copied to
|
||||||
my($package) = ""; # file listing files to copy
|
my($package) = ""; # file listing files to copy
|
||||||
my($os) = ""; # os type (MacOS, MSDOS, Unix, OS/2)
|
my($os) = ""; # os type (MacOS, MSDOS, Unix)
|
||||||
my($lineno) = 0; # line # of package file for error text
|
my($lineno) = 0; # line # of package file for error text
|
||||||
my($debug) = 0; # controls amount of debug output
|
my($debug) = 0; # controls amount of debug output
|
||||||
my($dirflag) = 0; # flag: are we copying a directory?
|
my($dirflag) = 0; # flag: are we copying a directory?
|
||||||
|
@ -208,7 +208,6 @@ sub do_copyfile
|
||||||
my ($srcpath) = ""; # source file directory path
|
my ($srcpath) = ""; # source file directory path
|
||||||
my ($srcname) = ""; # source file name
|
my ($srcname) = ""; # source file name
|
||||||
my ($srcsuffix) = ""; # source file name suffix
|
my ($srcsuffix) = ""; # source file name suffix
|
||||||
my ($curdir) = getcwd; # need current dir on OS/2 to switch back
|
|
||||||
|
|
||||||
($debug >= 2) && print "do_copyfile():\n";
|
($debug >= 2) && print "do_copyfile():\n";
|
||||||
|
|
||||||
|
@ -266,14 +265,6 @@ sub do_copyfile
|
||||||
$destpath =~ s/\//\\/g;
|
$destpath =~ s/\//\\/g;
|
||||||
$srcdir =~ s/\//\\/g;
|
$srcdir =~ s/\//\\/g;
|
||||||
$PD = "\\";
|
$PD = "\\";
|
||||||
} elsif ( $os eq "OS2") {
|
|
||||||
#Don't Look! Seriously...
|
|
||||||
$destpath =~ s/\\/\//g;
|
|
||||||
$srcdir =~ s/\\/\//g;
|
|
||||||
$PD = "/";
|
|
||||||
$destpath =~ s/$srcdir$PD//g;
|
|
||||||
$destpath = "$srcdir$PD$destpath";
|
|
||||||
$PD = "\\";
|
|
||||||
} else {
|
} else {
|
||||||
$destpath =~ s/$srcdir$PD//;
|
$destpath =~ s/$srcdir$PD//;
|
||||||
}
|
}
|
||||||
|
@ -288,16 +279,11 @@ sub do_copyfile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#Ensure correct directory
|
|
||||||
if ($os eq "OS2") {
|
|
||||||
chdir($saved_cwd);
|
|
||||||
}
|
|
||||||
|
|
||||||
# create the destination path if it doesn't exist
|
# create the destination path if it doesn't exist
|
||||||
if (! -d "$destpath" ) {
|
if (! -d "$destpath" ) {
|
||||||
($debug >= 5) && print " mkpath($destpath)\n";
|
($debug >= 5) && print " mkpath($destpath)\n";
|
||||||
#OS2 hack. Sorry... Chop off "/"
|
# For OS/2 - remove trailing '/'
|
||||||
chop($destpath);
|
chop($destpath);
|
||||||
mkpath ($destpath, 0, 0755) ||
|
mkpath ($destpath, 0, 0755) ||
|
||||||
die "Error: mkpath() failed: $!. Exiting...\n";
|
die "Error: mkpath() failed: $!. Exiting...\n";
|
||||||
# Put delimeter back for copying...
|
# Put delimeter back for copying...
|
||||||
|
@ -333,10 +319,6 @@ sub do_copyfile
|
||||||
} else {
|
} else {
|
||||||
warn "Error: file $srcpath$srcname$srcsuffix is not a file or is not readable ($package, $component, $lineno).\n";
|
warn "Error: file $srcpath$srcname$srcsuffix is not a file or is not readable ($package, $component, $lineno).\n";
|
||||||
}
|
}
|
||||||
#Resetting dir...
|
|
||||||
if ($os eq "OS2") {
|
|
||||||
chdir($curdir);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -357,10 +339,6 @@ sub do_wildcard
|
||||||
if ($os eq "MacOS") {
|
if ($os eq "MacOS") {
|
||||||
warn "Warning: globbing on Mac not supported.\nWorkaround is to copy entire directory.\n";
|
warn "Warning: globbing on Mac not supported.\nWorkaround is to copy entire directory.\n";
|
||||||
@list = <$entry>;
|
@list = <$entry>;
|
||||||
} elsif ( $os eq "OS2") {
|
|
||||||
#warn "Warning: globbing on OS/2 not supported.\nWorkaround is to copy entire directory.\n";
|
|
||||||
@list = $entry;
|
|
||||||
chop($list[0]);
|
|
||||||
} else {
|
} else {
|
||||||
@list = glob($entry); # expand it
|
@list = glob($entry); # expand it
|
||||||
}
|
}
|
||||||
|
@ -499,7 +477,7 @@ sub check_arguments
|
||||||
$exitval += 4;
|
$exitval += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
# check OS == {mac|unix|dos|os2}
|
# check OS == {mac|unix|dos}
|
||||||
if ($os eq "") {
|
if ($os eq "") {
|
||||||
print "Error: OS type (--os) not specified.\n";
|
print "Error: OS type (--os) not specified.\n";
|
||||||
$exitval += 8;
|
$exitval += 8;
|
||||||
|
@ -515,10 +493,6 @@ sub check_arguments
|
||||||
$os = "Unix"; # can be anything but MacOS, MSDOS, or VMS
|
$os = "Unix"; # can be anything but MacOS, MSDOS, or VMS
|
||||||
$PD = "/";
|
$PD = "/";
|
||||||
fileparse_set_fstype ($os);
|
fileparse_set_fstype ($os);
|
||||||
} elsif ( $os =~ /os2/i) {
|
|
||||||
$os = "OS2";
|
|
||||||
$PD = "/";
|
|
||||||
fileparse_set_fstype($os);
|
|
||||||
} else {
|
} else {
|
||||||
print "Error: OS type \"$os\" unknown.\n";
|
print "Error: OS type \"$os\" unknown.\n";
|
||||||
$exitval += 16;
|
$exitval += 16;
|
||||||
|
@ -581,7 +555,7 @@ NOTE: Source and destination directories must be absolute paths.
|
||||||
destination directory.
|
destination directory.
|
||||||
Required.
|
Required.
|
||||||
|
|
||||||
-o, --os [dos|mac|unix|os2]
|
-o, --os [dos|mac|unix]
|
||||||
Specifies which type of system this is. Used for parsing
|
Specifies which type of system this is. Used for parsing
|
||||||
file specifications from the package file.
|
file specifications from the package file.
|
||||||
Required.
|
Required.
|
||||||
|
|
|
@ -39,13 +39,11 @@ use File::Basename;
|
||||||
|
|
||||||
# initialize variables
|
# initialize variables
|
||||||
%components = (); # list of components to copy
|
%components = (); # list of components to copy
|
||||||
$line = ""; # line being processed
|
|
||||||
$srcdir = ""; # root directory being copied from
|
$srcdir = ""; # root directory being copied from
|
||||||
$destdir = ""; # root directory being copied to
|
$destdir = ""; # root directory being copied to
|
||||||
$package = ""; # file listing files to copy
|
$package = ""; # file listing files to copy
|
||||||
$os = ""; # os type (MacOS, MSDOS, Unix, OS/2)
|
$os = ""; # os type (MacOS, MSDOS, Unix, OS/2)
|
||||||
$verbose = 0; # shorthand for --debug 1
|
$verbose = 0; # shorthand for --debug 1
|
||||||
$lineno = 0; # line # of package file for error text
|
|
||||||
$debug = 0; # controls amount of debug output
|
$debug = 0; # controls amount of debug output
|
||||||
$help = 0; # flag: if set, print usage
|
$help = 0; # flag: if set, print usage
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче