[haiku-commits] r35711 - haiku/trunk/data/bin

  • From: mattmadia@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 1 Mar 2010 23:13:12 +0100 (CET)

Author: mmadia
Date: 2010-03-01 23:13:12 +0100 (Mon, 01 Mar 2010)
New Revision: 35711
Changeset: http://dev.haiku-os.org/changeset/35711/haiku

Modified:
   haiku/trunk/data/bin/installoptionalpackage
Log:
Added support for *.tgz,*.tar.gz. It is now consistent with 
InstallOptionalHaikuImagePackage's functionality.


Modified: haiku/trunk/data/bin/installoptionalpackage
===================================================================
--- haiku/trunk/data/bin/installoptionalpackage 2010-03-01 21:58:27 UTC (rev 
35710)
+++ haiku/trunk/data/bin/installoptionalpackage 2010-03-01 22:13:12 UTC (rev 
35711)
@@ -121,8 +121,8 @@
        echo "Installing \$1 ..."
        cd \$tmpDir
        
-       zipFile=\`echo \$3 | sed -s "s/http.*\///"\`
-       if ! [ -f \$zipFile ] ; then
+       archiveFile=\`echo \$3 | sed -s "s/http.*\///"\`
+       if ! [ -f \$archiveFile ] ; then
                echo "Downloading \$3 ..."
                wget -nv \$3
        fi
@@ -142,14 +142,26 @@
                        fi
                fi
        done
-       echo "Unzipping \$zipFile ..."
-       unzipDir="\${dirTokens}"
-       unzip -q -o  -d "\$unzipDir" "\$zipFile"
+       echo "Extracting \$archiveFile ..."
+       extractDir="\${dirTokens}"
        
+       case "\$archiveFile" in
+               *.zip)
+                       unzip -q -o -d "\$extractDir" "\$archiveFile"
+                       ;;
+               *.tgz|*.tar.gz)
+                       tar -C "\$extractDir" -xf "\$archiveFile"
+                       ;;
+               *)
+                       echo "Unhandled archive extension in 
InstallOptionalHaikuImagePackage()"
+                       exit 1
+                       ;;
+       esac
+       
        if [ -f '/boot/.OptionalPackageDescription' ] ; then
                rm '/boot/.OptionalPackageDescription'
        fi
-       rm "\$zipFile"
+       rm "\$archiveFile"
 }
 
 


Other related posts:

  • » [haiku-commits] r35711 - haiku/trunk/data/bin - mattmadia