Added support for *.tgz,*.tar.gz. It is now consistent with

InstallOptionalHaikuImagePackage's functionality.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35711 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matt Madia
2010-03-01 22:13:12 +00:00
parent 91db81894a
commit e414b34299
+18 -6
View File
@@ -121,8 +121,8 @@ function InstallOptionalHaikuImagePackage()
echo "Installing \$1 ..." echo "Installing \$1 ..."
cd \$tmpDir cd \$tmpDir
zipFile=\`echo \$3 | sed -s "s/http.*\///"\` archiveFile=\`echo \$3 | sed -s "s/http.*\///"\`
if ! [ -f \$zipFile ] ; then if ! [ -f \$archiveFile ] ; then
echo "Downloading \$3 ..." echo "Downloading \$3 ..."
wget -nv \$3 wget -nv \$3
fi fi
@@ -142,14 +142,26 @@ function InstallOptionalHaikuImagePackage()
fi fi
fi fi
done done
echo "Unzipping \$zipFile ..." echo "Extracting \$archiveFile ..."
unzipDir="\${dirTokens}" extractDir="\${dirTokens}"
unzip -q -o -d "\$unzipDir" "\$zipFile"
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 if [ -f '/boot/.OptionalPackageDescription' ] ; then
rm '/boot/.OptionalPackageDescription' rm '/boot/.OptionalPackageDescription'
fi fi
rm "\$zipFile" rm "\$archiveFile"
} }