Author: jhuntwork
Date: 2005-06-14 21:37:06 -0600 (Tue, 14 Jun 2005)
New Revision: 226

Added:
   trunk/scripts/unpack
Log:
Added an unpack script - need to call it from each Makefile

Added: trunk/scripts/unpack
===================================================================
--- trunk/scripts/unpack        2005-06-11 08:47:47 UTC (rev 225)
+++ trunk/scripts/unpack        2005-06-15 03:37:06 UTC (rev 226)
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+TAR=`which tar`
+
+if [ -z $1 ] ; then
+       echo "Error: No file specified."
+       exit 1
+fi
+
+if [ ! -f $1 ] ; then
+       echo "Error: File \"$1\" not found."
+       exit 1
+fi
+
+if echo $1 | grep -q "tar.gz" || echo $1 | grep -q ".tgz" ; then
+       $TAR -xzvf $1 || echo "Error: Unpacking of \"$1\" failed."
+elif echo $1 | grep -q "tar.bz2" ; then
+       $TAR -xjvf $1 || echo "Error: Unpacking of \"$1\" failed."
+elif [ `expr "$1" : '.*\(...\)'` = "tar" ] ; then
+       $TAR -xvf $1 || echo "Error: Unpacking of \"$1\" failed."
+else
+       echo "Error: Bad format or unknown compression type"
+fi     


Property changes on: trunk/scripts/unpack
___________________________________________________________________
Name: svn:executable
   + *

-- 
http://linuxfromscratch.org/mailman/listinfo/livecd
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to