tazwok rev 449 4.3

Fix safe wok generation & change config according this; plus few tiny hacks
author Antoine Bodin <gokhlayeh@slitaz.org>
date Tue Mar 15 03:52:02 2011 +0100 (2011-03-15)
parents 068d36bf2a03
children 10a0f496be28
files TODO examples/tazwok.conf tazwok
line diff
     1.1 --- a/TODO	Tue Mar 15 01:56:37 2011 +0100
     1.2 +++ b/TODO	Tue Mar 15 03:52:02 2011 +0100
     1.3 @@ -7,7 +7,7 @@
     1.4  		[ ] get reverse depends when a recook is needed (don't catch packages from reference repository!)
     1.5  			> this one is not good yet
     1.6  		[ ] cooklist generation
     1.7 -[ ] Fix md5um on-the-fly generation when using check-incoming)
     1.8 +[*] Fix md5um on-the-fly generation when using check-incoming)
     1.9  [*] Generate cooklist properly after cook-toolchain
    1.10  
    1.11  ==== Code optimizations ====
    1.12 @@ -28,6 +28,7 @@
    1.13  
    1.14  ==== New features ====
    1.15  
    1.16 +[ ] Allow to download safe-wok using rsync
    1.17  [ ] Take advantage of --rootconfig of new tazpkg (after tazpkg 4.3 release only)
    1.18  [*] Generate the safe-wok, and optionally a tarbalized one
    1.19  [ ] Rework detection of broken shared libs dependencies
    1.20 @@ -37,4 +38,4 @@
    1.21  	[ ] Need to check priorities outside of chroot
    1.22  [*] Generate ID of the repository.
    1.23  [ ] Ensure ID is up-dated after cook operations to avoid false-changes detection.
    1.24 -[ ] Ensure smooth tazwok update by automatically update cook environnement according new stuff
    1.25 \ No newline at end of file
    1.26 +[ ] Ensure smooth tazwok update by automatically update cook environnement according new stuff
     2.1 --- a/examples/tazwok.conf	Tue Mar 15 01:56:37 2011 +0100
     2.2 +++ b/examples/tazwok.conf	Tue Mar 15 03:52:02 2011 +0100
     2.3 @@ -9,13 +9,22 @@
     2.4  TARBALL_WOK="$MIRROR/wok.tar.lzma"
     2.5  HG_WOK="http://hg.slitaz.org/wok"
     2.6  
     2.7 -# Ask tazwok to generate a tarball of the safe-wok
     2.8 -# An unpacked safe-wok is generated at PACKAGES_REPOSITORY/wok
     2.9 -# This safe-wok contains all receipts you compiled fine.
    2.10 -# GEN_SAFE_WOK_TARBALL="yes"
    2.11 +# save_wok: Save receipts known to compile well.
    2.12 +# It will generate the saved woks into packages and packages-incoming,
    2.13 +# containing cooking stuff used to compile packages on theses repositories.
    2.14 +# To disable it, comment the variable definition.
    2.15 +# If save_wok="tarball", a wok.taz.lzma will be generated each time you
    2.16 +# succefully check-incoming.
    2.17 +save_wok=yes
    2.18  
    2.19  # Use an online repository to get packages instead of one
    2.20  # you builded yourself / you rsyncked.
    2.21 +#
    2.22 +# Note: you should enable this on a repo per repo basis,
    2.23 +# you probably don't want to set this globally.
    2.24 +# You can put particular configuration into LOCAL_REPOSITORY/tazwok.conf
    2.25 +# You don't need to copy the whole config: the variable definition alone
    2.26 +# is enough as all other datas will be get from global config.
    2.27  # USE_ONLINE_PKG="$MIRROR"
    2.28  
    2.29  # Default makeflags.
     3.1 --- a/tazwok	Tue Mar 15 01:56:37 2011 +0100
     3.2 +++ b/tazwok	Tue Mar 15 03:52:02 2011 +0100
     3.3 @@ -1199,6 +1199,9 @@
     3.4  	{ zcat fs.cpio.gz 2> /dev/null || unlzma -c fs.cpio.lzma; } | cpio --quiet -id
     3.5  	rm fs.cpio.* && cd ..
     3.6  
     3.7 +	# Save receipts if save_wok is enabled.
     3.8 +	[ "$save_wok" ] && copy_cooking_stuff $WOK $PACKAGE $INCOMING_REPOSITORY/wok
     3.9 +
    3.10  	# Recook of reverse-depends if package was broken.
    3.11  	if grep -q "^$PACKAGE$" $broken; then
    3.12  		report step "Planning a re-try cook of reverse depends" 
    3.13 @@ -1303,16 +1306,18 @@
    3.14  				erase_package_info
    3.15  				echo "Removing $PACKAGE from $pkg_repository."
    3.16  				rm $pkg
    3.17 -				rm -rf $WOK/$PACKAGE
    3.18 -				sed "/^$PACKAGE\t/d" -i $wan_db $dep_db $cookorder
    3.19 -				sed "/^$PACKAGE$/d" -i $cooklist $commit $blocked $broken
    3.20 -				rm -f $LOCAL_REPOSITORY/log/$PACKAGE.html
    3.21 -				if [ "$pkg_repository" = "$INCOMING_REPOSITORY" ] && \
    3.22 -				[ "$(sed 1!d $cookorder)" != "#PlanSort" ] ; then
    3.23 -					sed 1i"#PlanSort" -i $cookorder
    3.24 -					regen_cooklist=yes
    3.25 +				[ "$save_wok" ] && rm -rf $pkg_repository/wok/$PACKAGE
    3.26 +				if [ "$pkg_repository" = "$INCOMING_REPOSITORY" ]; then
    3.27 +					rm -rf $WOK/$PACKAGE
    3.28 +					sed "/^$PACKAGE\t/d" -i $wan_db $dep_db $cookorder
    3.29 +					sed "/^$PACKAGE$/d" -i $cooklist $commit $blocked $broken
    3.30 +					rm -f $LOCAL_REPOSITORY/log/$PACKAGE.html
    3.31 +					if [ "$(sed 1!d $cookorder)" != "#PlanSort" ]; then
    3.32 +						sed 1i"#PlanSort" -i $cookorder
    3.33 +						regen_cooklist=yes
    3.34 +					fi
    3.35  				else
    3.36 -					echo "$PACKAGE" >> removed
    3.37 +   					echo "$PACKAGE" >> removed
    3.38  					sed -n '1,10p' -i removed
    3.39  				fi
    3.40  			fi
    3.41 @@ -2116,7 +2121,7 @@
    3.42  	fi
    3.43  
    3.44  	report step "Moving incoming packages to main repository"
    3.45 -	mkdir -p $PACKAGES_REPOSITORY/wok
    3.46 +	[ "save_wok" ] && mkdir -p $PACKAGES_REPOSITORY/wok
    3.47  	unset EXTRAVERSION
    3.48  	for PACKAGE in $incoming_pkgs; do
    3.49  			prev_VERSION=$(get_pkg_version $PACKAGES_REPOSITORY)
    3.50 @@ -2133,15 +2138,11 @@
    3.51  				grep -q $'\t'$previous_tarball$ $SOURCES_REPOSITORY/sources.list || \
    3.52  					rm -f $SOURCES_REPOSITORY/$previous_tarball
    3.53  			fi
    3.54 -			rm -rf $PACKAGES_REPOSITORY/wok/$PACKAGE
    3.55 -			mkdir -p $PACKAGES_REPOSITORY/wok/$PACKAGE
    3.56 -			for i in $WOK/$PACKAGE/receipt $WOK/$PACKAGE/description.txt \
    3.57 -			$WOK/$PACKAGE/stuff; do
    3.58 -				cp -a $i $PACKAGES_REPOSITORY/wok/$PACKAGE
    3.59 -			done
    3.60 +			[ "$save_wok" ] &&
    3.61 +			copy_cooking_stuff $INCOMING_REPOSITORY/wok $PACKAGE $PACKAGES_REPOSITORY/wok
    3.62  	done
    3.63  
    3.64 -	if [ "$GEN_SAFE_WOK_TARBALL" ]; then
    3.65 +	if [ "$save_wok" = tarball ]; then
    3.66  		rm -f $PACKAGES_REPOSITORY/wok.tar.lzma
    3.67  		cd $PACKAGES_REPOSITORY/wok
    3.68  		report step "Generating safe-wok tarball"
    3.69 @@ -2186,6 +2187,20 @@
    3.70  	report end-step
    3.71  }
    3.72  
    3.73 +# Usage: move_cooking_stuff source receipt destination
    3.74 +# Make the argument check before calling it!
    3.75 +copy_cooking_stuff()
    3.76 +{
    3.77 +	rm -rf $3/$2
    3.78 +	mkdir -p $3/$2
    3.79 +	cp -a $1/$2/receipt $3/$2
    3.80 +	[ -f $1/$2/description.txt ] && \
    3.81 +		cp -a $1/$2/description.txt $3/$2
    3.82 +	if [ -d "$1/$2/stuff" ]; then
    3.83 +		cp -a $1/$2/stuff $3/$2
    3.84 +	fi
    3.85 +}
    3.86 +
    3.87  ########################################################################
    3.88  # TAZWOK MAIN FUNCTIONS
    3.89  ########################
    3.90 @@ -2858,13 +2873,7 @@
    3.91  		report step "Creating clean wok in : $dest"
    3.92  		for pkg in `ls -1 $WOK`
    3.93  		do
    3.94 -			mkdir -p $dest/$pkg
    3.95 -			cp -a $WOK/$pkg/receipt $dest/$pkg
    3.96 -			[ -f $WOK/$pkg/description.txt ] && \
    3.97 -				cp -a $WOK/$pkg/description.txt $dest/$pkg
    3.98 -			if [ -d "$WOK/$pkg/stuff" ]; then
    3.99 -				cp -a $WOK/$pkg/stuff $dest/$pkg
   3.100 -			fi
   3.101 +			copy_cooking_stuff $WOK $pkg $dest
   3.102  		done
   3.103  		[ -d $WOK/.hg ] && cp -a $WOK/.hg $dest
   3.104  		report end-step