From 063c710a247fff79aeaeb46cfd0244245f2ca553 Mon Sep 17 00:00:00 2001 From: "mkaply%us.ibm.com" Date: Tue, 29 Oct 2002 06:19:39 +0000 Subject: [PATCH] #175487 r=cls and r=pedemont (sr=blizzard for platform specific stuff), a=brendan OS/2 packaging scripts --- xpinstall/packager/Makefile.in | 5 +- xpinstall/packager/os2/deliver.pl | 217 ++++++++++++++++++++++++++ xpinstall/packager/os2/makeall.pl | 247 ++++++++++++++---------------- xpinstall/packager/os2/rdir.pl | 113 ++++++++++++++ xpinstall/packager/os2/strip.cmd | 3 + 5 files changed, 453 insertions(+), 132 deletions(-) create mode 100644 xpinstall/packager/os2/deliver.pl create mode 100644 xpinstall/packager/os2/rdir.pl create mode 100755 xpinstall/packager/os2/strip.cmd diff --git a/xpinstall/packager/Makefile.in b/xpinstall/packager/Makefile.in index de79679db8aa..d4bbdb0accdc 100644 --- a/xpinstall/packager/Makefile.in +++ b/xpinstall/packager/Makefile.in @@ -118,10 +118,11 @@ STRIP_FLAGS = -g PLATFORM_EXCLUDE_LIST = ! -name "*.stub" ! -name "mozilla-bin" endif ifeq ($(OS_ARCH),OS2) -STRIP = dllrname.exe -STRIP_FLAGS = cpprmi36=mozrmi36 +STRIP = $(srcdir)/os2/strip.cmd +STRIP_FLAGS = OSPACKAGE = os2 TAR_CREATE_FLAGS = -cvf +PLATFORM_EXCLUDE_LIST = ! -name "*.ico" endif $(PACKAGE): $(MOZILLA_BIN) diff --git a/xpinstall/packager/os2/deliver.pl b/xpinstall/packager/os2/deliver.pl new file mode 100644 index 000000000000..1921dbfa6e69 --- /dev/null +++ b/xpinstall/packager/os2/deliver.pl @@ -0,0 +1,217 @@ +#!c:\perl\bin\perl +# +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/NPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is Mozilla Communicator client code, +# released March 31, 1998. +# +# The Initial Developer of the Original Code is Netscape Communications +# Corporation. Portions created by Netscape are +# Copyright (C) 1999 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# Sean Su +# IBM Corp. + +# +# Purpose: +# To build the mozilla self-extracting installer and its corresponding .xpi files +# given a mozilla build on a local system. +# +# Requirements: +# 1. perl needs to be installed correctly on the build system because cwd.pm is used. +# 2. mozilla\xpinstall\wizard\os2 needs to be built. +# + +if($ENV{MOZ_SRC} eq "") +{ + print "Error: MOZ_SRC not set!"; + exit(1); +} + +if($ENV{MOZ_OBJDIR} eq "") +{ + print "Error: set MOZ_OBJDIR to the name of the objdir used!"; + exit(1); +} + +$inXpiURL = ""; +$inRedirIniURL = ""; + +ParseArgv(@ARGV); +if($inXpiURL eq "") +{ + # archive url not supplied, set it to default values + $inXpiURL = "ftp://not.supplied.com"; +} +if($inRedirIniURL eq "") +{ + # redirect url not supplied, set it to default value. + $inRedirIniURL = $inXpiURL; +} + +$DEPTH = "$ENV{MOZ_SRC}/mozilla"; +$cwdBuilder = "$DEPTH/xpinstall/wizard/os2/builder"; +$cwdDist = GetCwd("dist", $DEPTH, $ENV{MOZ_OBJDIR}, $cwdBuilder); +$cwdInstall = GetCwd("install", $DEPTH, $ENV{MOZ_OBJDIR}, $cwdBuilder); +$cwdPackager = GetCwd("packager", $DEPTH, $ENV{MOZ_OBJDIR}, $cwdBuilder); +$cwdConfig = GetCwd("config", $DEPTH, $ENV{MOZ_OBJDIR}, $cwdBuilder); + +#get version from configure.in +open(FILENEW, "<$DEPTH/configure.in"); +do { +$line = ; +} while ($line !~ /MOZILLA_VERSION/); +close(FILENEW); +($therest, $version) = split(/'/,$line); + +#get date from build_number file +open(FILENEW, "<$cwdConfig/build_number"); +$dateversion = ; +close(FILENEW); +chomp($dateversion); +$fullversion = join('.0.',$version,$dateversion); + +# Check for existence of mozilla.exe +$fileMozilla = "$DEPTH/$ENV{MOZ_OBJDIR}/dist/bin/mozilla.exe"; +if(!(-e "$fileMozilla")) +{ + print "file not found: $fileMozilla\n"; + exit(1); +} + +if(-d "$DEPTH/stage") +{ + system("perl $cwdPackager/os2/rdir.pl $DEPTH/stage"); +} + +# The destination cannot be a sub directory of the source. +# pkgcp.pl will get very unhappy. + +mkdir("$DEPTH/stage", 775); +system("perl $cwdPackager/pkgcp.pl -s $cwdDist -d $DEPTH/stage -f $cwdPackager/packages-os2 -o unix -v"); +system("perl $cwdPackager/xptlink.pl -s $cwdDist -d $DEPTH/stage -o unix -v"); + +chdir("$cwdPackager/os2"); +if(system("perl makeall.pl $fullversion $DEPTH/stage $cwdDist/install -aurl $inXpiURL -rurl $inRedirIniURL")) +{ + print "\n Error: perl makeall.pl $fullversion $DEPTH/stage $cwdDist/install $inXpiURL $inRedirIniURL\n"; + exit(1); +} + +exit(0); + +sub PrintUsage +{ + die "usage: $0 [options] + + options available are: + + -h - this usage. + + -aurl - ftp or http url for where the archives (.xpi, exe, .zip, etx...) are. + ie: ftp://my.ftp.com/mysoftware/version1.0/xpi + + -rurl - ftp or http url for where the redirect.ini file is located at. + ie: ftp://my.ftp.com/mysoftware/version1.0 + + This url can be the same as the archive url. + If -rurl is not supplied, it will be assumed that the redirect.ini + file is at -arul. + \n"; +} + +sub ParseArgv +{ + my(@myArgv) = @_; + my($counter); + + for($counter = 0; $counter <= $#myArgv; $counter++) + { + if($myArgv[$counter] =~ /^[-,\/]h$/i) + { + PrintUsage(); + } + elsif($myArgv[$counter] =~ /^[-,\/]aurl$/i) + { + if($#myArgv >= ($counter + 1)) + { + ++$counter; + $inXpiURL = $myArgv[$counter]; + $inRedirIniURL = $inXpiURL; + } + } + elsif($myArgv[$counter] =~ /^[-,\/]rurl$/i) + { + if($#myArgv >= ($counter + 1)) + { + ++$counter; + $inRedirIniURL = $myArgv[$counter]; + } + } + } +} + +sub GetCwd +{ + my($whichPath, $depthPath, $objdirName, $returnCwd) = @_; + my($distCwd); + my($distPath); + + if($whichPath eq "dist") + { + # verify the existance of path + if(!(-e "$depthPath/$objdirName/dist")) + { + print "path not found: $depthPath/$objDirName/dist\n"; + exit(1); + } + + $distPath = "$depthPath/$objdirName/dist"; + } + elsif($whichPath eq "install") + { + # verify the existance of path + if(!(-e "$depthPath/$objdirName/dist/install")) + { + print "path not found: $depthPath/$objdirName/dist/install\n"; + exit(1); + } + + $distPath = "$depthPath/$objdirname/install"; + } + elsif($whichPath eq "packager") + { + # verify the existance of path + if(!(-e "$depthPath/xpinstall/packager")) + { + print "path not found: $depthPath/xpinstall/packager\n"; + exit(1); + } + + $distPath = "$depthPath/xpinstall/packager"; + } + elsif($whichPath eq "config") + { + # verify the existance of path + if(!(-e "$depthPath/$objdirName/config")) + { + print "path not found: $depthPath/$objdirName/config\n"; + exit(1); + } + + $distPath = "$depthPath/$objdirName/config"; + } + + return($distPath); +} + diff --git a/xpinstall/packager/os2/makeall.pl b/xpinstall/packager/os2/makeall.pl index 452efee06891..4ac16611ad01 100644 --- a/xpinstall/packager/os2/makeall.pl +++ b/xpinstall/packager/os2/makeall.pl @@ -154,31 +154,31 @@ if(!(-d "$inDistPath")) mkdir ("$inDistPath",0775); } -if(-d "$inDistPath\\xpi") +if(-d "$inDistPath/xpi") { unlink <$inDistPath/xpi/*>; } else { - mkdir ("$inDistPath\\xpi",0775); + mkdir ("$inDistPath/xpi",0775); } -if(-d "$inDistPath\\uninstall") +if(-d "$inDistPath/uninstall") { unlink <$inDistPath/uninstall/*>; } else { - mkdir ("$inDistPath\\uninstall",0775); + mkdir ("$inDistPath/uninstall",0775); } -if(-d "$inDistPath\\setup") +if(-d "$inDistPath/setup") { unlink <$inDistPath/setup/*>; } else { - mkdir ("$inDistPath\\setup",0775); + mkdir ("$inDistPath/setup",0775); } if(MakeXpiFile()) @@ -195,74 +195,58 @@ if(MakeConfigFile()) } # Copy the setup files to the dist setup directory. -if(system("cp install.ini $inDistPath")) +if(system("cp install.ini $inDistPath/setup")) { - die "\n Error: copy install.ini $inDistPath\n"; + die "\n Error: copy install.ini $inDistPath/setup\n"; } -if(system("cp install.ini $inDistPath\\setup")) +if(system("cp config.ini $inDistPath/setup")) { - die "\n Error: copy install.ini $inDistPath\\setup\n"; + die "\n Error: copy config.ini $inDistPath/setup\n"; } -if(system("cp config.ini $inDistPath")) +if(system("cp $inDistPath/setup.exe $inDistPath/setup")) { - die "\n Error: copy config.ini $inDistPath\n"; + die "\n Error: cp $inDistPath/setup.exe $inDistPath/setup\n"; } -if(system("cp config.ini $inDistPath\\setup")) +if(system("cp $inDistPath/setuprsc.dll $inDistPath/setup")) { - die "\n Error: copy config.ini $inDistPath\\setup\n"; -} -if(system("cp $inDistPath\\setup.exe $inDistPath\\setup")) -{ - die "\n Error: copy $inDistPath\\setup.exe $inDistPath\\setup\n"; -} -if(system("cp $inDistPath\\setuprsc.dll $inDistPath\\setup")) -{ - die "\n Error: copy $inDistPath\\setuprsc.dll $inDistPath\\setup\n"; + die "\n Error: cp $inDistPath/setuprsc.dll $inDistPath/setup\n"; } # copy license file for the installer -if(system("cp $ENV{MOZ_SRC}\\mozilla\\LICENSE $inDistPath\\license.txt")) +if(system("cp $ENV{MOZ_SRC}/mozilla/LICENSE $inDistPath/setup/license.txt")) { - die "\n Error: copy $ENV{MOZ_SRC}\\mozilla\\LICENSE $inDistPath\\license.txt\n"; -} -if(system("cp $ENV{MOZ_SRC}\\mozilla\\LICENSE $inDistPath\\setup\\license.txt")) -{ - die "\n Error: copy $ENV{MOZ_SRC}\\mozilla\\LICENSE $inDistPath\\setup\\license.txt\n"; + die "\n Error: copy $ENV{MOZ_SRC}/mozilla/LICENSE $inDistPath/setup/license.txt\n"; } - copy readme for the installer -if(system("cp $ENV{MOZ_SRC}\\mozilla\\README.TXT $inDistPath\\readme.txt")) +# copy readme for the installer +if(system("cp $ENV{MOZ_SRC}/mozilla/README.TXT $inDistPath/setup/readme.txt")) { - die "\n Error: copy $ENV{MOZ_SRC}\\mozilla\\README.TXT $inDistPath\\readme.txt\n"; -} -if(system("cp $ENV{MOZ_SRC}\\mozilla\\README.TXT $inDistPath\\setup\\readme.txt")) -{ - die "\n Error: copy $ENV{MOZ_SRC}\\mozilla\\README.TXT $inDistPath\\setup\\readme.txt\n"; + die "\n Error: copy $ENV{MOZ_SRC}/mozilla/README.TXT $inDistPath/setup/readme.txt\n"; } # copy the icons -#if(system("cp $inDistPath\\mozilla.ico $inDistPath\\setup\\mozilla.ico")) +#if(system("cp $inDistPath/mozilla.ico $inDistPath/setup/mozilla.ico")) #{ -# die "\n Error: copy $inDistPath\\mozilla.ico $inDistPath\\setup\\mozilla.ico\n"; +# die "\n Error: copy $inDistPath/mozilla.ico $inDistPath/setup/mozilla.ico\n"; #} # build the self-extracting .exe (installer) file. print "\nbuilding self-extracting stub installer ($seiFileNameSpecificStub)...\n"; -if(system("cp $inDistPath\\$seiFileNameGeneric $inDistPath\\$seiFileNameSpecificStub")) +if(system("cp $inDistPath/$seiFileNameGeneric $inDistPath/$seiFileNameSpecificStub")) { - die "\n Error: copy $inDistPath\\$seiFileNameGeneric $inDistPath\\$seiFileNameSpecificStub\n"; + die "\n Error: copy $inDistPath/$seiFileNameGeneric $inDistPath/$seiFileNameSpecificStub\n"; } -if(system("cp $inDistPath\\$seiFileNameGenericRes $inDistPath\\$seiFileNameSpecificStubRes")) +if(system("cp $inDistPath/$seiFileNameGenericRes $inDistPath/$seiFileNameSpecificStubRes")) { - die "\n Error: copy $inDistPath\\$seiFileNameGenericRes $inDistPath\\$seiFileNameSpecificStubRes\n"; + die "\n Error: copy $inDistPath/$seiFileNameGenericRes $inDistPath/$seiFileNameSpecificStubRes\n"; } @stubFiles = <$inDistPath/setup/*.*>; -$size = (-s "$inDistPath\\$seiFileNameSpecificStubRes"); -truncate("$inDistPath\\$seiFileNameSpecificStubRes", "$size-1"); -open(OUTPUTFILE, ">$inDistPath\\$seiFileNameSpecificStubRC"); +$size = (-s "$inDistPath/$seiFileNameSpecificStubRes"); +truncate("$inDistPath/$seiFileNameSpecificStubRes", "$size-1"); +open(OUTPUTFILE, ">$inDistPath/$seiFileNameSpecificStubRC"); print OUTPUTFILE "#include \n"; print OUTPUTFILE "STRINGTABLE DISCARDABLE\n"; print OUTPUTFILE "BEGIN\n"; @@ -281,12 +265,12 @@ foreach $entry ( @stubFiles ) $currentResourceID++; } close(OUTPUTFILE); -system("rc -r $inDistPath\\$seiFileNameSpecificStubRC $inDistPath\\temp.res"); -system("cat $inDistPath\\$seiFileNameSpecificStubRes $inDistPath\\temp.res > $inDistPath\\new.res"); -unlink("$inDistPath\\$seiFileNameSpecificStubRes"); -rename("$inDistPath\\new.res", "$inDistPath\\$seiFileNameSpecificStubRes"); -unlink("$inDistPath\\temp.res"); -system("rc $inDistPath\\$seiFileNameSpecificStubRes $inDistPath\\$seiFileNameSpecificStub"); +system("rc -r $inDistPath/$seiFileNameSpecificStubRC $inDistPath/temp.res"); +system("cat $inDistPath/$seiFileNameSpecificStubRes $inDistPath/temp.res > $inDistPath/new.res"); +unlink("$inDistPath/$seiFileNameSpecificStubRes"); +rename("$inDistPath/new.res", "$inDistPath/$seiFileNameSpecificStubRes"); +unlink("$inDistPath/temp.res"); +system("rc $inDistPath/$seiFileNameSpecificStubRes $inDistPath/$seiFileNameSpecificStub"); # copy the lean installer to stub\ dir print "\n****************************\n"; @@ -294,7 +278,7 @@ print "* *\n"; print "* creating Stub files... *\n"; print "* *\n"; print "****************************\n"; -if(-d "$inDistPath\\stub") +if(-d "$inDistPath/stub") { unlink <$inDistPath/stub/*>; } @@ -302,9 +286,9 @@ else { mkdir ("$inDistPath/stub",0775); } -if(system("cp $inDistPath\\$seiFileNameSpecificStub $inDistPath\\stub")) +if(system("cp $inDistPath/$seiFileNameSpecificStub $inDistPath/stub")) { - die "\n Error: copy $inDistPath\\$seiFileNameSpecificStub $inDistPath\\stub\n"; + die "\n Error: copy $inDistPath/$seiFileNameSpecificStub $inDistPath/stub\n"; } # create the xpi for launching the stub installer @@ -313,17 +297,17 @@ print "* *\n"; print "* creating stub installer xpi... *\n"; print "* *\n"; print "************************************\n"; -if(-d "$inStagePath\\$seiStubRootName") +if(-d "$inStagePath/$seiStubRootName") { - unlink <$inStagePath\\$seiStubRootName\\*>; + unlink <$inStagePath/$seiStubRootName/*>; } else { - mkdir ("$inStagePath\\$seiStubRootName",0775); + mkdir ("$inStagePath/$seiStubRootName",0775); } -if(system("cp $inDistPath\\stub\\$seiFileNameSpecificStub $gLocalTmpStage\\$seiStubRootName")) +if(system("cp $inDistPath/stub/$seiFileNameSpecificStub $gLocalTmpStage/$seiStubRootName")) { - die "\n Error: copy $inDistPath\\stub\\$seiFileNameSpecificStub $gLocalTmpStage\\$seiStubRootName\n"; + die "\n Error: copy $inDistPath/stub/$seiFileNameSpecificStub $gLocalTmpStage/$seiStubRootName\n"; } # Make .js files @@ -339,27 +323,32 @@ if(system("perl makexpi.pl $seiStubRootName $gLocalTmpStage $inDistPath")) return(1); } +if(system("mv $inDistPath/$seiStubRootName.xpi $inDistPath/stub")) +{ + die "\n Error: mv $inDistPath/$seiStubRootName.xpi $inDistPath/stub\n"; +} + # group files for CD print "\n************************************\n"; print "* *\n"; print "* creating Compact Disk files... *\n"; print "* *\n"; print "************************************\n"; -if(-d "$inDistPath\\cd") +if(-d "$inDistPath/cd") { - unlink <$inDistPath\\cd\\*>; + unlink <$inDistPath/cd/*>; } else { - mkdir ("$inDistPath\\cd",0775); + mkdir ("$inDistPath/cd",0775); } -if(system("cp $inDistPath\\$seiFileNameSpecificStub $inDistPath\\cd")) +if(system("mv $inDistPath/$seiFileNameSpecificStub $inDistPath/cd")) { - die "\n Error: copy $inDistPath\\$seiFileNameSpecificStub $inDistPath\\cd\n"; + die "\n Error: mv $inDistPath/$seiFileNameSpecificStub $inDistPath/cd\n"; } if(system("cp $inDistPath/xpi/* $inDistPath/cd")) { - die "\n Error: copy $inDistPath\\xpi $inDistPath\\cd\n"; + die "\n Error: copy $inDistPath/xpi $inDistPath/cd\n"; } # create the big self extracting .exe installer @@ -368,30 +357,30 @@ print "* *\n"; print "* creating Self Extracting Executable Full Install file... *\n"; print "* *\n"; print "**************************************************************\n"; -if(-d "$inDistPath\\sea") +if(-d "$inDistPath/sea") { - unlink <$inDistPath\\sea\\*>; + unlink <$inDistPath/sea/*>; } else { - mkdir ("$inDistPath\\sea",0775); + mkdir ("$inDistPath/sea",0775); } -if(system("cp $inDistPath\\$seiFileNameGeneric $inDistPath\\$seiFileNameSpecific")) +if(system("cp $inDistPath/$seiFileNameGeneric $inDistPath/$seiFileNameSpecific")) { - die "\n Error: copy $inDistPath\\$seiFileNameGeneric $inDistPath\\$seiFileNameSpecific\n"; + die "\n Error: copy $inDistPath/$seiFileNameGeneric $inDistPath/$seiFileNameSpecific\n"; } -if(system("cp $inDistPath\\$seiFileNameGenericRes $inDistPath\\$seiFileNameSpecificRes")) +if(system("cp $inDistPath/$seiFileNameGenericRes $inDistPath/$seiFileNameSpecificRes")) { - die "\n Error: copy $inDistPath\\$seiFileNameGenericRes $inDistPath\\$seiFileNameSpecificRes\n"; + die "\n Error: copy $inDistPath/$seiFileNameGenericRes $inDistPath/$seiFileNameSpecificRes\n"; } @stubFiles = <$inDistPath/setup/*.*>; @xpiFiles = <$inDistPath/xpi/*.*>; -$size = (-s "$inDistPath\\$seiFileNameSpecificRes"); -truncate("$inDistPath\\$seiFileNameSpecificRes", "$size-1"); -open(OUTPUTFILE, ">$inDistPath\\$seiFileNameSpecificRC"); +$size = (-s "$inDistPath/$seiFileNameSpecificRes"); +truncate("$inDistPath/$seiFileNameSpecificRes", "$size-1"); +open(OUTPUTFILE, ">$inDistPath/$seiFileNameSpecificRC"); print OUTPUTFILE "#include \n"; print OUTPUTFILE "STRINGTABLE DISCARDABLE\n"; print OUTPUTFILE "BEGIN\n"; @@ -421,18 +410,21 @@ foreach $entry ( @xpiFiles ) $currentResourceID++; } close(OUTPUTFILE); -system("rc -r $inDistPath\\$seiFileNameSpecificRC $inDistPath\\temp.res"); -system("cat $inDistPath\\$seiFileNameSpecificRes $inDistPath\\temp.res > $inDistPath\\new.res"); -unlink("$inDistPath\\$seiFileNameSpecificRes"); -rename("$inDistPath\\new.res", "$inDistPath\\$seiFileNameSpecificRes"); -unlink("$inDistPath\\temp.res"); -system("rc $inDistPath\\$seiFileNameSpecificRes $inDistPath\\$seiFileNameSpecific"); +system("rc -r $inDistPath/$seiFileNameSpecificRC $inDistPath/temp.res"); +system("cat $inDistPath/$seiFileNameSpecificRes $inDistPath/temp.res > $inDistPath/new.res"); +unlink("$inDistPath/$seiFileNameSpecificRes"); +rename("$inDistPath/new.res", "$inDistPath/$seiFileNameSpecificRes"); +unlink("$inDistPath/temp.res"); +system("rc $inDistPath/$seiFileNameSpecificRes $inDistPath/$seiFileNameSpecific"); -if(system("cp $inDistPath\\$seiFileNameSpecific $inDistPath\\sea")) +if(system("mv $inDistPath/$seiFileNameSpecific $inDistPath/sea")) { - die "\n Error: copy $inDistPath\\$seiFileNameSpecific $inDistPath\\sea\n"; + die "\n Error: mv $inDistPath/$seiFileNameSpecific $inDistPath/sea\n"; } -#unlink <$inDistPath\\$seiFileNameSpecificStub>; + +unlink <*.js>; +unlink <*.ini>; +unlink <*.template>; print " done!\n\n"; @@ -446,10 +438,10 @@ sub MakeExeZip $saveCwdir = cwd(); chdir($aSrcDir); - if(system("zip $inDistPath\\xpi\\$aZipFile $aExeFile")) + if(system("zip $inDistPath/xpi/$aZipFile $aExeFile")) { chdir($saveCwdir); - die "\n Error: zip $inDistPath\\xpi\\$aZipFile $aExeFile"; + die "\n Error: zip $inDistPath/xpi/$aZipFile $aExeFile"; } chdir($saveCwdir); } @@ -464,7 +456,7 @@ sub PrintUsage staging path : full path to where the components are staged at dist install path : full path to where the dist install dir is at. - ie: d:\\builds\\mozilla\\dist\\win32_o.obj\\install + ie: d:/builds/mozilla/dist/win32_o.obj/install options include: -aurl : either ftp:// or http:// url to where the @@ -512,16 +504,16 @@ sub ParseArgv sub MakeConfigFile { # Make config.ini file - if(system("perl makecfgini.pl config.it $inDefaultVersion $gLocalTmpStage $inDistPath\\xpi $inRedirIniURL $inXpiURL")) + if(system("perl makecfgini.pl config.it $inDefaultVersion $gLocalTmpStage $inDistPath/xpi $inRedirIniURL $inXpiURL")) { - print "\n Error: perl makecfgini.pl config.it $inDefaultVersion $gLocalTmpStage $inDistPath\\xpi $inRedirIniURL $inXpiURL\n"; + print "\n Error: perl makecfgini.pl config.it $inDefaultVersion $gLocalTmpStage $inDistPath/xpi $inRedirIniURL $inXpiURL\n"; return(1); } # Make install.ini file - if(system("perl makecfgini.pl install.it $inDefaultVersion $gLocalTmpStage $inDistPath\\xpi $inRedirIniURL $inXpiURL")) + if(system("perl makecfgini.pl install.it $inDefaultVersion $gLocalTmpStage $inDistPath/xpi $inRedirIniURL $inXpiURL")) { - print "\n Error: perl makecfgini.pl install.it $inDefaultVersion $gLocalTmpStage $inDistPath\\xpi $inRedirIniURL $inXpiURL\n"; + print "\n Error: perl makecfgini.pl install.it $inDefaultVersion $gLocalTmpStage $inDistPath/xpi $inRedirIniURL $inXpiURL\n"; return(1); } return(0); @@ -535,40 +527,35 @@ sub MakeUninstall } # Copy the uninstall files to the dist uninstall directory. - if(system("cp uninstall.ini $inDistPath")) + if(system("cp uninstall.ini $inDistPath/uninstall")) { - print "\n Error: copy uninstall.ini $inDistPath\n"; + print "\n Error: copy uninstall.ini $inDistPath/uninstall\n"; return(1); } - if(system("cp uninstall.ini $inDistPath\\uninstall")) + if(system("cp $inDistPath/uninstall.exe $inDistPath/uninstall")) { - print "\n Error: copy uninstall.ini $inDistPath\\uninstall\n"; - return(1); - } - if(system("cp $inDistPath\\uninstall.exe $inDistPath\\uninstall")) - { - print "\n Error: copy $inDistPath\\uninstall.exe $inDistPath\\uninstall\n"; + print "\n Error: cp $inDistPath/uninstall.exe $inDistPath/uninstall\n"; return(1); } # build the self-extracting .exe (uninstaller) file. print "\nbuilding self-extracting uninstaller ($seuFileNameSpecific)...\n"; - if(system("cp $inDistPath\\$seiFileNameGeneric $inDistPath\\$seuFileNameSpecific")) + if(system("cp $inDistPath/$seiFileNameGeneric $inDistPath/$seuFileNameSpecific")) { - print "\n Error: copy $inDistPath\\$seiFileNameGeneric $inDistPath\\$seuFileNameSpecific\n"; + print "\n Error: copy $inDistPath/$seiFileNameGeneric $inDistPath/$seuFileNameSpecific\n"; return(1); } - if(system("cp $inDistPath\\$seiFileNameGenericRes $inDistPath\\$seuFileNameSpecificRes")) + if(system("cp $inDistPath/$seiFileNameGenericRes $inDistPath/$seuFileNameSpecificRes")) { - die "\n Error: copy $inDistPath\\$seiFileNameGenericRes $inDistPath\\$seuFileNameSpecificRes\n"; + die "\n Error: copy $inDistPath/$seiFileNameGenericRes $inDistPath/$seuFileNameSpecificRes\n"; } @stubFiles = <$inDistPath/uninstall/*.*>; - $size = (-s "$inDistPath\\$seuFileNameSpecificRes"); - truncate("$inDistPath\\$seuFileNameSpecificRes", "$size-1"); - open(OUTPUTFILE, ">$inDistPath\\$seuFileNameSpecificRC"); + $size = (-s "$inDistPath/$seuFileNameSpecificRes"); + truncate("$inDistPath/$seuFileNameSpecificRes", "$size-1"); + open(OUTPUTFILE, ">$inDistPath/$seuFileNameSpecificRC"); print OUTPUTFILE "#include \n"; print OUTPUTFILE "STRINGTABLE DISCARDABLE\n"; print OUTPUTFILE "BEGIN\n"; @@ -587,15 +574,15 @@ sub MakeUninstall $currentResourceID++; } close(OUTPUTFILE); - system("rc -r $inDistPath\\$seuFileNameSpecificRC $inDistPath\\temp.res"); - system("cat $inDistPath\\$seuFileNameSpecificRes $inDistPath\\temp.res > $inDistPath\\new.res"); - unlink("$inDistPath\\$seuFileNameSpecificRes"); - rename("$inDistPath\\new.res", "$inDistPath\\$seuFileNameSpecificRes"); - unlink("$inDistPath\\temp.res"); - system("rc $inDistPath\\$seuFileNameSpecificRes $inDistPath\\$seuFileNameSpecific"); + system("rc -r $inDistPath/$seuFileNameSpecificRC $inDistPath/temp.res"); + system("cat $inDistPath/$seuFileNameSpecificRes $inDistPath/temp.res > $inDistPath/new.res"); + unlink("$inDistPath/$seuFileNameSpecificRes"); + rename("$inDistPath/new.res", "$inDistPath/$seuFileNameSpecificRes"); + unlink("$inDistPath/temp.res"); + system("rc $inDistPath/$seuFileNameSpecificRes $inDistPath/$seuFileNameSpecific"); MakeExeZip($inDistPath, $seuFileNameSpecific, $seuzFileNameSpecific); - unlink <$inDistPath\\$seuFileNameSpecific>; + unlink <$inDistPath/$seuFileNameSpecific>; return(0); } @@ -615,9 +602,9 @@ sub MakeJsFile my($mComponent) = @_; # Make .js file - if(system("perl makejs.pl $mComponent.jst $inDefaultVersion $gLocalTmpStage\\$mComponent")) + if(system("perl makejs.pl $mComponent.jst $inDefaultVersion $gLocalTmpStage/$mComponent")) { - print "\n Error: perl makejs.pl $mComponent.jst $inDefaultVersion $gLocalTmpStage\\$mComponent\n"; + print "\n Error: perl makejs.pl $mComponent.jst $inDefaultVersion $gLocalTmpStage/$mComponent\n"; return(1); } return(0); @@ -636,9 +623,9 @@ sub MakeXpiFile } # Make .xpi file - if(system("perl makexpi.pl $mComponent $gLocalTmpStage $inDistPath\\xpi")) + if(system("perl makexpi.pl $mComponent $gLocalTmpStage $inDistPath/xpi")) { - print "\n Error: perl makexpi.pl $mComponent $gLocalTmpStage $inDistPath\\xpi\n"; + print "\n Error: perl makexpi.pl $mComponent $gLocalTmpStage $inDistPath/xpi\n"; return(1); } } @@ -675,9 +662,9 @@ sub CreateTmpStage() foreach $mComponent (@gComponentList) { print "\n Copying $mComponent:\n"; - print " From: $inStagePath\\$mComponent\n"; - print " To: $gLocalTmpStage\\$mComponent\n\n"; - mkdir("$gLocalTmpStage\\$mComponent", 775); + print " From: $inStagePath/$mComponent\n"; + print " To: $gLocalTmpStage/$mComponent\n\n"; + mkdir("$gLocalTmpStage/$mComponent", 775); # If it's not talkback then copy the component over to the local tmp stage. # If it is, then skip the copy because there will be nothing at the source. @@ -686,23 +673,23 @@ sub CreateTmpStage() # build to mozilla.org. if(!($mComponent =~ /talkback/i)) { - if(system("xcopy /s/e $inStagePath\\$mComponent $gLocalTmpStage\\$mComponent\\")) + if(system("xcopy /s/e $inStagePath/$mComponent $gLocalTmpStage/$mComponent/")) { - print "\n Error: xcopy /s/e $inStagePath\\$mComponent $gLocalTmpStage\\$mComponent\\\n"; + print "\n Error: xcopy /s/e $inStagePath/$mComponent $gLocalTmpStage/$mComponent/\n"; return(1); } } - if(-d "$gLocalTmpStage\\$mComponent\\bin\\chrome") + if(-d "$gLocalTmpStage/$mComponent/bin/chrome") { # Make chrome archive files - if(&ZipChrome("win32", "noupdate", "$gLocalTmpStage\\$mComponent\\bin\\chrome", "$gLocalTmpStage\\$mComponent\\bin\\chrome")) + if(&ZipChrome("win32", "noupdate", "$gLocalTmpStage/$mComponent/bin/chrome", "$gLocalTmpStage/$mComponent/bin/chrome")) { return(1); } # Remove the locales, packages, and skins dirs if they exist. - my @dirs = <$gLocalTmpStage\\$mComponent\\bin\\chrome\\*>; + my @dirs = <$gLocalTmpStage/$mComponent/bin/chrome/*>; foreach $d (@dirs) { if(-d "$d") { @@ -724,16 +711,16 @@ sub VerifyComponents() { if($mComponent =~ /talkback/i) { - print " place holder: $inStagePath\\$mComponent\n"; - mkdir("$inStagePath\\$mComponent", 775); + print " place holder: $inStagePath/$mComponent\n"; + mkdir("$inStagePath/$mComponent", 775); } - elsif(-d "$inStagePath\\$mComponent") + elsif(-d "$inStagePath/$mComponent") { - print " ok: $inStagePath\\$mComponent\n"; + print " ok: $inStagePath/$mComponent\n"; } else { - print " Error: $inStagePath\\$mComponent does not exist!\n"; + print " Error: $inStagePath/$mComponent does not exist!\n"; $mError = 1; } } diff --git a/xpinstall/packager/os2/rdir.pl b/xpinstall/packager/os2/rdir.pl new file mode 100644 index 000000000000..1bfbee8a3673 --- /dev/null +++ b/xpinstall/packager/os2/rdir.pl @@ -0,0 +1,113 @@ +#!c:\perl\bin\perl +# +# The contents of this file are subject to the Netscape Public +# License Version 1.1 (the "License"); you may not use this file +# except in compliance with the License. You may obtain a copy of +# the License at http://www.mozilla.org/NPL/ +# +# Software distributed under the License is distributed on an "AS +# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or +# implied. See the License for the specific language governing +# rights and limitations under the License. +# +# The Original Code is Mozilla Communicator client code, released +# March 31, 1998. +# +# The Initial Developer of the Original Code is Netscape +# Communications Corporation. Portions created by Netscape are +# Copyright (C) 1998-1999 Netscape Communications Corporation. All +# Rights Reserved. +# +# Contributor(s): +# Sean Su +# + +use Cwd; + +if($#ARGV < 0) +{ + print_usage(); + exit(1); +} + +print "removing directory:\n"; +for($i = 0; $i <= $#ARGV; $i++) +{ + print " $ARGV[$i]"; + remove_dir_structure($ARGV[$i]); + print "\n"; +} + +exit(0); +# end + +sub remove_dir_structure +{ + my($curr_dir) = @_; + $save_cwd = cwd(); + $save_cwd =~ s/\//\\/g; + if((-e "$curr_dir") && (-d "$curr_dir")) + { + remove_all_dir($curr_dir); + chdir($save_cwd); + remove_directory($curr_dir); + print " done!"; + } + else + { + if(!(-e "$curr_dir")) + { + print "\n"; + print "$curr_dir does not exist!"; + } + elsif(!(-d "$curr_dir")) + { + print "\n"; + print "$curr_dir is not a valid directory!"; + } + } +} + +sub remove_all_dir +{ + my($curr_dir) = @_; + my(@dirlist); + my($dir); + + chdir("$curr_dir"); + @dirlist = <*>; + foreach $dir (@dirlist) + { + if(-d "$dir") + { + print "."; + remove_all_dir($dir); + } + } + chdir(".."); + remove_directory($curr_dir); +} + +sub remove_directory +{ + my($directory) = @_; + my($save_cwd); + + $save_cwd = cwd(); + $save_cwd =~ s/\//\\/g; + + if(-e "$directory") + { + chdir($directory); +# @files = <*>; + chmod 0777, <*>; + unlink <*>; # remove files + chdir($save_cwd); + rmdir $directory; # remove directory + } +} + +sub print_usage +{ + print "usage: $0 [dir2 dir3...]\n"; +} diff --git a/xpinstall/packager/os2/strip.cmd b/xpinstall/packager/os2/strip.cmd new file mode 100755 index 000000000000..caee0d4bc2e6 --- /dev/null +++ b/xpinstall/packager/os2/strip.cmd @@ -0,0 +1,3 @@ +chmod 777 %1 +dllrname %1 cpprmi36=mozrmi36 +REM lxlite %1