From 25a6af5a0720e49d7e42e31d2607e95a4e538ed8 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 30 Oct 2008 23:28:59 +0100 Subject: [PATCH] Remove unzip helper and make pkg add a build dep to unzip. That way we can simply check for unzip bin being installed and error out if it's not, it's simpler. --HG-- extra : convert_revision : 8fd6c5f11a54742403a16fa10c3ed1db7f12955b --- helper-templates/unzip-extraction.sh | 44 ---------------------------- templates/jasper.tmpl | 1 + xbps.sh | 24 +++++---------- 3 files changed, 8 insertions(+), 61 deletions(-) delete mode 100644 helper-templates/unzip-extraction.sh diff --git a/helper-templates/unzip-extraction.sh b/helper-templates/unzip-extraction.sh deleted file mode 100644 index 53c9c88b24..0000000000 --- a/helper-templates/unzip-extraction.sh +++ /dev/null @@ -1,44 +0,0 @@ -# -# This helper is used in templates using extract_sufx=".zip". -# This checks if unzip is installed and installs it if it's not. -# -# If unzip is already installed just return immediately. - -extract_unzip() -{ - local file="$1" - local dest="$2" - - [ ! -f $file ] && exit 1 - - $XBPS_MASTERDIR/usr/bin/unzip -q -x $file -d $dest - return $? -} - -if [ ! -x "$XBPS_MASTERDIR/usr/bin/unzip" ]; then - unzip_version="5.52" - - # Save pkgname before installing unzip. - save_pkgname=$pkgname - - check_installed_pkg unzip $unzip_version - if [ $? -ne 0 ]; then - echo "=> $save_pkgname package requires unzip for extraction." - # - # Install dependencies required by unzip. - # - install_builddeps_required_pkg unzip-$unzip_version - # - # Install the unzip package now. - # - install_pkg unzip - # - # Continue with previous template that called us. - # - reset_tmpl_vars - setup_tmpl $save_pkgname - fi - - unset save_pkgname - unset unzip_version -fi diff --git a/templates/jasper.tmpl b/templates/jasper.tmpl index 523dba51a8..16abfb8521 100644 --- a/templates/jasper.tmpl +++ b/templates/jasper.tmpl @@ -15,4 +15,5 @@ long_desc=" software has also been submitted to the ISO for inclusion in the JPEG-2000 Part-5 standard (as an official reference implementation)." +build_depends="unzip-5.52" run_depends="glibc-2.8" diff --git a/xbps.sh b/xbps.sh index b564404db3..6b0a92bc45 100755 --- a/xbps.sh +++ b/xbps.sh @@ -397,24 +397,14 @@ extract_distfiles() fi ;; .zip) - if [ -f "$XBPS_TMPLHELPDIR/unzip-extraction.sh" ]; then - # Save vars! - tmpf=$curfile - tmpsufx=$cursufx - tmpwrksrc=$lwrksrc - . $XBPS_TMPLHELPDIR/unzip-extraction.sh - # Restore vars! - curfile=$tmpf - cursufx=$tmpsufx - lwrksrc=$tmpwrksrc - unset tmpf tmpsufx tmpwrksrc + if [ -x $XBPS_MASTERDIR/usr/bin/unzip ]; then + $XBPS_MASTERDIR/usr/bin/unzip \ + -q -x $XBPS_SRCDISTDIR/$curfile -d $lwrksrc + if [ $? -ne 0 ]; then + msg_error "extracting $curfile into $lwrksrc." + fi else - msg_error "cannot find unzip helper." - fi - - extract_unzip $XBPS_SRCDISTDIR/$curfile $lwrksrc - if [ $? -ne 0 ]; then - msg_error "extracting $curfile into $lwrksrc." + msg_error "cannot find unzip bin for extraction" fi ;; *)