slitaz-tools diff tinyutils/frugal @ rev 945

Add Name[fr] in .desktop
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Jul 12 17:58:23 2015 +0200 (2015-07-12)
parents 5d80f6fdbdb7
children
line diff
     1.1 --- a/tinyutils/frugal	Fri Apr 17 07:35:02 2015 +0300
     1.2 +++ b/tinyutils/frugal	Sun Jul 12 17:58:23 2015 +0200
     1.3 @@ -20,9 +20,7 @@
     1.4  
     1.5  # Internationalization
     1.6  
     1.7 -. /usr/bin/gettext.sh
     1.8 -TEXTDOMAIN='slitaz-tools'
     1.9 -export TEXTDOMAIN
    1.10 +export TEXTDOMAIN='slitaz-tools'
    1.11  
    1.12  
    1.13  #
    1.14 @@ -36,20 +34,20 @@
    1.15  	name=$(basename $0)
    1.16  	cat << EOT
    1.17  
    1.18 -$(boldify $(gettext "Usage:")) $name [iso|command] [--options]
    1.19 +$(boldify $(_n 'Usage:')) $name [iso|command] [--options]
    1.20  
    1.21 -$(gettext "SliTaz frugal installation")
    1.22 +$(_n 'SliTaz frugal installation')
    1.23  
    1.24 -$(boldify $(gettext "Commands:"))
    1.25 -  info        $(gettext "Display install path and size stats")
    1.26 -  clean       $(gettext "Remove all frugal files")
    1.27 -  grub-ex     $(gettext "Show GRUB configuration example")
    1.28 +$(boldify $(_n 'Commands:'))
    1.29 +  info        $(_n 'Display install path and size stats')
    1.30 +  clean       $(_n 'Remove all frugal files')
    1.31 +  grub-ex     $(_n 'Show GRUB configuration example')
    1.32  
    1.33 -$(boldify $(gettext "Options:"))
    1.34 -  --root=     $(gettext "Set root installation path")
    1.35 -  --debug     $(gettext "Display some useful debug information")
    1.36 +$(boldify $(_n 'Options:'))
    1.37 +  --root=     $(_n 'Set root installation path')
    1.38 +  --debug     $(_n 'Display some useful debug information')
    1.39  
    1.40 -$(boldify $(gettext "Examples:"))
    1.41 +$(boldify $(_n 'Examples:'))
    1.42    $name slitaz-rolling.iso
    1.43    $name slitaz-5.0.iso --root=/boot/frugal
    1.44  
    1.45 @@ -60,7 +58,7 @@
    1.46  # GRUB config example.
    1.47  
    1.48  grub_example() {
    1.49 -	cat << EOT
    1.50 +	cat <<EOT
    1.51  title SliTaz GNU/Linux (frugal)
    1.52  root (hd0,0)
    1.53  kernel /boot/frugal/bzImage root=/dev/null lang=en kmap=us
    1.54 @@ -76,60 +74,56 @@
    1.55  case "$1" in
    1.56  	"") usage ;;
    1.57  	info)
    1.58 -		newline
    1.59 -		boldify "Frugal info"
    1.60 -		separator 
    1.61 +		title 'Frugal info'
    1.62  
    1.63  		# First check if we are running in frugal mode
    1.64  		if fgrep -q 'root=/dev/null' /proc/cmdline; then
    1.65 -			gettext "Frugal system running detected"; newline
    1.66 -			separator && newline && exit 0
    1.67 +			_ 'Frugal system running detected'
    1.68 +			footer; exit 0
    1.69  		fi
    1.70 -		gettext "Installation directory:"; indent 30 $(colorize 36 "$root")
    1.71 -		gettext "Kernel size:"
    1.72 +		_n 'Installation directory:'; indent 30 $(colorize 36 "$root")
    1.73 +		_n 'Kernel size:'
    1.74  		if [ -f "${root}/bzImage" ]; then
    1.75  			indent 30 $(du -sh ${root}/bzImage | awk '{print $1}')
    1.76  		else
    1.77 -			indent 30 $(boldify "N/A")
    1.78 +			indent 30 $(boldify 'N/A')
    1.79  		fi
    1.80 -		gettext "Rootfs size:"
    1.81 +		_n 'Rootfs size:'
    1.82  		if [ -f "${root}/rootfs.gz" ]; then
    1.83  			indent 30 $(du -sh ${root}/rootfs.gz | awk '{print $1}')
    1.84  		else
    1.85 -			indent 30 $(boldify "N/A")
    1.86 +			indent 30 $(boldify 'N/A')
    1.87  		fi
    1.88 -		separator && newline ;;
    1.89 +		footer ;;
    1.90  	clean)
    1.91  		check_root
    1.92 -		gettext "Cleaning:"; echo " $root"
    1.93 +		_n 'Cleaning:'; echo " $root"
    1.94  		rm -rf ${root}/* ;;
    1.95  	grub-ex)
    1.96 -		newline
    1.97 -		boldify "GRUB config example"
    1.98 -		separator
    1.99 +		title 'GRUB config example'
   1.100  		grub_example
   1.101 -		separator && newline ;;
   1.102 +		footer ;;
   1.103  	*)
   1.104  		iso="$1"
   1.105  		loop="/tmp/frugal-$$"
   1.106  		check_root
   1.107 -		newline
   1.108 -		boldify "SliTaz Frugal"
   1.109 -		separator
   1.110 +		title 'SliTaz Frugal'
   1.111  		if [ ! -f "$iso" ]; then
   1.112 -			gettext "Unable to find ISO image:"; colorize 31 " $iso"
   1.113 -			newline && return 1
   1.114 +			_n 'Unable to find ISO image:'; colorize 31 " $iso"
   1.115 +			newline; return 1
   1.116  		fi
   1.117  		mkdir -p ${root}
   1.118  		debug "$iso $root"
   1.119 -		gettext "Mounting ISO image..."
   1.120 +		_n 'Mounting ISO image...'
   1.121  		mkdir -p ${loop}
   1.122  		mount -o loop "$iso" ${loop} 2>/dev/null
   1.123  		status
   1.124 -		gettext "Installing the Kernel..."
   1.125 +
   1.126 +		_n 'Installing the Kernel...'
   1.127  		cp -a ${loop}/boot/bzImage ${root}
   1.128  		status
   1.129 -		gettext "Installing the root filesystem..."
   1.130 +
   1.131 +		_n 'Installing the root filesystem...'
   1.132  		if [ -f ${loop}/boot/rootfs1.gz ]; then
   1.133  			cd ${loop}/boot
   1.134  			cat $(ls -r rootfs*.gz) > ${root}/rootfs.gz
   1.135 @@ -140,11 +134,12 @@
   1.136  		status
   1.137  
   1.138  		# Umount the loop device
   1.139 -		gettext "Unmounting ISO image..."
   1.140 +		_n 'Unmounting ISO image...'
   1.141  		sleep 1
   1.142  		umount ${loop} && rm -rf ${loop}
   1.143  		status
   1.144 -		separator && newline ;;
   1.145 +
   1.146 +		footer ;;
   1.147  esac
   1.148  
   1.149  exit 0