cookutils rev 850

Undo previous commit. Introduce `cooks` with the same purpose.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Mon Dec 19 05:42:15 2016 +0200 (2016-12-19)
parents c1f4d81d16e7
children 7e846bbf8b7c
files Makefile cook cooks
line diff
     1.1 --- a/Makefile	Mon Dec 19 03:15:08 2016 +0200
     1.2 +++ b/Makefile	Mon Dec 19 05:42:15 2016 +0200
     1.3 @@ -22,6 +22,7 @@
     1.4  	install -m 0755 -d $(DESTDIR)$(PREFIX)/share/cook/cooktest
     1.5  	install -m 0755 -d $(DESTDIR)$(PREFIX)/share/doc/cookutils
     1.6  	install -m 0755 cook $(DESTDIR)$(PREFIX)/bin
     1.7 +	install -m 0755 cooks $(DESTDIR)$(PREFIX)/bin
     1.8  	install -m 0755 fix-desktop-file $(DESTDIR)$(PREFIX)/bin
     1.9  	install -m 0755 cooker $(DESTDIR)$(PREFIX)/bin
    1.10  	install -m 0755 cookiso $(DESTDIR)$(PREFIX)/bin
    1.11 @@ -41,6 +42,7 @@
    1.12  uninstall-cook:
    1.13  	rm -rf \
    1.14  		$(DESTDIR)$(PREFIX)/bin/cook \
    1.15 +		$(DESTDIR)$(PREFIX)/bin/cooks \
    1.16  		$(DESTDIR)$(PREFIX)/bin/fix-desktop-file \
    1.17  		$(DESTDIR)$(PREFIX)/bin/cooker \
    1.18  		$(DESTDIR)$(PREFIX)/bin/cookiso \
     2.1 --- a/cook	Mon Dec 19 03:15:08 2016 +0200
     2.2 +++ b/cook	Mon Dec 19 05:42:15 2016 +0200
     2.3 @@ -51,7 +51,6 @@
     2.4  cook <pkg>
     2.5      --clean       -c   $(_ 'clean the package in the wok.')
     2.6      --install     -i   $(_ 'cook and install the package.')
     2.7 -    --wsplit      -ws  $(_ 'cook the package and then all the splitted ones.')
     2.8      --getsrc      -gs  $(_ 'get the package source tarball.')
     2.9      --block       -b   $(_ 'block a package so cook will skip it.')
    2.10      --unblock     -ub  $(_ 'unblock a blocked package.')
    2.11 @@ -2416,17 +2415,9 @@
    2.12  		[ -s /aufs-umount.sh ] ||
    2.13  		install_package
    2.14  
    2.15 -		rm -f $command
    2.16 -
    2.17 -		# Cook splitted packages that builds from the files of just builded package
    2.18 -		if [ "$2" == '--wsplit' -o "$2" == '-ws' ]; then
    2.19 -			splitted=$(SPLIT=''; . $WOK/$pkg/receipt; echo $SPLIT)
    2.20 -			[ "${splitted/$pkg-dev/}" == "$splitted" ] && splitted="$pkg-dev $splitted"
    2.21 -			for i in $splitted; do
    2.22 -				[ -d "$WOK/$i" ] && cook $i
    2.23 -			done
    2.24 -		fi
    2.25 -		;;
    2.26 +		# Finally we DON'T WANT to build the *-dev or packages with WANTED="$pkg"
    2.27 +		# You want automation: use the Cooker Build Bot.
    2.28 +		rm -f $command ;;
    2.29  esac
    2.30  
    2.31  exit 0
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/cooks	Mon Dec 19 05:42:15 2016 +0200
     3.3 @@ -0,0 +1,36 @@
     3.4 +#!/bin/sh
     3.5 +# Cook specified package and then cook all the splitted packages
     3.6 +# that builds from the files of just builded package
     3.7 +
     3.8 +case "$1" in
     3.9 +	--help|-h)
    3.10 +		cat <<EOT
    3.11 +Usage: cooks <package>
    3.12 +
    3.13 +Cook the specified package and then cook all the packages defined in the
    3.14 +SPLIT variable in the package receipt.
    3.15 +Note, *-dev packages are implicit and usually omitted.
    3.16 +
    3.17 +EOT
    3.18 +		exit 0
    3.19 +		;;
    3.20 +esac
    3.21 +
    3.22 +pkg="$1"
    3.23 +. /etc/slitaz/cook.conf
    3.24 +
    3.25 +cook "$pkg"
    3.26 +
    3.27 +# Get the list
    3.28 +splitted=$(SPLIT=''; . $WOK/$pkg/receipt; echo $SPLIT)
    3.29 +
    3.30 +# $SPLIT may contain the "*-dev" somewhere already if cooking order is significant.
    3.31 +# Cook the "*-dev" first if order is unsignificant.
    3.32 +[ "${splitted/$pkg-dev/}" == "$splitted" ] && splitted="$pkg-dev $splitted"
    3.33 +
    3.34 +# (re-)cook all existed packages
    3.35 +for i in $splitted; do
    3.36 +	[ -d "$WOK/$i" ] && cook $i
    3.37 +done
    3.38 +
    3.39 +exit 0