cookutils annotate cooks @ 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
children b445a91a8be7
rev   line source
al@850 1 #!/bin/sh
al@850 2 # Cook specified package and then cook all the splitted packages
al@850 3 # that builds from the files of just builded package
al@850 4
al@850 5 case "$1" in
al@850 6 --help|-h)
al@850 7 cat <<EOT
al@850 8 Usage: cooks <package>
al@850 9
al@850 10 Cook the specified package and then cook all the packages defined in the
al@850 11 SPLIT variable in the package receipt.
al@850 12 Note, *-dev packages are implicit and usually omitted.
al@850 13
al@850 14 EOT
al@850 15 exit 0
al@850 16 ;;
al@850 17 esac
al@850 18
al@850 19 pkg="$1"
al@850 20 . /etc/slitaz/cook.conf
al@850 21
al@850 22 cook "$pkg"
al@850 23
al@850 24 # Get the list
al@850 25 splitted=$(SPLIT=''; . $WOK/$pkg/receipt; echo $SPLIT)
al@850 26
al@850 27 # $SPLIT may contain the "*-dev" somewhere already if cooking order is significant.
al@850 28 # Cook the "*-dev" first if order is unsignificant.
al@850 29 [ "${splitted/$pkg-dev/}" == "$splitted" ] && splitted="$pkg-dev $splitted"
al@850 30
al@850 31 # (re-)cook all existed packages
al@850 32 for i in $splitted; do
al@850 33 [ -d "$WOK/$i" ] && cook $i
al@850 34 done
al@850 35
al@850 36 exit 0