From 05bbc668af9660bdef195f7b3b2ab18d3cfc52ae Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Sat, 27 Feb 2010 17:48:12 +0000 Subject: [PATCH] From: Matt Madia * InstallOptionalHaikuImagePackage: Made the first argument an actual file name, i.e. the extension ".zip" is no longer appended by it. * Renamed rules UnzipArchiveTo{Container,HaikuImage} to ExtractArchiveTo{Container,HaikuImage} and generalized them to support tgz/tar.gz archives (implemented in build_haiku_{image,cd}). * Removed DownloadOptionalPackage. DownloadFile is used instead. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35634 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- build/jam/FileRules | 4 - build/jam/HaikuCD | 4 +- build/jam/HaikuImage | 12 +-- build/jam/ImageRules | 51 ++++++------ build/jam/OptionalBuildFeatures | 10 +-- build/jam/OptionalPackages | 134 +++++++++++++++---------------- build/jam/UserBuildConfig.ReadMe | 4 +- build/scripts/build_haiku_cd | 41 ++++++---- build/scripts/build_haiku_image | 43 ++++++---- 9 files changed, 161 insertions(+), 142 deletions(-) diff --git a/build/jam/FileRules b/build/jam/FileRules index 87cdd2a5eb..bd136b16b6 100644 --- a/build/jam/FileRules +++ b/build/jam/FileRules @@ -399,7 +399,3 @@ rule DownloadFile file : url return $(file) ; } -rule DownloadOptionalPackage package : url -{ - return [ DownloadFile $(package).zip : $(url) ] ; -} diff --git a/build/jam/HaikuCD b/build/jam/HaikuCD index 2858920aea..bdebeae2ad 100644 --- a/build/jam/HaikuCD +++ b/build/jam/HaikuCD @@ -50,7 +50,7 @@ rule _BuildHaikuCD haikuCD : bootFloppy $(HAIKU_IMAGE_EARLY_USER_SCRIPTS) $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) $(HAIKU_IMAGE_COPY_FILES_SCRIPT) - $(HAIKU_IMAGE_UNZIP_FILES_SCRIPT) + $(HAIKU_IMAGE_EXTRACT_FILES_SCRIPT) $(HAIKU_IMAGE_LATE_USER_SCRIPTS) ; @@ -59,7 +59,7 @@ rule _BuildHaikuCD haikuCD : bootFloppy $(HAIKU_CD_INIT_VARIABLES_SCRIPT) $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) $(HAIKU_IMAGE_COPY_FILES_SCRIPT) - $(HAIKU_IMAGE_UNZIP_FILES_SCRIPT) + $(HAIKU_IMAGE_EXTRACT_FILES_SCRIPT) ; } diff --git a/build/jam/HaikuImage b/build/jam/HaikuImage index 064812a195..48dad91a23 100644 --- a/build/jam/HaikuImage +++ b/build/jam/HaikuImage @@ -657,7 +657,7 @@ if $(HAIKU_ADD_ALTERNATIVE_GCC_LIBS) && $(HAIKU_ALTERNATIVE_GCC_OUTPUT_DIR) { : "haiku-alternative-gcc-archive" ; # install the alternative libs in the right directory - UnzipArchiveToHaikuImage : $(otherAlternativeSystemLibsZip) ; + ExtractArchiveToHaikuImage : $(otherAlternativeSystemLibsZip) ; } @@ -749,13 +749,13 @@ if $(optionalPackageDescriptions) { # create the other scripts HAIKU_IMAGE_MAKE_DIRS_SCRIPT = haiku.image-make-dirs ; HAIKU_IMAGE_COPY_FILES_SCRIPT = haiku.image-copy-files ; -HAIKU_IMAGE_UNZIP_FILES_SCRIPT = haiku.image-unzip-files ; +HAIKU_IMAGE_EXTRACT_FILES_SCRIPT = haiku.image-extract-files ; MakeLocate $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) $(HAIKU_IMAGE_COPY_FILES_SCRIPT) - $(HAIKU_IMAGE_UNZIP_FILES_SCRIPT) : $(HAIKU_OUTPUT_DIR) ; + $(HAIKU_IMAGE_EXTRACT_FILES_SCRIPT) : $(HAIKU_OUTPUT_DIR) ; CreateHaikuImageMakeDirectoriesScript $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) ; CreateHaikuImageCopyFilesScript $(HAIKU_IMAGE_COPY_FILES_SCRIPT) ; -CreateHaikuImageUnzipFilesScript $(HAIKU_IMAGE_UNZIP_FILES_SCRIPT) ; +CreateHaikuImageExtractFilesScript $(HAIKU_IMAGE_EXTRACT_FILES_SCRIPT) ; # Convenience wrapper rule around BuildHaikuImage. rule _BuildHaikuImage image : isImage : isVMwareImage @@ -771,7 +771,7 @@ rule _BuildHaikuImage image : isImage : isVMwareImage $(HAIKU_IMAGE_EARLY_USER_SCRIPTS) $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) $(HAIKU_IMAGE_COPY_FILES_SCRIPT) - $(HAIKU_IMAGE_UNZIP_FILES_SCRIPT) + $(HAIKU_IMAGE_EXTRACT_FILES_SCRIPT) $(HAIKU_IMAGE_LATE_USER_SCRIPTS) : $(isImage) : $(isVMwareImage) @@ -782,7 +782,7 @@ rule _BuildHaikuImage image : isImage : isVMwareImage $(HAIKU_IMAGE_INIT_VARIABLES_SCRIPT) $(HAIKU_IMAGE_MAKE_DIRS_SCRIPT) $(HAIKU_IMAGE_COPY_FILES_SCRIPT) - $(HAIKU_IMAGE_UNZIP_FILES_SCRIPT) + $(HAIKU_IMAGE_EXTRACT_FILES_SCRIPT) ; } diff --git a/build/jam/ImageRules b/build/jam/ImageRules index d129bf7088..8e61abf470 100644 --- a/build/jam/ImageRules +++ b/build/jam/ImageRules @@ -273,15 +273,15 @@ rule CopyDirectoryToContainer container : directoryTokens : sourceDirectory DIRECTORIES_TO_INSTALL on $(directory) += $(targetDir) ; } -rule UnzipArchiveToContainer container : directoryTokens : zipFile +rule ExtractArchiveToContainer container : directoryTokens : archiveFile { - # UnzipArchiveToContainer : : ] ; + # ExtractArchiveToContainer : : ] ; # local directory = [ AddDirectoryToContainer $(container) : $(directoryTokens) ] ; - ZIP_FILES_TO_INSTALL on $(directory) += $(zipFile) ; + ARCHIVE_FILES_TO_INSTALL on $(directory) += $(archiveFile) ; } rule AddDriversToContainer container : relativeDirectoryTokens : targets @@ -560,7 +560,7 @@ actions AddDirectoryToContainerCopyFilesScript } -rule CreateContainerUnzipFilesScript container : script +rule CreateContainerExtractFilesScript container : script { MakeLocate $(script) : $(HAIKU_OUTPUT_DIR) ; Always $(script) ; @@ -581,29 +581,30 @@ rule CreateContainerUnzipFilesScript container : script local dir ; for dir in [ on $(container) return $(HAIKU_INSTALL_DIRECTORIES) ] { - local zipFiles = [ on $(dir) return $(ZIP_FILES_TO_INSTALL) ] ; - local zipFile ; - for zipFile in $(zipFiles) { + local archiveFiles = [ on $(dir) return $(ARCHIVE_FILES_TO_INSTALL) ] ; + local archiveFile ; + for archiveFile in $(archiveFiles) { # use a unique dummy target for this file, on which we # can define the TARGET_DIR variable - local dummyTarget = $(script)-dummy-$(dir:G=)-$(zipFile) ; + local dummyTarget = $(script)-dummy-$(dir:G=)-$(archiveFile) ; NotFile $(dummyTarget) ; TARGET_DIR on $(dummyTarget) = $(dir:G=) ; - Depends $(dummyTarget) : $(initScript) $(zipFile) + Depends $(dummyTarget) : $(initScript) $(archiveFile) $(serializationDependency) ; Depends $(script) : $(dummyTarget) ; serializationDependency = $(dummyTarget) ; - AddUnzipFileToContainerUnzipFilesScript $(dummyTarget) - : $(initScript) $(zipFile) ; + AddExtractFileToContainerExtractFilesScript $(dummyTarget) + : $(initScript) $(archiveFile) ; } } } -actions AddUnzipFileToContainerUnzipFilesScript + +actions AddExtractFileToContainerExtractFilesScript { - echo unzipFile "\"$(2[2])\"" "\"$(TARGET_DIR)\"" >> $(2[1]) + echo extractFile "\"$(2[2])\"" "\"$(TARGET_DIR)\"" >> $(2[1]) } @@ -690,15 +691,15 @@ rule AddHeaderDirectoryToHaikuImage dirTokens : dirName : alwaysUpdate : $(dirName) : -x .svn : $(alwaysUpdate) ; } -rule UnzipArchiveToHaikuImage dirTokens : zipFile : alwaysUpdate +rule ExtractArchiveToHaikuImage dirTokens : archiveFile : alwaysUpdate { - # UnzipArchiveToHaikuImage : : ; + # ExtractArchiveToHaikuImage : : ; - # If the image shall only be updated, we unzip only, if explicitely + # If the image shall only be updated, we extract only, if explicitely # requested. if ! [ IsUpdateHaikuImageOnly ] || $(alwaysUpdate) { - UnzipArchiveToContainer $(HAIKU_IMAGE_CONTAINER_NAME) : $(dirTokens) - : $(zipFile) ; + ExtractArchiveToContainer $(HAIKU_IMAGE_CONTAINER_NAME) : $(dirTokens) + : $(archiveFile) ; } } @@ -771,17 +772,17 @@ rule InstallSourceArchive file : url rule InstallOptionalHaikuImagePackage package : url : dirTokens : isCDPackage { - # download zip file - local zipFile = [ DownloadOptionalPackage $(package) : $(url) ] ; + # download archive file + local archiveFile = [ DownloadFile $(package) : $(url) ] ; if ( $(isCDPackage) = true || $(isCDPackage) = 1 ) && $(HAIKU_CD_NAME) { # TODO: If HAIKU_CD_NAME is set, that doesn't mean we're building a CD # image! # copy onto image - AddFilesToHaikuImage _packages_ : $(zipFile) ; + AddFilesToHaikuImage _packages_ : $(archiveFile) ; } else { - # unzip onto image - UnzipArchiveToHaikuImage $(dirTokens) : $(zipFile) ; + # extract onto image + ExtractArchiveToHaikuImage $(dirTokens) : $(archiveFile) ; } } @@ -866,9 +867,9 @@ rule CreateHaikuImageCopyFilesScript script CreateContainerCopyFilesScript $(HAIKU_IMAGE_CONTAINER_NAME) : $(script) ; } -rule CreateHaikuImageUnzipFilesScript script +rule CreateHaikuImageExtractFilesScript script { - CreateContainerUnzipFilesScript $(HAIKU_IMAGE_CONTAINER_NAME) : $(script) ; + CreateContainerExtractFilesScript $(HAIKU_IMAGE_CONTAINER_NAME) : $(script) ; } rule BuildHaikuImage haikuImage : scripts : isImage : isVMwareImage diff --git a/build/jam/OptionalBuildFeatures b/build/jam/OptionalBuildFeatures index 3131dfab7e..3e498edc40 100644 --- a/build/jam/OptionalBuildFeatures +++ b/build/jam/OptionalBuildFeatures @@ -12,23 +12,23 @@ if [ IsOptionalHaikuImagePackageAdded OpenSSL ] { } local baseURL = http://haiku-files.org/files/optional-packages ; -HAIKU_OPENSSL_PACKAGE = openssl-0.9.8l-x86-gcc2-2009-11-08 ; -HAIKU_OPENSSL_URL = $(baseURL)/$(HAIKU_OPENSSL_PACKAGE).zip ; +HAIKU_OPENSSL_PACKAGE = openssl-0.9.8l-x86-gcc2-2009-11-08.zip ; +HAIKU_OPENSSL_URL = $(baseURL)/$(HAIKU_OPENSSL_PACKAGE) ; if $(HAIKU_BUILD_FEATURE_SSL) { if $(TARGET_ARCH) != x86 { Echo "SSL build feature not available for $(TARGET_ARCH)" ; } else { # Download the zip archive. - local zipFile = [ DownloadOptionalPackage $(HAIKU_OPENSSL_PACKAGE) + local zipFile = [ DownloadFile $(HAIKU_OPENSSL_PACKAGE) : $(HAIKU_OPENSSL_URL) ] ; # zip file and output directory HAIKU_OPENSSL_ZIP_FILE = $(zipFile) ; HAIKU_OPENSSL_DIR = [ FDirName $(HAIKU_OPTIONAL_BUILD_PACKAGES_DIR) - $(HAIKU_OPENSSL_PACKAGE) ] ; + $(HAIKU_OPENSSL_PACKAGE:B) ] ; - # unzip headers and libraries + # extract headers and libraries HAIKU_OPENSSL_HEADERS_DEPENDENCY = [ ExtractArchive $(HAIKU_OPENSSL_DIR) : common/include/ : $(zipFile) ] ; diff --git a/build/jam/OptionalPackages b/build/jam/OptionalPackages index 2ca1cf7ece..d3a1a4b3ba 100644 --- a/build/jam/OptionalPackages +++ b/build/jam/OptionalPackages @@ -77,7 +77,7 @@ if [ IsOptionalHaikuImagePackageAdded ABI-compliance-checker ] { Echo "No optional package ABI-compliance-checker for gcc2" ; } else { InstallOptionalHaikuImagePackage - ABI-compliance-checker-1.12-noarch-gcc4-2010-02-01 + ABI-compliance-checker-1.12-noarch-gcc4-2010-02-01.zip : $(baseURL)/ABI-compliance-checker-1.12-noarch-gcc4-2010-02-01.zip ; } @@ -89,7 +89,7 @@ if [ IsOptionalHaikuImagePackageAdded APR ] { if $(TARGET_ARCH) != x86 { Echo "No optional package APR available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage apr-1.3.9-x86-gcc2-2009-10-18 + InstallOptionalHaikuImagePackage apr-1.3.9-x86-gcc2-2009-10-18.zip : $(baseURL)/apr-1.3.9-x86-gcc2-2009-10-18.zip : : true @@ -103,7 +103,7 @@ if [ IsOptionalHaikuImagePackageAdded APR-util ] { if $(TARGET_ARCH) != x86 { Echo "No optional package APR-util available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage apr-util-1.3.9-r1a1-x86-gcc2-2009-08-29 + InstallOptionalHaikuImagePackage apr-util-1.3.9-r1a1-x86-gcc2-2009-08-29.zip : $(baseURL)/apr-util-1.3.9-r1a1-x86-gcc2-2009-08-29.zip : : true @@ -118,7 +118,7 @@ if [ IsOptionalHaikuImagePackageAdded BasicCommandLineTools ] { Echo "No optional package BasicCommandLineTools available for $(TARGET_ARCH)" ; } else { # sed - InstallOptionalHaikuImagePackage sed-4.2.1-r1a1-x86-gcc2-2009-08-30 + InstallOptionalHaikuImagePackage sed-4.2.1-r1a1-x86-gcc2-2009-08-30.zip : $(baseURL)/sed-4.2.1-r1a1-x86-gcc2-2009-08-30.zip : : true ; @@ -133,7 +133,7 @@ if [ IsOptionalHaikuImagePackageAdded Beam ] { } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { Echo "No optional package Beam available for gcc4" ; } else { - InstallOptionalHaikuImagePackage Beam-1.2alpha + InstallOptionalHaikuImagePackage Beam-1.2alpha.zip : $(baseURL)/Beam-1.2alpha-x86-gcc2-2009-09-29.zip : apps ; @@ -145,7 +145,7 @@ if [ IsOptionalHaikuImagePackageAdded Beam ] { # BeBook if [ IsOptionalHaikuImagePackageAdded BeBook ] { - InstallOptionalHaikuImagePackage bebook_20081026 + InstallOptionalHaikuImagePackage bebook_20081026.zip : $(baseURL)/bebook_20081026.zip : system documentation ; @@ -161,7 +161,7 @@ if [ IsOptionalHaikuImagePackageAdded BeHappy ] { } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { Echo "No optional package BeHappy available for gcc4" ; } else { - InstallOptionalHaikuImagePackage BeHappy-1.0.6-x86-gcc2-2008-10-16 + InstallOptionalHaikuImagePackage BeHappy-1.0.6-x86-gcc2-2008-10-16.zip : $(baseURL)/BeHappy-1.0.6-x86-gcc2-2008-10-16.zip : ; @@ -199,7 +199,7 @@ if [ IsOptionalHaikuImagePackageAdded BePDF ] { } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { Echo "No optional package BePDF available for gcc4" ; } else { - InstallOptionalHaikuImagePackage BePDF-1.1.1b2-r1a1-x86-gcc2-2009-09-03 + InstallOptionalHaikuImagePackage BePDF-1.1.1b2-r1a1-x86-gcc2-2009-09-03.zip : $(baseURL)/BePDF-1.1.1b2-r1a1-x86-gcc2-2009-09-03.zip : apps ; @@ -216,7 +216,7 @@ if [ IsOptionalHaikuImagePackageAdded BeZillaBrowser ] { Echo "No optional package BeZillaBrowser available for $(TARGET_ARCH)" ; } else if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage - BeZillaBrowser-2.0.0.22pre-x86-gcc4-2010-01-27 + BeZillaBrowser-2.0.0.22pre-x86-gcc4-2010-01-27.zip : $(baseURL)/BeZillaBrowser-2.0.0.22pre-x86-gcc4-2010-01-27.zip : ; @@ -224,7 +224,7 @@ if [ IsOptionalHaikuImagePackageAdded BeZillaBrowser ] { : /boot/apps/BeZillaBrowser/BeZillaBrowser ; } else { InstallOptionalHaikuImagePackage - BeZillaBrowser-2.0.0.22pre-x86-gcc2-2010-01-27 + BeZillaBrowser-2.0.0.22pre-x86-gcc2-2010-01-27.zip : $(baseURL)/BeZillaBrowser-2.0.0.22pre-x86-gcc2-2010-01-27.zip : ; @@ -261,7 +261,7 @@ if [ IsOptionalHaikuImagePackageAdded Bzip ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Bzip available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage bzip2-1.0.5-x86-gcc2-2009-12-27 + InstallOptionalHaikuImagePackage bzip2-1.0.5-x86-gcc2-2009-12-27.zip : $(baseURL)/bzip2-1.0.5-x86-gcc2-2009-12-27.zip : : true @@ -275,7 +275,7 @@ if [ IsOptionalHaikuImagePackageAdded CDRecord ] { if $(TARGET_ARCH) != x86 { Echo "No optional package CDRecord available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage cdrecord-2.01.01a63-r1a1-x86-gcc2-2009-08-28 + InstallOptionalHaikuImagePackage cdrecord-2.01.01a63-r1a1-x86-gcc2-2009-08-28.zip : $(baseURL)/cdrecord-2.01.01a63-r1a1-x86-gcc2-2009-08-28.zip : ; @@ -288,14 +288,14 @@ if [ IsOptionalHaikuImagePackageAdded Clockwerk ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Clockwerk available for $(TARGET_ARCH)" ; } else if $(HAIKU_GCC_VERSION[1]) >= 4 { - InstallOptionalHaikuImagePackage Clockwerk-0.0.1-x86-gcc4-2009-08-06 + InstallOptionalHaikuImagePackage Clockwerk-0.0.1-x86-gcc4-2009-08-06.zip : $(baseURL)/Clockwerk-0.0.1-x86-gcc4-2009-08-06.zip : ; AddSymlinkToHaikuImage home config be Applications : /boot/apps/Clockwerk/Clockwerk ; } else { - InstallOptionalHaikuImagePackage Clockwerk-0.0.1-x86-gcc2-2009-08-06 + InstallOptionalHaikuImagePackage Clockwerk-0.0.1-x86-gcc2-2009-08-06.zip : $(baseURL)/Clockwerk-0.0.1-x86-gcc2-2009-08-06.zip : ; @@ -313,7 +313,7 @@ if [ IsOptionalHaikuImagePackageAdded CLucene ] { Echo "No optional package CLucene available for GCC2" ; } else { InstallOptionalHaikuImagePackage - clucene-0.9.21svn-x86-gcc4-haiku-2009-08-11 + clucene-0.9.21svn-x86-gcc4-haiku-2009-08-11.zip : $(baseURL)/clucene-0.9.21-x86-gcc4-haiku-2009-08-11.zip : : true @@ -327,7 +327,7 @@ if [ IsOptionalHaikuImagePackageAdded CMake ] { if $(TARGET_ARCH) != x86 { Echo "No optional package CMake available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage cmake-2.8.0-x86-gcc2-2009-11-15 + InstallOptionalHaikuImagePackage cmake-2.8.0-x86-gcc2-2009-11-15.zip : $(baseURL)/cmake-2.8.0-x86-gcc2-2009-11-15.zip : : true @@ -341,7 +341,7 @@ if [ IsOptionalHaikuImagePackageAdded Curl ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Curl available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage curl-7.19.6-r1a1-x86-gcc2-2009-08-30 + InstallOptionalHaikuImagePackage curl-7.19.6-r1a1-x86-gcc2-2009-08-30.zip : $(baseURL)/curl-7.19.6-r1a1-x86-gcc2-2009-08-30.zip : : true @@ -355,7 +355,7 @@ if [ IsOptionalHaikuImagePackageAdded CVS ] { if $(TARGET_ARCH) != x86 { Echo "No optional package CVS available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage cvs-1.12.13-r1a1-x86-gcc2-2009-08-30 + InstallOptionalHaikuImagePackage cvs-1.12.13-r1a1-x86-gcc2-2009-08-30.zip : $(baseURL)/cvs-1.12.13-r1a1-x86-gcc2-2009-08-30.zip : : true @@ -367,19 +367,19 @@ if [ IsOptionalHaikuImagePackageAdded CVS ] { # Development if [ IsOptionalHaikuImagePackageAdded Development ] && $(TARGET_ARCH) = x86 { # autotools - InstallOptionalHaikuImagePackage autoconf-2.65-x86-gcc2-2009-11-28 + InstallOptionalHaikuImagePackage autoconf-2.65-x86-gcc2-2009-11-28.zip : $(baseURL)/autoconf-2.65-x86-gcc2-2009-11-28.zip : : true ; - InstallOptionalHaikuImagePackage automake-1.11.1-x86-gcc2-2009-12-23 + InstallOptionalHaikuImagePackage automake-1.11.1-x86-gcc2-2009-12-23.zip : $(baseURL)/automake-1.11.1-x86-gcc2-2009-12-23.zip : : true ; - InstallOptionalHaikuImagePackage libtool-2.2.6b-x86-gcc2-2009-11-18 + InstallOptionalHaikuImagePackage libtool-2.2.6b-x86-gcc2-2009-11-18.zip : $(baseURL)/libtool-2.2.6b-x86-gcc2-2009-11-18.zip : : true ; - InstallOptionalHaikuImagePackage texinfo-4.13a-r1a1-x86-gcc2-2009-08-30 + InstallOptionalHaikuImagePackage texinfo-4.13a-r1a1-x86-gcc2-2009-08-30.zip : $(baseURL)/texinfo-4.13a-r1a1-x86-gcc2-2009-08-30.zip : : true ; @@ -391,12 +391,12 @@ if [ IsOptionalHaikuImagePackageAdded DevelopmentBase ] && $(TARGET_ARCH) = x86 { # gcc and binutils if $(HAIKU_GCC_VERSION[1]) = 2 || $(isHybridBuild) { - InstallOptionalHaikuImagePackage gcc-2.95.3-r1a1-x86-gcc2-2009-08-26 + InstallOptionalHaikuImagePackage gcc-2.95.3-r1a1-x86-gcc2-2009-08-26.zip : $(baseURL)/gcc-2.95.3-r1a1-x86-gcc2-2009-08-26.zip ; } if $(HAIKU_GCC_VERSION[1]) = 4 || $(isHybridBuild) { - InstallOptionalHaikuImagePackage gcc-4.3.3-r1a1-x86-gcc4-2009-06-29 + InstallOptionalHaikuImagePackage gcc-4.3.3-r1a1-x86-gcc4-2009-06-29.zip : $(baseURL)/gcc-4.3.3-r1a1-x86-gcc4-2009-06-29.zip ; # symlink cpp to g++'s headers @@ -405,13 +405,13 @@ if [ IsOptionalHaikuImagePackageAdded DevelopmentBase ] } # other commonly used tools - InstallOptionalHaikuImagePackage bison-2.4.1-r1a1-x86-gcc2-2009-08-31 + InstallOptionalHaikuImagePackage bison-2.4.1-r1a1-x86-gcc2-2009-08-31.zip : $(baseURL)/bison-2.4.1-r1a1-x86-gcc2-2009-08-31.zip ; - InstallOptionalHaikuImagePackage m4-1.4.13-r1a1-x86-gcc2-2009-08-28 + InstallOptionalHaikuImagePackage m4-1.4.13-r1a1-x86-gcc2-2009-08-28.zip : $(baseURL)/m4-1.4.13-r1a1-x86-gcc2-2009-08-28.zip ; - InstallOptionalHaikuImagePackage flex-2.5.35-r1a1-x86-gcc2-2009-08-31 + InstallOptionalHaikuImagePackage flex-2.5.35-r1a1-x86-gcc2-2009-08-31.zip : $(baseURL)/flex-2.5.35-r1a1-x86-gcc2-2009-08-31.zip ; - InstallOptionalHaikuImagePackage jam-2.5-r1a1-x86-gcc2-2009-08-31 + InstallOptionalHaikuImagePackage jam-2.5-r1a1-x86-gcc2-2009-08-31.zip : $(baseURL)/jam-2.5-r1a1-x86-gcc2-2009-08-31.zip ; } @@ -534,7 +534,7 @@ if [ IsOptionalHaikuImagePackageAdded Expat ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Expat available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage expat-2.0.1-r1a1-x86-gcc2-2009-08-30 + InstallOptionalHaikuImagePackage expat-2.0.1-r1a1-x86-gcc2-2009-08-30.zip : $(baseURL)/expat-2.0.1-r1a1-x86-gcc2-2009-08-30.zip : : true @@ -555,7 +555,7 @@ if [ IsOptionalHaikuImagePackageAdded Git ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Git available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage git-1.6.4.2-r1a1-x86-gcc2-2009-08-30 + InstallOptionalHaikuImagePackage git-1.6.4.2-r1a1-x86-gcc2-2009-08-30.zip : $(baseURL)/git-1.6.4.2-r1a1-x86-gcc2-2009-08-30.zip : : true @@ -566,7 +566,7 @@ if [ IsOptionalHaikuImagePackageAdded Git ] { # ICU-devel if [ IsOptionalHaikuImagePackageAdded ICU-devel ] { - InstallOptionalHaikuImagePackage icu-devel-4.2-2010-01-26 + InstallOptionalHaikuImagePackage icu-devel-4.2-2010-01-26.zip : $(baseURL)/icu-devel-4.2-2010-01-26.zip ; } @@ -578,7 +578,7 @@ if [ IsOptionalHaikuImagePackageAdded KeymapSwitcher ] { Echo "No optional package KeymapSwitcher available for $(TARGET_ARCH)" ; } else if $(HAIKU_GCC_VERSION[1]) >= 4 { InstallOptionalHaikuImagePackage - KeymapSwitcher-1.2.3-x86-gcc4-2009-05-31 + KeymapSwitcher-1.2.3-x86-gcc4-2009-05-31.zip : $(baseURL)/KeymapSwitcher-1.2.3-x86-gcc4-2009-05-31.zip : ; @@ -586,7 +586,7 @@ if [ IsOptionalHaikuImagePackageAdded KeymapSwitcher ] { : /boot/common/bin/KeymapSwitcher ; } else { InstallOptionalHaikuImagePackage - KeymapSwitcher-1.2.4-r1a1-x86-gcc2-2009-09-06 + KeymapSwitcher-1.2.4-r1a1-x86-gcc2-2009-09-06.zip : $(baseURL)/KeymapSwitcher-1.2.4-r1a1-x86-gcc2-2009-09-06.zip : ; @@ -601,7 +601,7 @@ if [ IsOptionalHaikuImagePackageAdded LibIconv ] { if $(TARGET_ARCH) != x86 { Echo "No optional package LibIconv available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage libiconv-1.13.1-r1a1-x86-gcc2-2009-09-08 + InstallOptionalHaikuImagePackage libiconv-1.13.1-r1a1-x86-gcc2-2009-09-08.zip : $(baseURL)/libiconv-1.13.1-r1a1-x86-gcc2-2009-09-08.zip : ; @@ -616,7 +616,7 @@ if [ IsOptionalHaikuImagePackageAdded LibLayout ] { } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { Echo "No optional package LibLayout available for gcc4" ; } else { - InstallOptionalHaikuImagePackage liblayout-1.4.0-gcc2-2009-03-08 + InstallOptionalHaikuImagePackage liblayout-1.4.0-gcc2-2009-03-08.zip : $(baseURL)/liblayout-1.4.0-gcc2-2009-03-08.zip : ; @@ -629,7 +629,7 @@ if [ IsOptionalHaikuImagePackageAdded LibXML2 ] { if $(TARGET_ARCH) != x86 { Echo "No optional package LibXML2 available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage libxml2-2.7.6-x86-gcc2-2009-10-19 + InstallOptionalHaikuImagePackage libxml2-2.7.6-x86-gcc2-2009-10-19.zip : $(baseURL)/libxml2-2.7.6-x86-gcc2-2009-10-19.zip : : true @@ -645,7 +645,7 @@ if [ IsOptionalHaikuImagePackageAdded Links ] { } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { Echo "No optional package Links available for gcc4" ; } else { - InstallOptionalHaikuImagePackage Links + InstallOptionalHaikuImagePackage Links.zip : $(baseURL)/links-x86-gcc2-2008-05-03.zip : ; @@ -660,7 +660,7 @@ if [ IsOptionalHaikuImagePackageAdded Mercurial ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Mercurial available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage mercurial-1.3.1-r1a1-x86-gcc2-2009-08-30 + InstallOptionalHaikuImagePackage mercurial-1.3.1-r1a1-x86-gcc2-2009-08-30.zip : $(baseURL)/mercurial-1.3.1-r1a1-x86-gcc2-2009-08-30.zip : : true @@ -674,7 +674,7 @@ if [ IsOptionalHaikuImagePackageAdded Nano ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Nano available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage nano-2.0.9-r1a1-x86-gcc2-2009-08-30 + InstallOptionalHaikuImagePackage nano-2.0.9-r1a1-x86-gcc2-2009-08-30.zip : $(baseURL)/nano-2.0.9-r1a1-x86-gcc2-2009-08-30.zip : ; @@ -687,7 +687,7 @@ if [ IsOptionalHaikuImagePackageAdded Neon ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Neon available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage neon-0.29.1-x86-gcc2-2009-12-26 + InstallOptionalHaikuImagePackage neon-0.29.1-x86-gcc2-2009-12-26.zip : $(baseURL)/neon-0.29.1-x86-gcc2-2009-12-26.zip : : true @@ -732,7 +732,7 @@ if [ IsOptionalHaikuImagePackageAdded NetSurf ] { } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { Echo "No optional package NetSurf available for gcc4" ; } else { - InstallOptionalHaikuImagePackage NetSurf-r9862b + InstallOptionalHaikuImagePackage NetSurf-r9862b.zip : $(baseURL)/NetSurf-r9862-x86-gcc2-2010-01-27.zip : ; @@ -749,11 +749,11 @@ if [ IsOptionalHaikuImagePackageAdded OCaml ] { } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { Echo "No optional package OCaml available for gcc4" ; } else { - InstallOptionalHaikuImagePackage ocaml-3.11.1-r1a1-x86-gcc2-2009-09-06 + InstallOptionalHaikuImagePackage ocaml-3.11.1-r1a1-x86-gcc2-2009-09-06.zip : http://jerome.duval.free.fr/obos/ocaml-3.11.1-r1a1-x86-gcc2-2009-09-06.zip : ; - InstallOptionalHaikuImagePackage camlp5-5.12-r1a1-x86-gcc2-2009-09-06 + InstallOptionalHaikuImagePackage camlp5-5.12-r1a1-x86-gcc2-2009-09-06.zip : http://jerome.duval.free.fr/obos/camlp5-5.12-r1a1-x86-gcc2-2009-09-06.zip : ; @@ -766,12 +766,12 @@ if [ IsOptionalHaikuImagePackageAdded OpenSound ] { if $(TARGET_ARCH) != x86 { Echo "No optional package OpenSound available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage OpenSound + InstallOptionalHaikuImagePackage OpenSound.zip : $(baseURL)/OpenSound-x86-gcc2-2008-06-21.zip : ; } - #UnzipArchiveToHaikuImage home : data/vv.mp3.zip : 0 ; + #ExtractArchiveToHaikuImage home : data/vv.mp3.zip : 0 ; } @@ -785,7 +785,7 @@ if [ IsOptionalHaikuImagePackageAdded OpenSSH ] { "variable to be set!" ; } - InstallOptionalHaikuImagePackage openssh-5.3p1-r1a1-x86-gcc2-2009-10-11 + InstallOptionalHaikuImagePackage openssh-5.3p1-r1a1-x86-gcc2-2009-10-11.zip : $(baseURL)/openssh-5.3p1-r1a1-x86-gcc2-2009-10-11.zip : ; @@ -815,12 +815,12 @@ if [ IsOptionalHaikuImagePackageAdded P7zip ] { Echo "No optional package P7zip available for $(TARGET_ARCH)" ; } else { if $(HAIKU_GCC_VERSION[1]) >= 4 { - InstallOptionalHaikuImagePackage p7zip-9.04-x86-gcc4-2009-10-25 + InstallOptionalHaikuImagePackage p7zip-9.04-x86-gcc4-2009-10-25.zip : $(baseURL)/p7zip-9.04-x86-gcc4-2009-10-25.zip : ; } else { - InstallOptionalHaikuImagePackage p7zip-9.04-x86-gcc2-2009-10-25 + InstallOptionalHaikuImagePackage p7zip-9.04-x86-gcc2-2009-10-25.zip : $(baseURL)/p7zip-9.04-x86-gcc2-2009-10-25.zip : ; @@ -845,11 +845,11 @@ if [ IsOptionalHaikuImagePackageAdded PCRE ] { Echo "No optional package PCRE available for $(TARGET_ARCH)" ; } else { if $(HAIKU_GCC_VERSION[1]) >= 4 { - InstallOptionalHaikuImagePackage pcre-7.9-x86-gcc4-2009-09-30 + InstallOptionalHaikuImagePackage pcre-7.9-x86-gcc4-2009-09-30.zip : $(baseURL)/pcre-7.9-x86-gcc4-2009-09-30.zip ; } else { - InstallOptionalHaikuImagePackage pcre-7.9-x86-gcc2-2009-09-30 + InstallOptionalHaikuImagePackage pcre-7.9-x86-gcc2-2009-09-30.zip : $(baseURL)/pcre-7.9-x86-gcc2-2009-09-30.zip ; } @@ -863,11 +863,11 @@ if [ IsOptionalHaikuImagePackageAdded Pe ] { Echo "No optional package Pe available for $(TARGET_ARCH)" ; } else { if $(HAIKU_GCC_VERSION[1]) >= 4 { - InstallOptionalHaikuImagePackage Pe-2.4.2-x86-gcc4-2009-08-04 + InstallOptionalHaikuImagePackage Pe-2.4.2-x86-gcc4-2009-08-04.zip : $(baseURL)/Pe-2.4.2-x86-gcc4-2009-08-04.zip ; } else { - InstallOptionalHaikuImagePackage Pe-2.4.2-r593-r1a1-x86-gcc2-2009-09-08 + InstallOptionalHaikuImagePackage Pe-2.4.2-r593-r1a1-x86-gcc2-2009-09-08.zip : $(baseURL)/Pe-2.4.2-r593-r1a1-x86-gcc2-2009-09-08.zip ; } @@ -885,7 +885,7 @@ if [ IsOptionalHaikuImagePackageAdded Perl ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Perl available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage perl-5.10.1-r1a1-x86-gcc2-2009-09-08 + InstallOptionalHaikuImagePackage perl-5.10.1-r1a1-x86-gcc2-2009-09-08.zip : $(baseURL)/perl-5.10.1-r1a1-x86-gcc2-2009-09-08.zip : : true @@ -899,7 +899,7 @@ if [ IsOptionalHaikuImagePackageAdded Python ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Python available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage python-2.6.4-x86-gcc2-2009-11-26 + InstallOptionalHaikuImagePackage python-2.6.4-x86-gcc2-2009-11-26.zip : $(baseURL)/python-2.6.4-x86-gcc2-2009-11-26.zip : : true @@ -913,7 +913,7 @@ if [ IsOptionalHaikuImagePackageAdded Rsync ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Rsync available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage rsync-3.0.7-x86-gcc2-2010-01-05 + InstallOptionalHaikuImagePackage rsync-3.0.7-x86-gcc2-2010-01-05.zip : $(baseURL)/rsync-3.0.7-x86-gcc2-2010-01-05.zip : ; @@ -926,7 +926,7 @@ if [ IsOptionalHaikuImagePackageAdded SQLite ] { if $(TARGET_ARCH) != x86 { Echo "No optional package SQLite available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage sqlite-3.6.17-r1a1-x86-gcc2-2009-08-30 + InstallOptionalHaikuImagePackage sqlite-3.6.17-r1a1-x86-gcc2-2009-08-30.zip : $(baseURL)/sqlite-3.6.17-r1a1-x86-gcc2-2009-08-30.zip : : true @@ -940,7 +940,7 @@ if [ IsOptionalHaikuImagePackageAdded Subversion ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Subversion available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage subversion-1.6.5-r1a1-x86-gcc2-2009-09-02 + InstallOptionalHaikuImagePackage subversion-1.6.5-r1a1-x86-gcc2-2009-09-02.zip : $(baseURL)/subversion-1.6.5-r1a1-x86-gcc2-2009-09-02.zip : : true @@ -954,7 +954,7 @@ if [ IsOptionalHaikuImagePackageAdded Tar ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Tar available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage tar-1.21-gcc2-2009-02-08 + InstallOptionalHaikuImagePackage tar-1.21-gcc2-2009-02-08.zip : $(baseURL)/tar-1.21-gcc2-2009-02-08.zip : ; @@ -1020,14 +1020,14 @@ if [ IsOptionalHaikuImagePackageAdded Vim ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Vim available for $(TARGET_ARCH)" ; } else if $(HAIKU_GCC_VERSION[1]) >= 4 { - InstallOptionalHaikuImagePackage vim-7.2-x86-gcc4-2009-05-31 + InstallOptionalHaikuImagePackage vim-7.2-x86-gcc4-2009-05-31.zip : $(baseURL)/vim-7.2-x86-gcc4-2009-05-31.zip : ; AddSymlinkToHaikuImage home config be Applications : /boot/common/bin/gvim ; } else { - InstallOptionalHaikuImagePackage vim-7.2-r1a1-x86-gcc2-2009-09-06 + InstallOptionalHaikuImagePackage vim-7.2-r1a1-x86-gcc2-2009-09-06.zip : $(baseURL)/vim-7.2-r1a1-x86-gcc2-2009-09-06.zip : ; @@ -1042,14 +1042,14 @@ if [ IsOptionalHaikuImagePackageAdded Vision ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Vision available for $(TARGET_ARCH)" ; } else if $(HAIKU_GCC_VERSION[1]) >= 4 { - InstallOptionalHaikuImagePackage Vision-0.9.7-H-090423-1 + InstallOptionalHaikuImagePackage Vision-0.9.7-H-090423-1.zip : $(baseURL)/Vision-0.9.7-H-x86-gcc4-2009-04-23.zip : apps ; AddSymlinkToHaikuImage home config be Applications : /boot/apps/Vision-0.9.7-H-090423/Vision ; } else { - InstallOptionalHaikuImagePackage Vision-0.9.7-H-090423 + InstallOptionalHaikuImagePackage Vision-0.9.7-H-090423.zip : $(baseURL)/Vision-0.9.7-H-x86-gcc2-2009-04-23.zip : apps ; @@ -1066,7 +1066,7 @@ if [ IsOptionalHaikuImagePackageAdded VLC ] { } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { Echo "No optional package VLC available for gcc4" ; } else { - InstallOptionalHaikuImagePackage VLC-0.8.6d + InstallOptionalHaikuImagePackage VLC-0.8.6d.zip : $(baseURL)/vlc-0.8.6d-gcc2-2009-04-18.zip : apps ; @@ -1105,7 +1105,7 @@ if [ IsOptionalHaikuImagePackageAdded Wifi-ipw2100+fw ] { Echo "No optional package Wifi-ipw2100+fw available for $(TARGET_ARCH)" ; } else { AddDriversToHaikuImage net : ipw2100 ; - InstallOptionalHaikuImagePackage ipw2100-firmware-installer-2009-12-26b + InstallOptionalHaikuImagePackage ipw2100-firmware-installer-2009-12-26b.zip : $(baseURL)/ipw2100-firmware-installer-2009-12-26b.zip : ; @@ -1121,7 +1121,7 @@ if [ IsOptionalHaikuImagePackageAdded Wifi-iprowifi2200+fw ] { Echo "No optional package Wifi-iprowifi2200+fw available for $(TARGET_ARCH)" ; } else { AddDriversToHaikuImage net : iprowifi2200 ; - InstallOptionalHaikuImagePackage iprowifi2200-firmware-installer-2009-12-26 + InstallOptionalHaikuImagePackage iprowifi2200-firmware-installer-2009-12-26.zip : $(baseURL)/iprowifi2200-firmware-installer-2009-12-26.zip : ; @@ -1138,7 +1138,7 @@ if [ IsOptionalHaikuImagePackageAdded WonderBrush ] { } else if $(HAIKU_GCC_VERSION[1]) >= 4 && ! $(isHybridBuild) { Echo "No optional package WonderBrush available for gcc4" ; } else { - InstallOptionalHaikuImagePackage WonderBrush-2.1.2 + InstallOptionalHaikuImagePackage WonderBrush-2.1.2.zip : $(baseURL)/WonderBrush-2.1.2-x86-gcc2-2008-11-08.zip : apps ; @@ -1153,7 +1153,7 @@ if [ IsOptionalHaikuImagePackageAdded Yasm ] { if $(TARGET_ARCH) != x86 { Echo "No optional package Yasm available for $(TARGET_ARCH)" ; } else { - InstallOptionalHaikuImagePackage yasm-0.8.0-r1a1-x86-gcc2-2009-08-30 + InstallOptionalHaikuImagePackage yasm-0.8.0-r1a1-x86-gcc2-2009-08-30.zip : $(baseURL)/yasm-0.8.0-r1a1-x86-gcc2-2009-08-30.zip : ; diff --git a/build/jam/UserBuildConfig.ReadMe b/build/jam/UserBuildConfig.ReadMe index faa473b06b..3511b17519 100644 --- a/build/jam/UserBuildConfig.ReadMe +++ b/build/jam/UserBuildConfig.ReadMe @@ -122,8 +122,8 @@ CopyDirectoryToHaikuImage home Desktop : $(HAIKU_TOP)/../buildtools/jam : "jam-src" : -x .svn -X \\*/jam/./bin.\\* ; -# Unzips the given zip archive onto the image under /boot/develop/tools. -UnzipArchiveToHaikuImage develop tools +# Extracts the given archive onto the image under /boot/develop/tools. +ExtractArchiveToHaikuImage develop tools : /home/bonefish/develop/haiku/misc/gcc-2.95.3-beos-070218/gcc-2.95.3_binutils-2.17_rel-070218.zip ; # Add the optional package WonderBrush to the image. The package is downloaded diff --git a/build/scripts/build_haiku_cd b/build/scripts/build_haiku_cd index 54d2b39b25..796b847448 100755 --- a/build/scripts/build_haiku_cd +++ b/build/scripts/build_haiku_cd @@ -35,29 +35,40 @@ mkdir=mkdir rm=rm -unzipFile() +extractFile() { - # unzipFile - zipFile=$1 - targetUnzipDir=$2 + # extractFile + archiveFile=$1 + targetExtractDir=$2 - echo "Unzipping $zipFile ..." + echo "Extracting $archiveFile ..." - unzipDir=$tmpDir/unzip - $rmAttrs -rf "$unzipDir" - mkdir -p "$unzipDir" + extractDir=$tmpDir/extract + $rmAttrs -rf "$extractDir" + mkdir -p "$extractDir" + + case "$archiveFile" in + *.zip) + $unzip -q -d "$extractDir" "$archiveFile" + ;; + *.tgz|*.tar.gz) + tar -C "$extractDir" -xf "$archiveFile" + ;; + *) + echo "Unhandled archive extension in build_haiku_image extractFile()" + exit 1 + ;; + esac - $unzip -q -d "$unzipDir" "$zipFile" - - if [ -f $unzipDir/.OptionalPackageDescription ]; then - cat $unzipDir/.OptionalPackageDescription >> $copyrightsFile + if [ -f $extractDir/.OptionalPackageDescription ]; then + cat $extractDir/.OptionalPackageDescription >> $copyrightsFile echo >> $copyrightsFile - rm $unzipDir/.OptionalPackageDescription + rm $extractDir/.OptionalPackageDescription fi - $cp -r "$unzipDir/." "${tPrefix}$targetUnzipDir" + $cp -r "$extractDir/." "${tPrefix}$targetExtractDir" - $rmAttrs -rf "$unzipDir" + $rmAttrs -rf "$extractDir" } diff --git a/build/scripts/build_haiku_image b/build/scripts/build_haiku_image index 1caa798199..7c327304fb 100755 --- a/build/scripts/build_haiku_image +++ b/build/scripts/build_haiku_image @@ -74,29 +74,40 @@ else fi -unzipFile() +extractFile() { - # unzipFile - zipFile=$1 - targetUnzipDir=$2 + # extractFile + archiveFile=$1 + targetExtractedDir=$2 - echo "Unzipping $zipFile ..." + echo "Extracting $archiveFile ..." - unzipDir=$tmpDir/unzip - $rmAttrs -rf "$unzipDir" - mkdir -p "$unzipDir" - - $unzip -q -d "$unzipDir" "$zipFile" - - if [ -f $unzipDir/.OptionalPackageDescription ]; then - cat $unzipDir/.OptionalPackageDescription >> $copyrightsFile + extractDir=$tmpDir/extract + $rmAttrs -rf "$extractDir" + mkdir -p "$extractDir" + + case "$archiveFile" in + *.zip) + $unzip -q -d "$extractDir" "$archiveFile" + ;; + *.tgz|*.tar.gz) + tar -C "$extractDir" -xf "$archiveFile" + ;; + *) + echo "Unhandled archive extension in build_haiku_image extractFile()" + exit 1 + ;; + esac + + if [ -f $extractDir/.OptionalPackageDescription ]; then + cat $extractDir/.OptionalPackageDescription >> $copyrightsFile echo >> $copyrightsFile - rm $unzipDir/.OptionalPackageDescription + rm $extractDir/.OptionalPackageDescription fi - $cp -r "${sPrefix}$unzipDir/." "${tPrefix}$targetUnzipDir" + $cp -r "${sPrefix}$extractDir/." "${tPrefix}$targetExtractedDir" - $rmAttrs -rf "$unzipDir" + $rmAttrs -rf "$extractDir" }