tazlito rev 332

tazlito + tazlito-wiz: cosmetic change and use busybox wget
author Christophe Lincoln <pankso@slitaz.org>
date Sun Feb 16 14:37:24 2014 +0100 (2014-02-16)
parents d51c187bb06d
children 9eb4febf0906
files tazlito tazlito-wiz
line diff
     1.1 --- a/tazlito	Wed Jan 15 13:15:16 2014 +0000
     1.2 +++ b/tazlito	Sun Feb 16 14:37:24 2014 +0100
     1.3 @@ -74,8 +74,7 @@
     1.4  #####################
     1.5  
     1.6  # Print the usage.
     1.7 -usage ()
     1.8 -{
     1.9 +usage () {
    1.10  	echo -e "\nSliTaz Live Tool - Version: $VERSION\n
    1.11  \033[1mUsage: \033[0m `basename $0` [command] [list|iso|flavor|compression] [dir|iso]
    1.12  \033[1mCommands: \033[0m\n
    1.13 @@ -112,9 +111,9 @@
    1.14  {
    1.15  	echo -n "$1"
    1.16  	case "$DEFAULT_ANSWER" in
    1.17 -	Y|y) answer="y";;
    1.18 -	N|n) answer="n";;
    1.19 -	*) read answer;;
    1.20 +		Y|y) answer="y";;
    1.21 +		N|n) answer="n";;
    1.22 +		*) read answer;;
    1.23  	esac
    1.24  }
    1.25  
    1.26 @@ -137,15 +136,14 @@
    1.27  	shift
    1.28  	for i in $mirrors; do
    1.29  		case "$i" in
    1.30 -		http://*|ftp://*) wget -c $i$@ && break;;
    1.31 +		http://*|ftp://*) busybox wget -c $i$@ && break;;
    1.32  		*) cp $i/$1 . && break;;
    1.33  		esac
    1.34  	done
    1.35  }
    1.36  
    1.37  # Download a file trying all mirrors
    1.38 -download()
    1.39 -{
    1.40 +download() {
    1.41  	local i
    1.42  	for i in $(cat $MIRROR $LOCALSTATE/undigest/*/mirror 2> /dev/null); do
    1.43  		download_from "$i" "$@" && break
    1.44 @@ -153,8 +151,7 @@
    1.45  }
    1.46  
    1.47  # Execute hooks provided by some packages
    1.48 -genisohooks()
    1.49 -{
    1.50 +genisohooks() {
    1.51  	local here=`pwd`
    1.52  	for i in $(ls $ROOTFS/etc/tazlito/*.$1 2> /dev/null); do
    1.53  		cd $ROOTFS
    1.54 @@ -163,8 +160,7 @@
    1.55  	cd $here
    1.56  }
    1.57  
    1.58 -cleanup()
    1.59 -{
    1.60 +cleanup() {
    1.61  	if [ -d $TMP_MNT ]; then
    1.62  		umount $TMP_MNT
    1.63  		rmdir $TMP_MNT
    1.64 @@ -426,8 +422,7 @@
    1.65  	mv $(basename $1).gz $ROOTCD/boot
    1.66  }
    1.67  
    1.68 -distro_sizes()
    1.69 -{
    1.70 +distro_sizes() {
    1.71  	if [ "$time" ]; then
    1.72  		time=$(($(date +%s) - $time))
    1.73  		sec=$time
    1.74 @@ -441,17 +436,15 @@
    1.75  Rootfs size     : $(du -csh $ROOTFS*/ | awk '{ s=$1 } END { print s }')
    1.76  Initramfs size  : $(du -csh $ROOTCD/boot/rootfs*.gz | awk '{ s=$1 } END { print s }')
    1.77  ISO image size  : $(du -sh $ISO_NAME.iso | awk '{ print $1 }')
    1.78 -================================================================================
    1.79 -Image is ready: $ISO_NAME.iso
    1.80 -
    1.81  EOT
    1.82 +	separator
    1.83 +	echo "Image is ready: $ISO_NAME.iso"
    1.84  }
    1.85  
    1.86  # Print ISO and rootfs size.
    1.87 -distro_stats()
    1.88 -{
    1.89 -	echo ""
    1.90 -	echo -e "\033[1mDistro statistics\033[0m ($DISTRO)"
    1.91 +distro_stats() {
    1.92 +	newline
    1.93 +	boldify "Distro statistics ($DISTRO)"
    1.94  	separator
    1.95  	distro_sizes
    1.96  }
     2.1 --- a/tazlito-wiz	Wed Jan 15 13:15:16 2014 +0000
     2.2 +++ b/tazlito-wiz	Sun Feb 16 14:37:24 2014 +0100
     2.3 @@ -8,7 +8,7 @@
     2.4  
     2.5  width="560"
     2.6  icon="/usr/share/pixmaps/slitaz-icon.png"
     2.7 -opts="--height=300 --width=$width --image=$icon  
     2.8 +opts="--height=300 --width=$width --image=$icon --center
     2.9  --image-on-top --window-icon=$icon --title=LiveWizard"
    2.10  rel=$(cat /etc/slitaz-release)
    2.11  [ "$rel" != "cooking" ] && rel=stable
    2.12 @@ -38,7 +38,7 @@
    2.13  #
    2.14  
    2.15  progress() {
    2.16 -	yad --progress --height="140" --width="$width" \
    2.17 +	yad --progress --height="140" --width="$width" --center \
    2.18  		--image=$icon --image-on-top --window-icon=$icon \
    2.19  		--text="<b>$text</b>" --title="SliTaz Live progress" --auto-close
    2.20  }
    2.21 @@ -162,7 +162,9 @@
    2.22  	# Deal with --button values
    2.23  	case $? in
    2.24  		1) exit 0 ;;
    2.25 -		*) echo -e "\n" | tazlito gen-distro 2>&1 | yad \
    2.26 +		*)
    2.27 +			export output=gtk
    2.28 +			echo -e "\n" | tazlito gen-distro 2>&1 | yad \
    2.29  			--text-info $opts --tail \
    2.30  			--text="<b>$(gettext "Building the Live system...")</b>" ;;
    2.31  	esac