# HG changeset patch # User Christophe Lincoln # Date 1306502119 -7200 # Node ID 35abcedb5ed7e550586baecc4a7aafda71c28401 # Parent 9c07802ebc58fb7e7b068d5721fdf3f4b670b2d9 improve and fix flavors creation diff -r 9c07802ebc58 -r 35abcedb5ed7 cook --- a/cook Fri May 27 14:31:02 2011 +0200 +++ b/cook Fri May 27 15:15:19 2011 +0200 @@ -38,7 +38,7 @@ list $(gettext "Cook a list of packages.") clean-wok $(gettext "Clean-up all packages files.") clean-src $(gettext "Clean-up all packages sources.") - pkgdb $(gettext "Create packages lists and pack flavors.") + pkgdb $(gettext "Create packages DB lists and flavors.") $(echo -e "\033[1m$(gettext "Options:")\033[0m") --clean|-c Cook : $(gettext "clean the package in the wok.") @@ -50,6 +50,7 @@ --wok|-w Setup: $(gettext "clone the cooking wok from Hg repo.") --stable Setup: $(gettext "clone the stable wok from Hg repo.") --undigest Setup: $(gettext "clone the undigest wok from Hg repo.") + --flavors Pkgdb: $(gettext "create up-to-date flavors files.") EOT exit 0 @@ -863,14 +864,22 @@ # Create suitable packages list for TazPKG and only for built packages # as well as flavors files for TazLiTo. We dont need logs since we do it # manualy to ensure everything is fine before syncing the mirror. - [ "$2" ] && PKGS="$2" - [ ! -d "$PKGS" ] && \ - gettext -e "\nPackages directory doesn't exist\n\n" && exit 1 + case "$2" in + --flavors) + continue ;; + *) + PKGS="$2" + [ ! -d "$PKGS" ] && \ + gettext -e "\nPackages directory doesn't exist\n\n" && + exit 1 ;; + esac time=$(date +%s) + flavors=$SLITAZ/flavors + live=$SLITAZ/live echo "cook:pkgdb" > $command echo "Cook pkgdb: Creating all packages lists" | log echo "" - gettext "Creating lists for: "; echo "$PKGS" + gettext "Creating lists for: "; echo "$PKGS" separator gettext "Cook pkgdb started: "; date "+%Y-%m-%d %H:%M" cd $PKGS @@ -935,13 +944,14 @@ # Create all flavors files at once. Do we realy need code to monitor # flavors changes ? Let just build them with packages lists before # syncing the mirror. - flavors=$SLITAZ/flavors - live=$SLITAZ/live - [ -d "$flavors" ] || exit 0 + [ "$2" == "--flavors" ] || exit 1 + [ ! -d "$flavors" ] && echo -e "Missing flavors: $flavors\n" && exit 1 + [ -d "$live" ] || mkdir -p $live gettext "Creating flavors files in:"; echo " $live" + echo "Cook pkgdb: Creating all flavors" | log separator gettext -e "Recharging lists to use latest packages...\n" - tazpkg recharge 2>&1 >/dev/null + tazpkg recharge 2>1 >/dev/null # We need a custom tazlito config to set working dir to /home/slitaz. if [ ! -f "$live/tazlito.conf" ]; then @@ -951,9 +961,10 @@ $live/tazlito.conf fi - # Update flavors repo and pack. - cd $flavors && hg pull -u - mkdir -p $live && cd $live + # Update Hg flavors repo and pack. + [ -d "$flavors/.hg" ] && cd $flavors && hg pull -u + + cd $live echo "Starting to generate flavors..." rm -f flavors.list *.flavor for i in $flavors/*