tazwok rev 461 4.3

Merge changes from default
author Antoine Bodin <gokhlayeh@slitaz.org>
date Fri Mar 25 18:20:21 2011 +0100 (2011-03-25)
parents 4c0c67f36336 e2d5b3583ee8
children ad725c56d2e1
files tazwok
line diff
     1.1 --- a/.hgtags	Fri Mar 25 17:58:40 2011 +0100
     1.2 +++ b/.hgtags	Fri Mar 25 18:20:21 2011 +0100
     1.3 @@ -22,3 +22,4 @@
     1.4  433aa071e16c7f61966e426207dfa3f142859458 4.2.5
     1.5  bf449151a34258e71f7ec0868f3e521d22995817 4.2.6
     1.6  ff412a1044b097a7fb095d22081245fbcb00a187 4.2.7
     1.7 +7e7265ac0dc0858705f369998a140298c753854b 4.2.8
     2.1 --- a/tazwok	Fri Mar 25 17:58:40 2011 +0100
     2.2 +++ b/tazwok	Fri Mar 25 18:20:21 2011 +0100
     2.3 @@ -49,6 +49,7 @@
     2.4    gen-cooklist   Generate a sorted cooklist using packages or list.
     2.5    sort-cooklist  Sort the cooklist given in argument.
     2.6    get-src        Download the tarball of the package given in argument.
     2.7 +  gen-src        Rebuild sources.list in $SOURCES_REPOSITORY folder.
     2.8    clean          Clean all generated files in the package tree.
     2.9    new-tree       Prepare a new package tree and receipt (--interactive).
    2.10    gen-list       (Re-)Generate a packages list for a repository.
    2.11 @@ -124,7 +125,7 @@
    2.12  	get_config
    2.13  
    2.14  	# Define & get options.
    2.15 -	get_options_list="$get_options_list SLITAZ_DIR SLITAZ_VERSION undigest"
    2.16 +	get_options_list="$get_options_list WOK SLITAZ_DIR SLITAZ_VERSION undigest"
    2.17  	get_options
    2.18  
    2.19  	LOCAL_REPOSITORY=$SLITAZ_DIR/${undigest:-$SLITAZ_VERSION}
    2.20 @@ -226,7 +227,7 @@
    2.21  set_common_path()
    2.22  {
    2.23  	PACKAGES_REPOSITORY=$LOCAL_REPOSITORY/packages
    2.24 -	WOK=$LOCAL_REPOSITORY/wok
    2.25 +	[ "$WOK" ] || WOK=$LOCAL_REPOSITORY/wok
    2.26  	INCOMING_REPOSITORY=$LOCAL_REPOSITORY/packages-incoming
    2.27  	SOURCES_REPOSITORY=$LOCAL_REPOSITORY/src
    2.28  	RECEIPT="$WOK/$PACKAGE/receipt"
    2.29 @@ -655,6 +656,41 @@
    2.30  	report end-step
    2.31  }
    2.32  
    2.33 +# help gen sources.list file from scranch
    2.34 +gen_sources_list()
    2.35 +{
    2.36 +	local src_repository=$1
    2.37 +	[ -f $src_repository/sources.list ] && rm -f $src_repository/sources.list
    2.38 +	for i in $WOK/*; do
    2.39 +		unset PACKAGE SOURCE VERSION WGET_URL TARBALL WANTED
    2.40 +		[ -f $i/receipt ] && source $i/receipt
    2.41 +		[ "$WGET_URL" ] || continue
    2.42 +		if grep -q "^$PACKAGE | $VERSION" $PACKAGES_REPOSITORY/packages.desc; then
    2.43 +			main_version="$VERSION"
    2.44 +			if [ -f $src_repository/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma ]; then
    2.45 +				echo -e "$PACKAGE:main\t${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" >> $src_repository/sources.list
    2.46 +			elif [ -f "$src_repository/$TARBALL" ]; then
    2.47 +				echo -e "$PACKAGE:main\t$TARBALL" >> $src_repository/sources.list
    2.48 +			fi
    2.49 +		else
    2.50 +			# May not works if package use extraversion.
    2.51 +			main_version=$(grep -m1 -A1 -sh ^$PACKAGE$ $PACKAGES_REPOSITORY/packages.txt | tail -1 | sed 's/ *//')
    2.52 +			if [ -f $src_repository/${SOURCE:-$PACKAGE}-$main_version.tar.lzma ]; then
    2.53 +				echo -e "$PACKAGE:main\t${SOURCE:-$PACKAGE}-$main_version.tar.lzma" >> $src_repository/sources.list
    2.54 +			else
    2.55 +				unset main_version
    2.56 +			fi
    2.57 +		fi
    2.58 +		if [ ! "$main_version" ] || [ $(grep -q "^$PACKAGE | $VERSION" $INCOMING_REPOSITORY/packages.desc 2>/dev/null) ]; then
    2.59 +			if [ -f $src_repository/${SOURCE:-$PACKAGE}-$VERSION.tar.lzma ]; then
    2.60 +				echo -e "$PACKAGE:incoming\t${SOURCE:-$PACKAGE}-$VERSION.tar.lzma" >> $src_repository/sources.list
    2.61 +			elif [ -f "$src_repository/$TARBALL" ]; then
    2.62 +				echo -e "$PACKAGE:incoming\t$TARBALL" >> $src_repository/sources.list
    2.63 +			fi
    2.64 +		fi
    2.65 +	done
    2.66 +}
    2.67 +
    2.68  # Log and execute compile_rules function if it exists, to configure and
    2.69  # make the package if it exists.
    2.70  check_for_compile_rules()
    2.71 @@ -966,6 +1002,7 @@
    2.72  	[ -n "$FSH" ] || FSH="bin boot dev etc home init lib media mnt proc \
    2.73  root sbin share sys tmp usr var vz usr/bin usr/games usr/include usr/lib \
    2.74  usr/local usr/sbin usr/share usr/src"
    2.75 +	error=0
    2.76  	for i in `ls -d * usr/* 2>/dev/null`
    2.77  	do
    2.78  		if ! echo $FSH | fgrep -q $i; then
    2.79 @@ -3231,6 +3268,21 @@
    2.80  			echo "No tarball to check for $PACKAGE"
    2.81  		fi
    2.82  	;;
    2.83 +	gen-src)
    2.84 +		get_tazwok_config
    2.85 +		if [ "$2" ]; then
    2.86 +			if [ -d "$2" ]; then
    2.87 +				src_repository=$2
    2.88 +			else
    2.89 +				echo -e "\nUnable to find directory : $2\n" >&2
    2.90 +				exit 1
    2.91 +			fi
    2.92 +		fi
    2.93 +		echo -n "Rebuilding sources.list file"
    2.94 +		[ $src_repository ] || src_repository="$SOURCES_REPOSITORY"
    2.95 +		gen_sources_list $src_repository
    2.96 +		status
    2.97 +	;;
    2.98  	get-src)
    2.99  		check_root
   2.100  		get_options_list="target nounpack"