tazwok rev 258
Rework tarball unpacking: handle rpm as other archive; handle simple file / unknow archive type(i.e. jar): in this case the file/archive will be available into the $src dir.
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Sat Feb 12 22:41:30 2011 +0100 (2011-02-12) |
parents | e0b050d9ae25 |
children | e8d822c062a1 |
files | tazwok |
line diff
1.1 --- a/tazwok Sat Feb 12 14:48:59 2011 +0100 1.2 +++ b/tazwok Sat Feb 12 22:41:30 2011 +0100 1.3 @@ -435,7 +435,7 @@ 1.4 # Check for src tarball and wget if needed. 1.5 check_for_tarball() 1.6 { 1.7 - [ "$WGET_URL" ] || return 1.8 + [ "$WGET_URL" ] || return 0 1.9 report step "Checking for source tarball" 1.10 1.11 if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ] && \ 1.12 @@ -496,14 +496,31 @@ 1.13 tar xf - -C $tmp_src 1.14 elif [ -f "$SOURCES_REPOSITORY/$TARBALL" ]; then 1.15 case "$TARBALL" in 1.16 - *zip|*xpi) { cd $tmp_src; unzip -o $SOURCES_REPOSITORY/$TARBALL; };; 1.17 - *bz2) tar xjf $SOURCES_REPOSITORY/$TARBALL -C $tmp_src;; 1.18 + *zip|*xpi) 1.19 + cur_dir=$PWD 1.20 + cd $tmp_src 1.21 + unzip -o $SOURCES_REPOSITORY/$TARBALL 1.22 + cd $cur_dir 1.23 + unset cur_dir 1.24 + ;; 1.25 + *bz2|*tbz|*gem) tar xjf $SOURCES_REPOSITORY/$TARBALL -C $tmp_src;; 1.26 *tar) tar xf $SOURCES_REPOSITORY/$TARBALL -C $tmp_src;; 1.27 - *lzma) unlzma -c $SOURCES_REPOSITORY/$TARBALL | tar xf - -C $tmp_src;; 1.28 + *lzma|*lz) unlzma -c $SOURCES_REPOSITORY/$TARBALL | tar xf - -C $tmp_src;; 1.29 *xz) unxz -c $SOURCES_REPOSITORY/$TARBALL | tar xf - -C $tmp_src;; 1.30 - *Z) uncompress -c $SOURCES_REPOSITORY/$TARBALL | tar xf - -C $tmp_src;; 1.31 - *jar) mkdir $src && cp -f $SOURCES_REPOSITORY/$TARBALL $tmp_src ;; 1.32 - *) tar xzf $SOURCES_REPOSITORY/$TARBALL -C $tmp_src;; 1.33 + *Z|*taz) uncompress -c $SOURCES_REPOSITORY/$TARBALL | tar xf - -C $tmp_src;; 1.34 + *gz) tar xzf $SOURCES_REPOSITORY/$TARBALL -C $tmp_src;; 1.35 + *rpm) 1.36 + cur_dir=$PWD 1.37 + cd $tmp_src 1.38 + rpm2cpio $SOURCES_REPOSITORY/$TARBALL | cpio -idm --quiet 1.39 + cd $cur_dir 1.40 + unset cur_dir 1.41 + ;; 1.42 + # It's a plain file or something receipt unpack itself. 1.43 + *) 1.44 + mkdir $tmp_src/${SOURCE:-$PACKAGE}-$VERSION 1.45 + cp $SOURCES_REPOSITORY/$TARBALL $tmp_src/${SOURCE:-$PACKAGE}-$VERSION 1.46 + ;; 1.47 esac || return 1 1.48 1.49 # Check if uncompressed tarball is in a root dir or not.