[jbossnative-commits] JBoss Native SVN: r1357 - trunk/build/unix/util.

jbossnative-commits at lists.jboss.org jbossnative-commits at lists.jboss.org
Tue Feb 5 03:32:08 EST 2008


Author: jfrederic.clere at jboss.com
Date: 2008-02-05 03:32:08 -0500 (Tue, 05 Feb 2008)
New Revision: 1357

Modified:
   trunk/build/unix/util/buildrhelsrc.sh
Log:
Add logic to support bzip2 files.


Modified: trunk/build/unix/util/buildrhelsrc.sh
===================================================================
--- trunk/build/unix/util/buildrhelsrc.sh	2008-02-05 08:26:06 UTC (rev 1356)
+++ trunk/build/unix/util/buildrhelsrc.sh	2008-02-05 08:32:08 UTC (rev 1357)
@@ -101,8 +101,24 @@
   fi
   mv $fname ${build_cache_dir}
 fi
-gunzip -c ${build_cache_dir}/${fname} | tar -xf -
-dirsources=`gunzip -c ${build_cache_dir}/${fname} | tar -tf - | head -1 | awk '{ print $1 }'`
+
+# expand the file.
+case $fname in
+  *.tar.bz2)
+    bzip2 -dc ${build_cache_dir}/${fname} | tar -xf -
+    dirsources=`bzip2  -dc ${build_cache_dir}/${fname} | tar -tf - | head -1 | awk '{ print $1 }'`
+    ;;
+  *.tar.gz)
+    gunzip -c ${build_cache_dir}/${fname} | tar -xf -
+    dirsources=`gunzip -c ${build_cache_dir}/${fname} | tar -tf - | head -1 | awk '{ print $1 }'`
+    ;;
+  *)
+    echo "$fname can't expanded"
+    exit 1
+    ;;
+esac
+
+# Move the tree.
 mv ${dirsources} ${destdir}/srclib
 dirsources=${destdir}/srclib/${dirsources}
 




More information about the jbossnative-commits mailing list