[Debian-live-changes] r1135 - in dists/trunk/live-helper: debian doc functions helpers

Daniel Baumann daniel at alioth.debian.org
Mon Apr 23 11:29:29 UTC 2007


Author: daniel
Date: 2007-04-23 11:29:29 +0000 (Mon, 23 Apr 2007)
New Revision: 1135

Added:
   dists/trunk/live-helper/functions/package.sh
Modified:
   dists/trunk/live-helper/debian/changelog
   dists/trunk/live-helper/doc/ChangeLog
   dists/trunk/live-helper/functions/arguments.sh
   dists/trunk/live-helper/functions/breakpoints.sh
   dists/trunk/live-helper/functions/echo.sh
   dists/trunk/live-helper/functions/exit.sh
   dists/trunk/live-helper/functions/stagefile.sh
   dists/trunk/live-helper/helpers/lh_binary_chroot
   dists/trunk/live-helper/helpers/lh_binary_encryption
   dists/trunk/live-helper/helpers/lh_binary_grub
   dists/trunk/live-helper/helpers/lh_binary_iso
   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_usb
   dists/trunk/live-helper/helpers/lh_binary_yaboot
   dists/trunk/live-helper/helpers/lh_chroot_localization
   dists/trunk/live-helper/helpers/lh_chroot_symlinks
   dists/trunk/live-helper/helpers/lh_chroot_tasks
   dists/trunk/live-helper/helpers/lh_source_usb
   dists/trunk/live-helper/helpers/make-live
Log:


Modified: dists/trunk/live-helper/debian/changelog
===================================================================
--- dists/trunk/live-helper/debian/changelog	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/debian/changelog	2007-04-23 11:29:29 UTC (rev 1135)
@@ -1,6 +1,7 @@
 live-helper (1.0~a7-1) unstable; urgency=medium
 
-  * New upstream release.
+  * New upstream release:
+    - make-live unmounts proc and sys on exit and failures (Closes: #).
 
  -- Daniel Baumann <daniel at debian.org>  Mon, 23 Apr 2007 00:00:00 +0200
 

Modified: dists/trunk/live-helper/doc/ChangeLog
===================================================================
--- dists/trunk/live-helper/doc/ChangeLog	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/doc/ChangeLog	2007-04-23 11:29:29 UTC (rev 1135)
@@ -1,3 +1,11 @@
+2007-04-23  Daniel Baumann  <daniel at debian.org>
+
+	* functions/package.sh:
+	  - Added. Helper dependencies in-chroot can now be handled by
+	    functions.
+	* helpers/make-live:
+	  - Added trap to unmount proc and sys on exit and failure.
+
 2007-04-22  Daniel Baumann  <daniel at debian.org>
 
 	* functions/defaults.sh:

Modified: dists/trunk/live-helper/functions/arguments.sh
===================================================================
--- dists/trunk/live-helper/functions/arguments.sh	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/functions/arguments.sh	2007-04-23 11:29:29 UTC (rev 1135)
@@ -11,7 +11,7 @@
 
 Arguments ()
 {
-	ARGUMENTS="`getopt --longoptions breakpoints,conffile:,debug,force,help,logfile:,quiet,usage,verbose,version --name=${PROGRAM} --options huv --shell sh -- "${@}"`"
+	ARGUMENTS="`getopt --longoptions breakpoints,conffile:,debug,force,help,logfile:,trace,quiet,usage,verbose,version --name=${PROGRAM} --options huv --shell sh -- "${@}"`"
 
 	if [ "${?}" != "0" ]
 	then
@@ -48,6 +48,10 @@
 				LH_LOGFILE="${2}"; shift 2
 				;;
 
+			--trace)
+				LH_TRACE="enabled"; shift
+				;;
+
 			--quiet)
 				LH_QUIET="enabled"; shift
 				;;

Modified: dists/trunk/live-helper/functions/breakpoints.sh
===================================================================
--- dists/trunk/live-helper/functions/breakpoints.sh	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/functions/breakpoints.sh	2007-04-23 11:29:29 UTC (rev 1135)
@@ -9,11 +9,11 @@
 
 Breakpoint ()
 {
+	NAME="${1}"
+
 	if [ "${LH_BREAKPOINTS}" = "enabled" ]
 	then
-		BREAKPOINT="${1}"
-
-		Echo_message "Waiting at ${BREAKPOINT}"
+		Echo_message "Waiting at ${NAME}"
 		read
 	fi
 }

Modified: dists/trunk/live-helper/functions/echo.sh
===================================================================
--- dists/trunk/live-helper/functions/echo.sh	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/functions/echo.sh	2007-04-23 11:29:29 UTC (rev 1135)
@@ -11,34 +11,44 @@
 
 Echo_debug ()
 {
+	STRING="${1}"
+
 	if [ "${LH_DEBUG}" = "enabled" ]
 	then
-		echo "D: ${@}"
+		echo "D: ${STRING}"
 	fi
 }
 
 Echo_error ()
 {
-	echo "E: ${@}"
+	STRING="${1}"
+
+	echo "E: ${STRING}"
 }
 
 Echo_message ()
 {
+	STRING="${1}"
+
 	if [ "${LH_QUIET}" != "enabled" ]
 	then
-		echo "P: ${@}"
+		echo "P: ${STRING}"
 	fi
 }
 
 Echo_verbose ()
 {
+	STRING="${1}"
+
 	if [ "${LH_VERBOSE}" = "enabled" ]
 	then
-		echo "I: ${@}"
+		echo "I: ${STRING}"
 	fi
 }
 
 Echo_warning ()
 {
-	echo "W: ${@}"
+	STRING="${1}"
+
+	echo "W: ${STRING}"
 }

Modified: dists/trunk/live-helper/functions/exit.sh
===================================================================
--- dists/trunk/live-helper/functions/exit.sh	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/functions/exit.sh	2007-04-23 11:29:29 UTC (rev 1135)
@@ -13,6 +13,7 @@
 {
 	if [ "${LH_DEBUG}" = "enabled" ]
 	then
+		# Dump variables
 		set | grep -e ^LH -e ^LIVE
 	fi
 

Added: dists/trunk/live-helper/functions/package.sh
===================================================================
--- dists/trunk/live-helper/functions/package.sh	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/functions/package.sh	2007-04-23 11:29:29 UTC (rev 1135)
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# packages.sh - handle packages installation
+# Copyright (C) 2006-2007 Daniel Baumann <daniel at debian.org>
+#
+# live-helper comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+# This is free software, and you are welcome to redistribute it
+# under certain conditions; see COPYING for details.
+
+set -e
+
+Check_package ()
+{
+	FILE="${1}"
+	PACKAGE="${2}"
+
+	if [ ! -f "${FILE}" ]
+	then
+		PACKAGES="${PACKAGES} ${PACKAGE}"
+	fi
+}
+
+Install_package ()
+{
+	if [ -n "${PACKAGES}" ]
+	then
+		case "${LH_APT}" in
+			apt|apt-get)
+				Chroot "apt-get install --yes ${PACKAGES}"
+				;;
+
+			aptitude)
+				Chroot "aptitude install --assume-yes ${PACKAGES}"
+				;;
+		esac
+	fi
+}
+
+Remove_package ()
+{
+	if [ -n "${PACKAGES}" ]
+	then
+		case "${LH_APT}" in
+			apt|apt-get)
+				Chroot "apt-get remove --purge --yes ${PACKAGES}"
+				;;
+
+			aptitude)
+				Chroot "aptitude purge --assume-yes ${PACKAGES}"
+				;;
+		esac
+	fi
+}


Property changes on: dists/trunk/live-helper/functions/package.sh
___________________________________________________________________
Name: svn:executable
   + *

Modified: dists/trunk/live-helper/functions/stagefile.sh
===================================================================
--- dists/trunk/live-helper/functions/stagefile.sh	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/functions/stagefile.sh	2007-04-23 11:29:29 UTC (rev 1135)
@@ -17,14 +17,15 @@
 	# Checking stage file
 	if [ -f "${FILE}" ]
 	then
-		if [ "${LH_FORCE}" = "enabled" ]
+		if [ "${LH_FORCE}" != "enabled" ]
 		then
-			# Forcing execution
-			rm -f "${FILE}"
-		else
 			# Skipping execution
 			Echo_warning "skipping ${NAME}"
 			exit 0
+		else
+			# Forcing execution
+			Echo_message "forcing ${NAME}"
+			rm -f "${FILE}"
 		fi
 	fi
 }

Modified: dists/trunk/live-helper/helpers/lh_binary_chroot
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_chroot	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/helpers/lh_binary_chroot	2007-04-23 11:29:29 UTC (rev 1135)
@@ -45,7 +45,7 @@
 # Creating lock file
 Create_lockfile .lock
 
-# Normally, proc is not mounted here, but people tend to be lazy
+# Normally, virtual filesystems are not mounted here, but people tend to be lazy
 if [ -f chroot/proc/version ]
 then
 	umount chroot/proc

Modified: dists/trunk/live-helper/helpers/lh_binary_encryption
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_encryption	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/helpers/lh_binary_encryption	2007-04-23 11:29:29 UTC (rev 1135)
@@ -66,25 +66,12 @@
 		;;
 esac
 
-if [ ! -f chroot/usr/bin/aespipe ]
-then
-	PACKAGES="${PACKAGES} aespipe"
-fi
+# Checking depends
+Check_package chroot/usr/bin/aespipe aespipe
 
-if [ -n "${PACKAGES}" ]
-then
-	# Installing packages
-	case "${LH_APT}" in
-		apt|apt-get)
-			Chroot "apt-get install --yes ${PACKAGES}"
-			;;
+# Installing depends
+Install_package
 
-		aptitude)
-			Chroot "aptitude install --assume-yes ${PACKAGES}"
-			;;
-	esac
-fi
-
 # Moving image
 mv binary/casper/filesystem.${LIVE_FILESYSTEM} chroot
 
@@ -113,18 +100,8 @@
 mv chroot/filesystem.${LIVE_FILESYSTEM} binary/casper
 rm -f chroot/encrypt
 
-# Removing packages
-if [ -n "${PACKAGES}" ]
-then
-	case "${LH_APT}" in
-		apt|apt-get)
-			Chroot "apt-get remove --purge --yes ${PACKAGES}"
-			;;
-			aptitude)
-			Chroot "aptitude purge --assume-yes ${PACKAGES}"
-			;;
-	esac
-fi
+# Removing depends
+Remove_package
 
 # Creating stage file
 Create_stagefile .stage/binary_encryption

Modified: dists/trunk/live-helper/helpers/lh_binary_grub
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_grub	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/helpers/lh_binary_grub	2007-04-23 11:29:29 UTC (rev 1135)
@@ -68,25 +68,12 @@
 	fi
 fi
 
-if [ ! -f chroot/usr/sbin/grub ]
-then
-	PACKAGES="${PACKAGES} grub"
-fi
+# Checking depends
+Check_package chroot/usr/sbin/grub grub
 
-if [ -n "${PACKAGES}" ]
-then
-	# Installing symlinks
-	case "${LH_APT}" in
-		apt|apt-get)
-			Chroot "apt-get install --yes ${PACKAGES}"
-		;;
+# Installing depends
+Install_package
 
-		aptitude)
-			Chroot "aptitude install --assume-yes ${PACKAGES}"
-			;;
-	esac
-fi
-
 # Setting destination directory
 case "${LIVE_BINARY_IMAGE}" in
 	iso|usb|hdd)
@@ -218,19 +205,8 @@
 sed -i -e "s#LIVE_KERNEL_LIVE#${LINUX}#" -e "s#LIVE_KERNEL_INSTALL#${LIVE_KERNEL_INSTALL}#" -e "s#LIVE_MEMTEST#${MEMTEST}#" binary/boot/grub/menu.lst
 sed -i -e "s#LIVE_BOOTAPPEND#${LIVE_BOOTAPPEND}#" binary/boot/grub/menu.lst
 
-if [ -n "${PACKAGES}" ]
-then
-	# Removing packages
-	case "${LH_APT}" in
-		apt|apt-get)
-		Chroot "apt-get remove --purge --yes ${PACKAGES}"
-			;;
+# Removing depends
+Remove_package
 
-		aptitude)
-			Chroot "aptitude purge --assume-yes ${PACKAGES}"
-			;;
-esac
-fi
-
 # Creating stage file
 Create_stagefile .stage/binary_grub

Modified: dists/trunk/live-helper/helpers/lh_binary_iso
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_iso	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/helpers/lh_binary_iso	2007-04-23 11:29:29 UTC (rev 1135)
@@ -49,25 +49,12 @@
 		# Creating lock file
 		Create_lockfile .lock
 
-		if [ ! -f chroot/usr/bin/"${LH_GENISOIMAGE}" ]
-		then
-			PACKAGES="${PACKAGES} ${LH_GENISOIMAGE}"
-		fi
+		# Checking depends
+		Check_package chroot/usr/bin/"${LH_GENISOIMAGE}" ${LH_GENISOIMAGE}
 
-		if [ -n "${PACKAGES}" ]
-		then
-			# Installing packages
-			case "${LH_APT}" in
-				apt|apt-get)
-					Chroot "apt-get install --yes ${PACKAGES}"
-					;;
+		# Installing depends
+		Install_package
 
-				aptitude)
-					Chroot "aptitude install --assume-yes ${PACKAGES}"
-					;;
-			esac
-		fi
-
 		# Remove old iso image
 		if [ -f binary.iso ]
 		then
@@ -105,20 +92,9 @@
 		# Move image
 		mv chroot/binary chroot/binary.iso ./
 
-		# Removing packages
-		if [ -n "${PACKAGES}" ]
-		then
-			case "${LH_APT}" in
-				apt|apt-get)
-					Chroot "apt-get remove --purge --yes ${PACKAGES}"
-					;;
+		# Removing depends
+		Remove_package
 
-				aptitude)
-					Chroot "aptitude purge --assume-yes ${PACKAGES}"
-					;;
-			esac
-		fi
-
 		# Creating stage file
 		Create_stagefile .stage/binary_iso
 	fi

Modified: dists/trunk/live-helper/helpers/lh_binary_memtest
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_memtest	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/helpers/lh_binary_memtest	2007-04-23 11:29:29 UTC (rev 1135)
@@ -56,36 +56,20 @@
 	exit 0
 fi
 
+# Checking depends
 case "${LIVE_MEMTEST}" in
 	memtest86)
-		if [ ! -f chroot/boot/memtest86.bin ]
-		then
-			PACKAGES="${PACKAGES} memtest86"
-		fi
+		Check_package chroot/boot/memtest86.bin memtest86
 		;;
 
 	memtest86+)
-		if [ ! -f chroot/boot/memtest86+.bin ]
-		then
-			PACKAGES="${PACKAGES} memtest86+"
-		fi
+		Check_package chroot/boot/memtest86+.bin memtest86+
 		;;
 esac
 
-if [ -n "${PACKAGES}" ]
-then
-	# Installing symlinks
-	case "${LH_APT}" in
-		apt|apt-get)
-			Chroot "apt-get install --yes ${PACKAGES}"
-			;;
+# Installing depends
+Install_package
 
-		aptitude)
-			Chroot "aptitude install --assume-yes ${PACKAGES}"
-			;;
-	esac
-fi
-
 # Setting destination directory
 case "${LIVE_BINARY_IMAGE}" in
 	iso)
@@ -132,19 +116,8 @@
 		;;
 esac
 
-if [ -n "${PACKAGES}" ]
-then
-	# Removing packages
-	case "${LH_APT}" in
-		apt|apt-get)
-			Chroot "apt-get remove --purge --yes ${PACKAGES}"
-			;;
+# Removing depends
+Remove_package
 
-		aptitude)
-			Chroot "aptitude purge --assume-yes ${PACKAGES}"
-			;;
-	esac
-fi
-
 # Creating stage file
 Create_stagefile .stage/binary_memtest

Modified: dists/trunk/live-helper/helpers/lh_binary_rootfs
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_rootfs	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/helpers/lh_binary_rootfs	2007-04-23 11:29:29 UTC (rev 1135)
@@ -54,25 +54,12 @@
 
 case "${LIVE_FILESYSTEM}" in
 	ext2)
-		if [ ! -f chroot/usr/bin/genext2fs ]
-		then
-			PACKAGES="${PACKAGES} genext2fs"
-		fi
+		# Checking depends
+		Check_package chroot/usr/bin/genext2fs genext2fs
 
-		if [ -n "${PACKAGES}" ]
-		then
-			# Installing packages
-			case "${LH_APT}" in
-				apt|apt-get)
-					Chroot "apt-get install --yes ${PACKAGES}"
-					;;
+		# Installing depends
+		Install_package
 
-				aptitude)
-					Chroot "aptitude install --assume-yes ${PACKAGES}"
-					;;
-			esac
-		fi
-
 		# Remove old ext2 image
 		if [ -f binary/casper/filesystem.ext2 ]
 		then
@@ -88,19 +75,8 @@
 		mv chroot/filesystem.ext2 binary/casper
 		rm -rf chroot/chroot
 
-		# Removing packages
-		if [ -n "${PACKAGES}" ]
-		then
-			case "${LH_APT}" in
-				apt|apt-get)
-					Chroot "apt-get remove --purge --yes ${PACKAGES}"
-					;;
-
-				aptitude)
-					Chroot "aptitude purge --assume-yes ${PACKAGES}"
-					;;
-			esac
-		fi
+		# Removing depends
+		Remove_package
 		;;
 
 	plain)
@@ -113,25 +89,12 @@
 		;;
 
 	squashfs)
-		if [ ! -f chroot/usr/sbin/mksquashfs ]
-		then
-			PACKAGES="${PACKAGES} squashfs-tools"
-		fi
+		# Checking depends
+		Check_package chroot/usr/sbin/mksquashfs squashfs-tools
 
-		if [ -n "${PACKAGES}" ]
-		then
-			# Installing packages
-			case "${LH_APT}" in
-				apt|apt-get)
-					Chroot "apt-get install --yes ${PACKAGES}"
-					;;
+		# Installing depends
+		Install_package
 
-				aptitude)
-					Chroot "aptitude install --assume-yes ${PACKAGES}"
-					;;
-			esac
-		fi
-
 		# Remove old squashfs image
 		if [ -f binary/casper/filesystem.squashfs ]
 		then
@@ -160,19 +123,8 @@
 		mv chroot/filesystem.squashfs binary/casper
 		rm -rf chroot/chroot
 
-		# Removing packages
-		if [ -n "${PACKAGES}" ]
-		then
-			case "${LH_APT}" in
-				apt|apt-get)
-					Chroot "apt-get remove --purge --yes ${PACKAGES}"
-					;;
-
-				aptitude)
-					Chroot "aptitude purge --assume-yes ${PACKAGES}"
-					;;
-			esac
-		fi
+		# Removing depends
+		Remove_package
 		;;
 esac
 

Modified: dists/trunk/live-helper/helpers/lh_binary_syslinux
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_syslinux	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/helpers/lh_binary_syslinux	2007-04-23 11:29:29 UTC (rev 1135)
@@ -56,7 +56,7 @@
 	exit 0
 fi
 
-# Check templates
+# Checking templates
 if [ ! -d "${LIVE_TEMPLATES}" ]
 then
 	if [ -d ../"${LIVE_TEMPLATES}" ]
@@ -68,25 +68,12 @@
 	fi
 fi
 
-if [ ! -f chroot/usr/bin/syslinux ]
-then
-	PACKAGES="${PACKAGES} syslinux"
-fi
+# Checking depends
+Check_package chroot/usr/bin/syslinux syslinux
 
-if [ -n "${PACKAGES}" ]
-then
-	# Installing symlinks
-	case "${LH_APT}" in
-		apt|apt-get)
-			Chroot "apt-get install --yes ${PACKAGES}"
-			;;
+# Installing depends
+Install_package
 
-		aptitude)
-			Chroot "aptitude install --assume-yes ${PACKAGES}"
-			;;
-	esac
-fi
-
 # Setting destination directory
 case "${LIVE_BINARY_IMAGE}" in
 	iso)
@@ -356,19 +343,8 @@
 		;;
 esac
 
-if [ -n "${PACKAGES}" ]
-then
-	# Removing packages
-	case "${LH_APT}" in
-		apt|apt-get)
-			Chroot "apt-get remove --purge --yes ${PACKAGES}"
-			;;
+# Removing depends
+Remove_package
 
-		aptitude)
-			Chroot "aptitude purge --assume-yes ${PACKAGES}"
-			;;
-	esac
-fi
-
 # Creating stage file
 Create_stagefile .stage/binary_syslinux

Modified: dists/trunk/live-helper/helpers/lh_binary_usb
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_usb	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/helpers/lh_binary_usb	2007-04-23 11:29:29 UTC (rev 1135)
@@ -50,51 +50,24 @@
 		# Creating lock file
 		Create_lockfile .lock
 
-		if [ ! -f chroot/sbin/mkdosfs ]
-		then
-			PACKAGES="${PACKAGES} dosfstools"
-		fi
+		# Checking depends
+		Check_package chroot/sbin/mkdosfs dosfstools
+		Check_package chroot/usr/sbin/mtools mtools
+		Check_package chroot/sbin/parted parted
 
-		if [ ! -f chroot/usr/bin/mtools ]
-		then
-			PACKAGES="${PACKAGES} mtools"
-		fi
-
-		if [ ! -f chroot/sbin/parted ]
-		then
-			PACKAGES="${PACKAGES} parted"
-		fi
-
 		case "${LIVE_BOOTLOADER}" in
 			grub)
-				if [ ! -f chroot/usr/sbin/grub ]
-				then
-					PACKAGES="${PACKAGES} grub"
-				fi
+				Check_package chroot/usr/sbin/grub grub
 				;;
 
 			syslinux)
-				if [ ! -f chroot/usr/bin/syslinux ]
-				then
-					PACKAGES="${PACKAGES} syslinux"
-				fi
+				Check_package chroot/usr/bin/syslinux syslinux
 				;;
 		esac
 
-		if [ -n "${PACKAGES}" ]
-		then
-			# Installing packages
-			case "${LH_APT}" in
-				apt|apt-get)
-					Chroot "apt-get install --yes ${PACKAGES}"
-					;;
+		# Installing depends
+		Install_package
 
-				aptitude)
-					Chroot "aptitude install --assume-yes ${PACKAGES}"
-					;;
-			esac
-		fi
-
 		# Remove old binary
 		if [ -f binary.img ]
 		then
@@ -175,20 +148,9 @@
 			mv chroot/dev.tmp chroot/dev
 		fi
 
-		if [ -n "${PACKAGES}" ]
-		then
-			# Removing packages
-			case "${LH_APT}" in
-				apt|apt-get)
-					Chroot "apt-get remove --purge --yes ${PACKAGES}"
-					;;
+		# Removing depends
+		Remove_package
 
-				aptitude)
-					Chroot "aptitude purge --assume-yes ${PACKAGES}"
-					;;
-			esac
-		fi
-
 		# Creating stage file
 		Create_stagefile .stage/binary_usb
 	fi

Modified: dists/trunk/live-helper/helpers/lh_binary_yaboot
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary_yaboot	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/helpers/lh_binary_yaboot	2007-04-23 11:29:29 UTC (rev 1135)
@@ -68,25 +68,12 @@
 	fi
 fi
 
-if [ ! -f chroot/usr/lib/yaboot/yaboot ]
-then
-	PACKAGES="${PACKAGES} yaboot"
-fi
+# Checking depends
+Check_package chroot/usr/lib/yaboot/yaboot yaboot
 
-if [ -n "${PACKAGES}" ]
-then
-	# Installing symlinks
-	case "${LH_APT}" in
-		apt|apt-get)
-			Chroot "apt-get install --yes ${PACKAGES}"
-			;;
+# Installing depends
+Install_package
 
-		aptitude)
-			Chroot "aptitude install --assume-yes ${PACKAGES}"
-			;;
-	esac
-fi
-
 # Setting destination directory
 case "${LIVE_BINARY_IMAGE}" in
 	iso)
@@ -199,19 +186,8 @@
 		;;
 esac
 
-if [ -n "${PACKAGES}" ]
-then
-	# Removing packages
-	case "${LH_APT}" in
-		apt|apt-get)
-			Chroot "apt-get remove --purge --yes ${PACKAGES}"
-			;;
+# Removing depends
+Remove_package
 
-		aptitude)
-			Chroot "aptitude purge --assume-yes ${PACKAGES}"
-			;;
-	esac
-fi
-
 # Creating stage file
 Create_stagefile .stage/binary_yaboot

Modified: dists/trunk/live-helper/helpers/lh_chroot_localization
===================================================================
--- dists/trunk/live-helper/helpers/lh_chroot_localization	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/helpers/lh_chroot_localization	2007-04-23 11:29:29 UTC (rev 1135)
@@ -635,45 +635,27 @@
 	do
 		case "${LOCALZATION}" in
 			iceape)
-				if [ -f chroot/usr/bin/iceape ]
-				then
-					PACKAGES="${PACKAGES} iceweasel-l10n-${ICEAPE}"
-				fi
+				Check_package chroot/usr/bin/iceape iceweasel-l10n-"${ICEAPE}"
 				;;
 
 			icedove)
-				if [ -f chroot/usr/bin/icedove ]
-				then
-					PACKAGES="${PACKAGES} icedove-locale-${ICEDOVE}"
-				fi
+				Check_package chroot/usr/bin/icedove icedove-locale-"${ICEDOVE}"
 				;;
 
 			iceweasel)
-				if [ -f chroot/usr/bin/iceweasel ]
-				then
-					PACKAGES="${PACKAGES} iceweasel-l10n-${ICEWEASEL}"
-				fi
+				Check_package chroot/usr/bin/iceweasel iceweasel-l10n-"${ICEWEASEL}"
 				;;
 
 			kde)
-				if [ -f chroot/usr/bin/kstart ]
-				then
-					PACKAGES="${PACKAGES} kde-i18n-${KDE}"
-				fi
+				Check_package chroot/usr/bin/kstart kde-i18n-"${KDE}"
 				;;
 
 			koffice)
-				if [ -f chroot/usr/bin/usr/bin/koconverter ]
-				then
-					PACKAGES="${PACKAGES} koffice-i18n-${KOFFICE}"
-				fi
+				Check_package chroot/usr/bin/usr/bin/koconverter koffice-i18n-"${KOFFICE}"
 				;;
 
 			openoffice)
-				if [ -f chroot/usr/bin/ooffice ]
-				then
-					PACKAGES="${PACKAGES} openoffice.org-l10n-${OPENOFFICE}"
-				fi
+				Check_package chroot/usr/bin/ooffice openoffice.org-l10n-"${OPENOFFICE}"
 				;;
 		esac
 	done
@@ -682,16 +664,8 @@
 	Restore_cache cache/chroot_localization
 
 	# Installing packages
-	case "${LH_APT}" in
-		apt|apt-get)
-			Chroot "apt-get install --yes ${PACKAGES}"
-			;;
+	Install_package
 
-		aptitude)
-			Chroot "apt-get install --assume-yes ${PACKAGES}"
-			;;
-	esac
-
 	# Saving cache
 	Save_cache cache/chroot_localization
 

Modified: dists/trunk/live-helper/helpers/lh_chroot_symlinks
===================================================================
--- dists/trunk/live-helper/helpers/lh_chroot_symlinks	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/helpers/lh_chroot_symlinks	2007-04-23 11:29:29 UTC (rev 1135)
@@ -47,42 +47,18 @@
 
 if [ "${LIVE_SYMLINKS}" = "enabled" ]
 then
-	if [ -f chroot/usr/bin/symlinks ]
-	then
-		SYMLINKS="true"
-	fi
+	# Checking depends
+	Check_package chroot/usr/bin/symlinks symlinks
 
-	if [ -n "${SYMLINKS}" ]
-	then
-		# Installing symlinks
-		case "${LH_APT}" in
-			apt|apt-get)
-				Chroot "apt-get install --yes symlinks"
-				;;
+	# Installing depends
+	Install_package
 
-			aptitude)
-				Chroot "aptitude install --assume-yes symlinks"
-				;;
-		esac
-	fi
-
 	# Converting symlinks
 	Chroot "symlinks -c -r -s /"
 
-	if [ -n "${SYMLINKS}" ]
-	then
-		# Removing symlinks
-		case "${LH_APT}" in
-			apt|apt-get)
-				Chroot "apt-get remove --purge --yes symlinks"
-				;;
+	# Removing depends
+	Remove_package
 
-			aptitude)
-				Chroot "aptitude purge --assume-yes symlinks"
-				;;
-		esac
-	fi
-
 	# Creating stage file
 	Create_stagefile .stage/chroot_symlinks
 fi

Modified: dists/trunk/live-helper/helpers/lh_chroot_tasks
===================================================================
--- dists/trunk/live-helper/helpers/lh_chroot_tasks	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/helpers/lh_chroot_tasks	2007-04-23 11:29:29 UTC (rev 1135)
@@ -50,37 +50,21 @@
 	# Restoring cache
 	Restore_cache cache/chroot_tasks
 
-	# Select packages
+	# Checking depends
 	case "${LH_TASKSEL}" in
 		aptitude)
-			if [ ! -f chroot/usr/bin/aptitude ]
-			then
-				PACKAGES="${PACKAGES} aptitude"
-			fi
+			Check_package chroot/usr/bin/aptitude aptitude
 			;;
 
 		tasksel)
-			if [ ! -f chroot/usr/bin/tasksel ]
-			then
-				PACKAGES="${PACKAGES} tasksel"
-			fi
+			Check_package chroot/usr/bin/tasksel tasksel
 			;;
 	esac
 
-	if [ -n "${PACKAGES}" ]
-	then
-		# Installing packages
-		case "${LH_APT}" in
-			apt|apt-get)
-				Chroot "apt-get install --yes ${PACKAGES}"
-				;;
+	# Installing depends
+	Install_package
 
-			aptitude)
-				Chroot "aptitude install --assume-yes ${PACKAGES}"
-				;;
-		esac
-	fi
-
+	# Installing tasks
 	case "${LH_TASKSEL}" in
 		aptitude)
 			Chroot "aptitude install --assume-yes ${LIVE_TASKS}"
@@ -94,20 +78,9 @@
 			;;
 	esac
 
-	if [ -n "${PACKAGES}" ]
-	then
-		# Removing packages
-		case "${LH_APT}" in
-			apt|apt-get)
-				Chroot "apt-get remove --purge --yes ${PACKAGES}"
-				;;
+	# Removing depends
+	Remove_package
 
-			aptitude)
-				Chroot "aptitude purge --assume-yes ${PACKAGES}"
-				;;
-		esac
-	fi
-
 	# Saving cache
 	Save_cache cache/chroot_tasks
 

Modified: dists/trunk/live-helper/helpers/lh_source_usb
===================================================================
--- dists/trunk/live-helper/helpers/lh_source_usb	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/helpers/lh_source_usb	2007-04-23 11:29:29 UTC (rev 1135)
@@ -54,30 +54,13 @@
 		# Creating lock file
 		Create_lockfile .lock
 
-		if [ ! -f chroot/sbin/mkdosfs ]
-		then
-			PACKAGES="${PACKAGES} dosfstools"
-		fi
+		# Checking depends
+		Check_package chroot/sbin/mkdosfs dosfstools
+		Check_package chroot/sbin/parted parted
 
-		if [ ! -f chroot/sbin/parted ]
-		then
-			PACKAGES="${PACKAGES} parted"
-		fi
+		# Installing depends
+		Install_package
 
-		if [ -n "${PACKAGES}" ]
-		then
-			# Installing packages
-			case "${LH_APT}" in
-				apt|apt-get)
-					Chroot "apt-get install --yes ${PACKAGES}"
-					;;
-
-				aptitude)
-					Chroot "aptitude install --assume-yes ${PACKAGES}"
-					;;
-			esac
-		fi
-
 		# Remove old source
 		if [ -f source.img ]
 		then
@@ -120,20 +103,9 @@
 			mv chroot/dev.tmp chroot/dev
 		fi
 
-		if [ -n "${PACKAGES}" ]
-		then
-			# Removing packages
-			case "${LH_APT}" in
-				apt|apt-get)
-					Chroot "apt-get remove --purge --yes ${PACKAGES}"
-					;;
+		# Removing depends
+		Remove_package
 
-				aptitude)
-					Chroot "aptitude purge --assume-yes ${PACKAGES}"
-					;;
-			esac
-		fi
-
 		# Creating stage file
 		Create_stagefile .stage/source_usb
 	fi

Modified: dists/trunk/live-helper/helpers/make-live
===================================================================
--- dists/trunk/live-helper/helpers/make-live	2007-04-23 06:42:05 UTC (rev 1134)
+++ dists/trunk/live-helper/helpers/make-live	2007-04-23 11:29:29 UTC (rev 1135)
@@ -383,4 +383,8 @@
 	fi
 }
 
+trap "if [ -f ${ROOT}/chroot/proc/version ]; then umount ${ROOT}/chroot/proc; fi; \
+      if [ -f ${ROOT}/chroot/sys/kernel ]; then umount ${ROOT}/chroot/sys; fi; exit" \
+      0 1 2 3 9 15
+
 Main "${@}"




More information about the Debian-live-changes mailing list