# HG changeset patch # User Antoine Bodin # Date 1300157522 -3600 # Node ID 04eb5fb6c9a3546acb50377bddeb3032a116f7b1 # Parent 068d36bf2a03f8c8667594df97fe4bef8c8cc160 Fix safe wok generation & change config according this; plus few tiny hacks diff -r 068d36bf2a03 -r 04eb5fb6c9a3 TODO --- a/TODO Tue Mar 15 01:56:37 2011 +0100 +++ b/TODO Tue Mar 15 03:52:02 2011 +0100 @@ -7,7 +7,7 @@ [ ] get reverse depends when a recook is needed (don't catch packages from reference repository!) > this one is not good yet [ ] cooklist generation -[ ] Fix md5um on-the-fly generation when using check-incoming) +[*] Fix md5um on-the-fly generation when using check-incoming) [*] Generate cooklist properly after cook-toolchain ==== Code optimizations ==== @@ -28,6 +28,7 @@ ==== New features ==== +[ ] Allow to download safe-wok using rsync [ ] Take advantage of --rootconfig of new tazpkg (after tazpkg 4.3 release only) [*] Generate the safe-wok, and optionally a tarbalized one [ ] Rework detection of broken shared libs dependencies @@ -37,4 +38,4 @@ [ ] Need to check priorities outside of chroot [*] Generate ID of the repository. [ ] Ensure ID is up-dated after cook operations to avoid false-changes detection. -[ ] Ensure smooth tazwok update by automatically update cook environnement according new stuff \ No newline at end of file +[ ] Ensure smooth tazwok update by automatically update cook environnement according new stuff diff -r 068d36bf2a03 -r 04eb5fb6c9a3 examples/tazwok.conf --- a/examples/tazwok.conf Tue Mar 15 01:56:37 2011 +0100 +++ b/examples/tazwok.conf Tue Mar 15 03:52:02 2011 +0100 @@ -9,13 +9,22 @@ TARBALL_WOK="$MIRROR/wok.tar.lzma" HG_WOK="http://hg.slitaz.org/wok" -# Ask tazwok to generate a tarball of the safe-wok -# An unpacked safe-wok is generated at PACKAGES_REPOSITORY/wok -# This safe-wok contains all receipts you compiled fine. -# GEN_SAFE_WOK_TARBALL="yes" +# save_wok: Save receipts known to compile well. +# It will generate the saved woks into packages and packages-incoming, +# containing cooking stuff used to compile packages on theses repositories. +# To disable it, comment the variable definition. +# If save_wok="tarball", a wok.taz.lzma will be generated each time you +# succefully check-incoming. +save_wok=yes # Use an online repository to get packages instead of one # you builded yourself / you rsyncked. +# +# Note: you should enable this on a repo per repo basis, +# you probably don't want to set this globally. +# You can put particular configuration into LOCAL_REPOSITORY/tazwok.conf +# You don't need to copy the whole config: the variable definition alone +# is enough as all other datas will be get from global config. # USE_ONLINE_PKG="$MIRROR" # Default makeflags. diff -r 068d36bf2a03 -r 04eb5fb6c9a3 tazwok --- a/tazwok Tue Mar 15 01:56:37 2011 +0100 +++ b/tazwok Tue Mar 15 03:52:02 2011 +0100 @@ -1199,6 +1199,9 @@ { zcat fs.cpio.gz 2> /dev/null || unlzma -c fs.cpio.lzma; } | cpio --quiet -id rm fs.cpio.* && cd .. + # Save receipts if save_wok is enabled. + [ "$save_wok" ] && copy_cooking_stuff $WOK $PACKAGE $INCOMING_REPOSITORY/wok + # Recook of reverse-depends if package was broken. if grep -q "^$PACKAGE$" $broken; then report step "Planning a re-try cook of reverse depends" @@ -1303,16 +1306,18 @@ erase_package_info echo "Removing $PACKAGE from $pkg_repository." rm $pkg - rm -rf $WOK/$PACKAGE - sed "/^$PACKAGE\t/d" -i $wan_db $dep_db $cookorder - sed "/^$PACKAGE$/d" -i $cooklist $commit $blocked $broken - rm -f $LOCAL_REPOSITORY/log/$PACKAGE.html - if [ "$pkg_repository" = "$INCOMING_REPOSITORY" ] && \ - [ "$(sed 1!d $cookorder)" != "#PlanSort" ] ; then - sed 1i"#PlanSort" -i $cookorder - regen_cooklist=yes + [ "$save_wok" ] && rm -rf $pkg_repository/wok/$PACKAGE + if [ "$pkg_repository" = "$INCOMING_REPOSITORY" ]; then + rm -rf $WOK/$PACKAGE + sed "/^$PACKAGE\t/d" -i $wan_db $dep_db $cookorder + sed "/^$PACKAGE$/d" -i $cooklist $commit $blocked $broken + rm -f $LOCAL_REPOSITORY/log/$PACKAGE.html + if [ "$(sed 1!d $cookorder)" != "#PlanSort" ]; then + sed 1i"#PlanSort" -i $cookorder + regen_cooklist=yes + fi else - echo "$PACKAGE" >> removed + echo "$PACKAGE" >> removed sed -n '1,10p' -i removed fi fi @@ -2116,7 +2121,7 @@ fi report step "Moving incoming packages to main repository" - mkdir -p $PACKAGES_REPOSITORY/wok + [ "save_wok" ] && mkdir -p $PACKAGES_REPOSITORY/wok unset EXTRAVERSION for PACKAGE in $incoming_pkgs; do prev_VERSION=$(get_pkg_version $PACKAGES_REPOSITORY) @@ -2133,15 +2138,11 @@ grep -q $'\t'$previous_tarball$ $SOURCES_REPOSITORY/sources.list || \ rm -f $SOURCES_REPOSITORY/$previous_tarball fi - rm -rf $PACKAGES_REPOSITORY/wok/$PACKAGE - mkdir -p $PACKAGES_REPOSITORY/wok/$PACKAGE - for i in $WOK/$PACKAGE/receipt $WOK/$PACKAGE/description.txt \ - $WOK/$PACKAGE/stuff; do - cp -a $i $PACKAGES_REPOSITORY/wok/$PACKAGE - done + [ "$save_wok" ] && + copy_cooking_stuff $INCOMING_REPOSITORY/wok $PACKAGE $PACKAGES_REPOSITORY/wok done - if [ "$GEN_SAFE_WOK_TARBALL" ]; then + if [ "$save_wok" = tarball ]; then rm -f $PACKAGES_REPOSITORY/wok.tar.lzma cd $PACKAGES_REPOSITORY/wok report step "Generating safe-wok tarball" @@ -2186,6 +2187,20 @@ report end-step } +# Usage: move_cooking_stuff source receipt destination +# Make the argument check before calling it! +copy_cooking_stuff() +{ + rm -rf $3/$2 + mkdir -p $3/$2 + cp -a $1/$2/receipt $3/$2 + [ -f $1/$2/description.txt ] && \ + cp -a $1/$2/description.txt $3/$2 + if [ -d "$1/$2/stuff" ]; then + cp -a $1/$2/stuff $3/$2 + fi +} + ######################################################################## # TAZWOK MAIN FUNCTIONS ######################## @@ -2858,13 +2873,7 @@ report step "Creating clean wok in : $dest" for pkg in `ls -1 $WOK` do - mkdir -p $dest/$pkg - cp -a $WOK/$pkg/receipt $dest/$pkg - [ -f $WOK/$pkg/description.txt ] && \ - cp -a $WOK/$pkg/description.txt $dest/$pkg - if [ -d "$WOK/$pkg/stuff" ]; then - cp -a $WOK/$pkg/stuff $dest/$pkg - fi + copy_cooking_stuff $WOK $pkg $dest done [ -d $WOK/.hg ] && cp -a $WOK/.hg $dest report end-step