[Debian-live-changes] r1909 - in dists/trunk/live-helper: docs functions helpers

daniel at alioth.debian.org daniel at alioth.debian.org
Fri Jun 1 14:36:35 UTC 2007


Author: daniel
Date: 2007-06-01 14:36:35 +0000 (Fri, 01 Jun 2007)
New Revision: 1909

Modified:
   dists/trunk/live-helper/docs/CREDITS
   dists/trunk/live-helper/docs/ChangeLog
   dists/trunk/live-helper/functions/cache.sh
   dists/trunk/live-helper/functions/defaults.sh
   dists/trunk/live-helper/functions/lockfile.sh
   dists/trunk/live-helper/functions/stagefile.sh
   dists/trunk/live-helper/helpers/lh_binary_grub
   dists/trunk/live-helper/helpers/lh_binary_hdd
   dists/trunk/live-helper/helpers/lh_binary_linux-image
   dists/trunk/live-helper/helpers/lh_binary_memtest
   dists/trunk/live-helper/helpers/lh_binary_rootfs
   dists/trunk/live-helper/helpers/lh_binary_syslinux
   dists/trunk/live-helper/helpers/lh_binary_yaboot
   dists/trunk/live-helper/helpers/lh_bootstrap_cdebootstrap
   dists/trunk/live-helper/helpers/lh_bootstrap_debootstrap
   dists/trunk/live-helper/helpers/lh_chroot_apt
   dists/trunk/live-helper/helpers/lh_chroot_proc
   dists/trunk/live-helper/helpers/lh_chroot_sources
   dists/trunk/live-helper/helpers/lh_chroot_sysfs
   dists/trunk/live-helper/helpers/make-live
Log:


Modified: dists/trunk/live-helper/docs/CREDITS
===================================================================
--- dists/trunk/live-helper/docs/CREDITS	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/docs/CREDITS	2007-06-01 14:36:35 UTC (rev 1909)
@@ -17,6 +17,7 @@
   * Richard Nelson <rjent at rjent.pair.com>
   * Scott Edwards <debian at foss.daxal.com>
   * Sebastian Raveau <sebastien.raveau at epita.fr>
+  * Trent Buck <trentbuck at gmail.com>
 
 Donations (alphaetical order):
 

Modified: dists/trunk/live-helper/docs/ChangeLog
===================================================================
--- dists/trunk/live-helper/docs/ChangeLog	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/docs/ChangeLog	2007-06-01 14:36:35 UTC (rev 1909)
@@ -3,6 +3,8 @@
 	* helpers/*:
 	  - Added initial P: messages.
 	  - Removed some bashisms.
+	  - Added some of the proposed cleanups from Trent Buck
+	    <trentbuck at gmail.com>.
 	* lists/mini, minimal:
 	  - Removed, already pulled in with live-initramfs depends.
 

Modified: dists/trunk/live-helper/functions/cache.sh
===================================================================
--- dists/trunk/live-helper/functions/cache.sh	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/functions/cache.sh	2007-06-01 14:36:35 UTC (rev 1909)
@@ -35,10 +35,7 @@
 		if ls chroot/var/cache/apt/archives/*.deb > /dev/null 2>&1
 		then
 			# Creating cache directory
-			if [ ! -d "${DIRECTORY}" ]
-			then
-				mkdir -p "${DIRECTORY}"
-			fi
+			mkdir -p "${DIRECTORY}"
 
 			# Saving new cache
 			mv -f chroot/var/cache/apt/archives/*.deb "${DIRECTORY}"

Modified: dists/trunk/live-helper/functions/defaults.sh
===================================================================
--- dists/trunk/live-helper/functions/defaults.sh	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/functions/defaults.sh	2007-06-01 14:36:35 UTC (rev 1909)
@@ -16,7 +16,7 @@
 	# Setting mode
 	if [ -z "${LH_MODE}" ]
 	then
-		if [ -f /usr/bin/lsb_release ]
+		if [ -x /usr/bin/lsb_release ]
 		then
 			case "`lsb_release --short --id`" in
 				Debian)
@@ -26,6 +26,12 @@
 				Ubuntu)
 					LH_MODE="ubuntu"
 					;;
+
+				*)
+					Echo_verbose "Unexpected output from lsb_release"
+					Echo_verbose "Setting mode to debian."
+					LH_MODE="debian"
+					;;
 			esac
 		else
 			LH_MODE="debian"
@@ -199,7 +205,7 @@
 	# If we are root, disable root command
 	if [ "`id -u`" = "0" ]
 	then
-		# FIXME: this is disabled until considered save
+		# FIXME: this is disabled until considered safe
 		LIVE_ROOT_COMMAND=""
 	fi
 

Modified: dists/trunk/live-helper/functions/lockfile.sh
===================================================================
--- dists/trunk/live-helper/functions/lockfile.sh	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/functions/lockfile.sh	2007-06-01 14:36:35 UTC (rev 1909)
@@ -27,10 +27,7 @@
 	DIRECTORY="`dirname ${1}`"
 
 	# Creating lock directory
-	if [ ! -d "${DIRECTORY}" ]
-	then
-		mkdir -p "${DIRECTORY}"
-	fi
+	mkdir -p "${DIRECTORY}"
 
 	# Creating lock trap
 	trap "test -f ${FILE} && rm -f ${FILE}; exit 0" 0 1 2 3 9 15

Modified: dists/trunk/live-helper/functions/stagefile.sh
===================================================================
--- dists/trunk/live-helper/functions/stagefile.sh	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/functions/stagefile.sh	2007-06-01 14:36:35 UTC (rev 1909)
@@ -36,10 +36,7 @@
 	DIRECTORY="`dirname ${1}`"
 
 	# Creating stage directory
-	if [ ! -d "${DIRECTORY}" ]
-	then
-		mkdir -p "${DIRECTORY}"
-	fi
+	mkdir -p "${DIRECTORY}"
 
 	# Creating stage file
 	touch "${FILE}"

Modified: dists/trunk/live-helper/helpers/lh_binary_grub
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_grub	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/helpers/lh_binary_grub	2007-06-01 14:36:35 UTC (rev 1909)
@@ -123,10 +123,7 @@
 fi
 
 # Creating directory
-if [ ! -d "${DESTDIR_LIVE}" ]
-then
-	mkdir -p "${DESTDIR_LIVE}"
-fi
+mkdir -p "${DESTDIR_LIVE}"
 
 # Setting boot parameters
 if [ -n "${LIVE_ENCRYPTION}" ]

Modified: dists/trunk/live-helper/helpers/lh_binary_hdd
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_hdd	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/helpers/lh_binary_hdd	2007-06-01 14:36:35 UTC (rev 1909)
@@ -50,10 +50,7 @@
 Create_lockfile .lock
 
 # Remove old binary
-if [ -f binary-hdd.tar.gz ]
-then
-	rm -f binary-hdd.tar.gz
-fi
+rm -f binary-hdd.tar.gz
 
 tar cfz binary-hdd.tar.gz binary
 

Modified: dists/trunk/live-helper/helpers/lh_binary_linux-image
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_linux-image	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/helpers/lh_binary_linux-image	2007-06-01 14:36:35 UTC (rev 1909)
@@ -96,10 +96,7 @@
 fi
 
 # Creating directory
-if [ ! -d "${DESTDIR}" ]
-then
-	mkdir -p "${DESTDIR}"
-fi
+mkdir -p "${DESTDIR}"
 
 # Installing linux-image
 cp chroot/boot/vmlinuz* "${DESTDIR}"

Modified: dists/trunk/live-helper/helpers/lh_binary_memtest
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_memtest	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/helpers/lh_binary_memtest	2007-06-01 14:36:35 UTC (rev 1909)
@@ -114,10 +114,7 @@
 fi
 
 # Creating directory
-if [ ! -d "${DESTDIR}" ]
-then
-	mkdir -p "${DESTDIR}"
-fi
+mkdir -p "${DESTDIR}"
 
 # Installing memtest
 case "${LIVE_MEMTEST}" in

Modified: dists/trunk/live-helper/helpers/lh_binary_rootfs
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_rootfs	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/helpers/lh_binary_rootfs	2007-06-01 14:36:35 UTC (rev 1909)
@@ -56,10 +56,7 @@
 esac
 
 # Creating directory
-if [ ! -d binary/${INITFS} ]
-then
-	mkdir -p binary/${INITFS}
-fi
+mkdir -p binary/${INITFS}
 
 case "${LIVE_CHROOT_FILESYSTEM}" in
 	ext2)

Modified: dists/trunk/live-helper/helpers/lh_binary_syslinux
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_syslinux	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/helpers/lh_binary_syslinux	2007-06-01 14:36:35 UTC (rev 1909)
@@ -135,10 +135,7 @@
 fi
 
 # Creating directory
-if [ ! -d "${DESTDIR_LIVE}" ]
-then
-	mkdir -p "${DESTDIR_LIVE}"
-fi
+mkdir -p "${DESTDIR_LIVE}"
 
 # Setting boot parameters
 if [ -n "${LIVE_ENCRYPTION}" ]

Modified: dists/trunk/live-helper/helpers/lh_binary_yaboot
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_yaboot	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/helpers/lh_binary_yaboot	2007-06-01 14:36:35 UTC (rev 1909)
@@ -111,10 +111,7 @@
 fi
 
 # Creating directory
-if [ ! -d "${DESTDIR}" ]
-then
-	mkdir -p "${DESTDIR}"
-fi
+mkdir -p "${DESTDIR}"
 
 # Setting boot parameters
 if [ -n "${LIVE_ENCRYPTION}" ]

Modified: dists/trunk/live-helper/helpers/lh_bootstrap_cdebootstrap
===================================================================
--- dists/trunk/live-helper/helpers/lh_bootstrap_cdebootstrap	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/helpers/lh_bootstrap_cdebootstrap	2007-06-01 14:36:35 UTC (rev 1909)
@@ -50,10 +50,7 @@
 Create_lockfile .lock
 
 # Creating chroot directory
-if [ ! -d chroot ]
-then
-	mkdir -p chroot
-fi
+mkdir -p chroot
 
 # Setting cdebootstrap options
 if [ -n "${LIVE_ARCHITECTURE}" ]
@@ -132,10 +129,7 @@
 		fi
 
 		# Saving new cache
-		if [ ! -d cache/packages_bootstrap ]
-		then
-			mkdir -p cache/packages_bootstrap
-		fi
+		mkdir -p cache/packages_bootstrap
 
 		cp chroot/var/cache/bootstrap/*.deb cache/packages_bootstrap
 	fi
@@ -172,10 +166,7 @@
 				rm -rf cache/stages_bootstrap
 			fi
 
-			if [ ! -d cache ]
-			then
-				mkdir cache
-			fi
+			mkdir cache
 
 			${LH_ROOT_COMMAND} cp -a chroot cache/stages_bootstrap
 

Modified: dists/trunk/live-helper/helpers/lh_bootstrap_debootstrap
===================================================================
--- dists/trunk/live-helper/helpers/lh_bootstrap_debootstrap	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/helpers/lh_bootstrap_debootstrap	2007-06-01 14:36:35 UTC (rev 1909)
@@ -50,10 +50,7 @@
 Create_lockfile .lock
 
 # Creating chroot directory
-if [ ! -d chroot ]
-then
-	mkdir -p chroot
-fi
+mkdir -p chroot
 
 # Setting debootstrap options
 if [ -n "${LIVE_ARCHITECTURE}" ]
@@ -115,10 +112,7 @@
 		fi
 
 		# Saving new cache
-		if [ ! -d cache/packages_bootstrap ]
-		then
-			mkdir -p cache/packages_bootstrap
-		fi
+		mkdir -p cache/packages_bootstrap
 
 		cp chroot/var/cache/apt/archives/*.deb cache/packages_bootstrap
 	fi
@@ -144,10 +138,7 @@
 				rm -rf cache/stages_bootstrap
 			fi
 
-			if [ ! -d cache ]
-			then
-				mkdir cache
-			fi
+			mkdir cache
 
 			${LH_ROOT_COMMAND} cp -a chroot cache/stages_bootstrap
 

Modified: dists/trunk/live-helper/helpers/lh_chroot_apt
===================================================================
--- dists/trunk/live-helper/helpers/lh_chroot_apt	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/helpers/lh_chroot_apt	2007-06-01 14:36:35 UTC (rev 1909)
@@ -46,10 +46,7 @@
 		# Creating lock file
 		Create_lockfile .lock
 
-		if [ ! -d chroot/etc/apt/apt.conf.d ]
-		then
-			mkdir -p chroot/etc/apt/apt.conf.d
-		fi
+		mkdir -p chroot/etc/apt/apt.conf.d
 
 		# Configuring apt ftp proxy
 		if [ -n "${LH_APT_FTPPROXY}" ]

Modified: dists/trunk/live-helper/helpers/lh_chroot_proc
===================================================================
--- dists/trunk/live-helper/helpers/lh_chroot_proc	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/helpers/lh_chroot_proc	2007-06-01 14:36:35 UTC (rev 1909)
@@ -49,11 +49,8 @@
 		# Creating lock file
 		Create_lockfile .lock
 
-		if [ ! -d chroot/proc ]
-		then
-			# Creating mountpoint
-			mkdir -p chroot/proc
-		fi
+		# Creating mountpoint
+		mkdir -p chroot/proc
 
 		# Mounting /proc
 		${LH_ROOT_COMMAND} mount proc-live -t proc chroot/proc

Modified: dists/trunk/live-helper/helpers/lh_chroot_sources
===================================================================
--- dists/trunk/live-helper/helpers/lh_chroot_sources	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/helpers/lh_chroot_sources	2007-06-01 14:36:35 UTC (rev 1909)
@@ -181,10 +181,7 @@
 
 			if [ "${LH_CACHE_INDICES}" = "enabled" ]
 			then
-				if [ ! -d cache/indices_bootstrap ]
-				then
-					mkdir -p cache/indices_bootstrap
-				fi
+				mkdir -p cache/indices_bootstrap
 
 				cp -f chroot/etc/apt/secring.gpg* cache/indices_bootstrap
 				cp -f chroot/etc/apt/trusted.gpg* cache/indices_bootstrap

Modified: dists/trunk/live-helper/helpers/lh_chroot_sysfs
===================================================================
--- dists/trunk/live-helper/helpers/lh_chroot_sysfs	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/helpers/lh_chroot_sysfs	2007-06-01 14:36:35 UTC (rev 1909)
@@ -49,11 +49,8 @@
 		# Creating lock file
 		Create_lockfile .lock
 
-		if [ ! -d chroot/sys ]
-		then
-			# Create mountpoint
-			mkdir -p chroot/sys
-		fi
+		# Create mountpoint
+		mkdir -p chroot/sys
 
 		# Mounting /sys
 		${LH_ROOT_COMMAND} mount sysfs-live -t sysfs chroot/sys

Modified: dists/trunk/live-helper/helpers/make-live
===================================================================
--- dists/trunk/live-helper/helpers/make-live	2007-06-01 14:36:28 UTC (rev 1908)
+++ dists/trunk/live-helper/helpers/make-live	2007-06-01 14:36:35 UTC (rev 1909)
@@ -39,7 +39,7 @@
 {
 	ARGUMENTS="`getopt --longoptions mode:,config:,apt:,apt-ftpproxy:,apt-httpproxy:,binary-indices:,apt-pdiffs:,apt-recommends:,apt-secure:,bootstrap:,cache:,debconf-frontend:,debconf-priority:,debconf-nowarnings:,genisoimage:,losetup:,tasksel:,root:,architecture:,distribution:,distribution-config:,flavour:,mirror-bootstrap:,mirror-bootstrap-security:,mirror-binary:,mirror-binary-security:,sections:,interactive:,kernel:,kernel-packages:,keyring-packages:,hooks:,language:,packages:,packages-lists:,tasks:,security:,symlinks:,sysvinit:,bootappend:,encryption:,username:,hostname:,chroot-filesystem:,memtest:,iso-application:,iso-preparer:,iso-publisher:,iso-volume:,server-address:,server-path:,source:,bootloader:,grub-splash:,syslinux-splash:,binary-images:,binary-source:,includes:,templates:,help,usage,version,force,breakpoints,debug,quiet,verbose,root-command:,initramfs: --name=${PROGRAM} --options r:a:d:f:m:k:l:p:e:b:s:huv --shell sh -- "${@}"`"
 
-	if [ "${?}" != "0" ]
+	if [ "${?}" -ne "0" ]
 	then
 		echo "Terminating." >&2
 		exit 1




More information about the Debian-live-changes mailing list