# HG changeset patch # User Antoine Bodin # Date 1297546890 -3600 # Node ID edfb3f3deb7532647bef6e07a7e3d2436f51ce0f # Parent e0b050d9ae25b42ec53a83920127a2ebacf2a1a1 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. diff -r e0b050d9ae25 -r edfb3f3deb75 tazwok --- a/tazwok Sat Feb 12 14:48:59 2011 +0100 +++ b/tazwok Sat Feb 12 22:41:30 2011 +0100 @@ -435,7 +435,7 @@ # Check for src tarball and wget if needed. check_for_tarball() { - [ "$WGET_URL" ] || return + [ "$WGET_URL" ] || return 0 report step "Checking for source tarball" if [ ! -f "$SOURCES_REPOSITORY/$TARBALL" ] && \ @@ -496,14 +496,31 @@ tar xf - -C $tmp_src elif [ -f "$SOURCES_REPOSITORY/$TARBALL" ]; then case "$TARBALL" in - *zip|*xpi) { cd $tmp_src; unzip -o $SOURCES_REPOSITORY/$TARBALL; };; - *bz2) tar xjf $SOURCES_REPOSITORY/$TARBALL -C $tmp_src;; + *zip|*xpi) + cur_dir=$PWD + cd $tmp_src + unzip -o $SOURCES_REPOSITORY/$TARBALL + cd $cur_dir + unset cur_dir + ;; + *bz2|*tbz|*gem) tar xjf $SOURCES_REPOSITORY/$TARBALL -C $tmp_src;; *tar) tar xf $SOURCES_REPOSITORY/$TARBALL -C $tmp_src;; - *lzma) unlzma -c $SOURCES_REPOSITORY/$TARBALL | tar xf - -C $tmp_src;; + *lzma|*lz) unlzma -c $SOURCES_REPOSITORY/$TARBALL | tar xf - -C $tmp_src;; *xz) unxz -c $SOURCES_REPOSITORY/$TARBALL | tar xf - -C $tmp_src;; - *Z) uncompress -c $SOURCES_REPOSITORY/$TARBALL | tar xf - -C $tmp_src;; - *jar) mkdir $src && cp -f $SOURCES_REPOSITORY/$TARBALL $tmp_src ;; - *) tar xzf $SOURCES_REPOSITORY/$TARBALL -C $tmp_src;; + *Z|*taz) uncompress -c $SOURCES_REPOSITORY/$TARBALL | tar xf - -C $tmp_src;; + *gz) tar xzf $SOURCES_REPOSITORY/$TARBALL -C $tmp_src;; + *rpm) + cur_dir=$PWD + cd $tmp_src + rpm2cpio $SOURCES_REPOSITORY/$TARBALL | cpio -idm --quiet + cd $cur_dir + unset cur_dir + ;; + # It's a plain file or something receipt unpack itself. + *) + mkdir $tmp_src/${SOURCE:-$PACKAGE}-$VERSION + cp $SOURCES_REPOSITORY/$TARBALL $tmp_src/${SOURCE:-$PACKAGE}-$VERSION + ;; esac || return 1 # Check if uncompressed tarball is in a root dir or not.