tazlito rev 60

Add gen-liveflavor
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Apr 22 13:29:59 2008 +0000 (2008-04-22)
parents 2fdb65c9f624
children 1113791db34e
files tazlito
line diff
     1.1 --- a/tazlito	Sun Apr 13 09:54:13 2008 +0000
     1.2 +++ b/tazlito	Tue Apr 22 13:29:59 2008 +0000
     1.3 @@ -80,6 +80,7 @@
     1.4    gen-initiso     Generate a new initramfs and ISO from the distro tree.
     1.5    list-flavors    List all available package lists on the mirror.
     1.6    gen-flavor      Generate a new live-CD description.
     1.7 +  gen-liveflavor  Generate a live-CD description from current system.
     1.8    show-flavor     Show live-CD description.
     1.9    get-flavor      Get a flavor's list of packages.
    1.10    extract-distro  Extract and ISO to a directory and rebuild LiveCD tree.
    1.11 @@ -565,8 +566,51 @@
    1.12  		fi
    1.13  		rm -Rf $TMP_DIR
    1.14  		;;
    1.15 +	gen-liveflavor)
    1.16 +		# Generate a new flavor form the live system.
    1.17 +		FLAVOR=$2
    1.18 +		DESC=""
    1.19 +		case "$FLAVOR" in
    1.20 +		'')	echo -n "Flavor name : "
    1.21 +			read FLAVOR
    1.22 +			[ -z "$FLAVOR" ] && exit 1;;
    1.23 +		-?|-h*|--help) cat <<EOT
    1.24 +
    1.25 +SliTaz Live Tool - Version: $VERSION
    1.26 +\033[1mUsage: \033[0m `basename $0` gen-liveflavor flavor-name [flavor-patch-file]
    1.27 +\033[1mflavor-patch-file format: \033[0m
    1.28 +code	data
    1.29 ++	package to add
    1.30 +-	package to remove
    1.31 +?	display message
    1.32 +@	flavor description
    1.33 +
    1.34 +\033[1mExample: \033[0m
    1.35 +@	Developper tools for slitaz maintainers
    1.36 ++	slitaz-toolchain
    1.37 ++	mercurial
    1.38 +EOT
    1.39 +			exit 1;;
    1.40 +		esac
    1.41 +		mv /etc/tazlito/distro-packages.list \
    1.42 +		   /etc/tazlito/distro-packages.list.$$ 2> /dev/null
    1.43 +		rm -f distro-packages.list non-free.list 2> /dev/null
    1.44 +		tazpkg recharge
    1.45 +		[ -n "$3" ] && while read action pkg; do
    1.46 +			case "$action" in
    1.47 +			+)	yes | tazpkg get-install $pkg;;
    1.48 +			-)	yes | tazpkg remove $pkg;;
    1.49 +			@)	DESC="$pkg";;
    1.50 +			\?)	echo -en "$pkg"; read action;;
    1.51 +			esac
    1.52 +		done < $3
    1.53 +		yes '' | tazlito gen-distro
    1.54 +		echo "$DESC" | tazlito gen-flavor "$FLAVOR"
    1.55 +		mv /etc/tazlito/distro-packages.list.$$ \
    1.56 +		   /etc/tazlito/distro-packages.list 2> /dev/null
    1.57 +		;;
    1.58  	gen-flavor)
    1.59 -		# Generate a new flavor form then last iso image generation.
    1.60 +		# Generate a new flavor from the last iso image generation.
    1.61  		FLAVOR=$2
    1.62  		echo ""
    1.63  		echo -e "\033[1mFlavor generation\033[0m"
    1.64 @@ -602,8 +646,8 @@
    1.65  			eval $(grep ^VERSION= $ROOTFS$INSTALLED/$i/receipt)
    1.66  			echo "$i-$VERSION" >> $FLAVOR.pkglist
    1.67  		done
    1.68 -		echo -e "$FLAVOR.desc\n$FILES" | cpio -o -H newc 2>/dev/null | \
    1.69 -			gzip -9 > $FLAVOR.flavor
    1.70 +		ls $FLAVOR.desc $FILES 2>/dev/null | \
    1.71 +			cpio -o -H newc 2>/dev/null | gzip -9 > $FLAVOR.flavor
    1.72  		rm `echo -e $FILES`
    1.73  		status
    1.74  		echo "================================================================================"