cookutils rev 61

Add support for git|url in WGET_URL (works but we need TARBALL= set to work)
author Christophe Lincoln <pankso@slitaz.org>
date Sat May 07 16:13:17 2011 +0200 (2011-05-07)
parents 107e1375ceef
children c49e394e87d3
files cook
line diff
     1.1 --- a/cook	Sat May 07 15:22:54 2011 +0200
     1.2 +++ b/cook	Sat May 07 16:13:17 2011 +0200
     1.3 @@ -139,7 +139,7 @@
     1.4  				if_empty_value
     1.5  				[ -z "$online" ] || break
     1.6  				if ! busybox wget -s $value 2>/dev/null; then
     1.7 -					gettext "QA: Unable to reach:"; echo -e " $value\n"
     1.8 +					gettext "QA: Unable to reach:"; echo -e " $value"
     1.9  				fi ;;
    1.10  		esac
    1.11  	done
    1.12 @@ -176,7 +176,6 @@
    1.13  				(echo -e "ERROR: wget $WGET_URL" && exit 1) ;;
    1.14  		hg*|mercurial*)
    1.15  			# We are in cache so clone here and create a tarball
    1.16 -			pwd=$(pwd)
    1.17  			if $(echo "$WGET_URL" | fgrep -q "hg|"); then
    1.18  				url=${WGET_URL#hg|}
    1.19  			else
    1.20 @@ -184,14 +183,23 @@
    1.21  			fi
    1.22  			pkgsrc=${SOURCE:-$PACKAGE}-$VERSION
    1.23  			tarball=$pkgsrc.tar.bz2
    1.24 -			gettext "Getting source from Hg: "; echo $url
    1.25 +			gettext -e "Getting source from Hg...\n"
    1.26 +			echo "URL: $url"
    1.27  			gettext "Cloning to: "; echo "$pwd/$pkgsrc"
    1.28  			hg clone $url $pkgsrc || (echo "ERROR: hg clone $url" && exit 1)
    1.29  			gettext "Creating tarball: "; echo "$tarball"
    1.30  			tar cjf $tarball $pkgsrc || exit 1
    1.31  			mv $tarball $SRC && rm -rf $pkgsrc ;;
    1.32  		git*)
    1.33 -			echo "TODO: git implementation in cook" && exit 1 ;;
    1.34 +			url=${WGET_URL#git|}
    1.35 +			pkgsrc=${SOURCE:-$PACKAGE}-$VERSION
    1.36 +			tarball=$pkgsrc.tar.bz2
    1.37 +			gettext -e "Getting source from Git...\n"
    1.38 +			echo "URL: $url"
    1.39 +			git clone $url $pkgsrc || (echo "ERROR: git clone $url" && exit 1)
    1.40 +			gettext "Creating tarball: "; echo "$tarball"
    1.41 +			tar cjf $tarball $pkgsrc || exit 1
    1.42 +			mv $tarball $SRC && rm -rf $pkgsrc ;;
    1.43  		svn*)
    1.44  			echo "TODO: svn implementation in cook" && exit 1 ;;
    1.45  		*)