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

Daniel Baumann daniel at alioth.debian.org
Thu Mar 29 16:06:58 CET 2007


Author: daniel
Date: 2007-03-29 15:06:58 +0000 (Thu, 29 Mar 2007)
New Revision: 880

Modified:
   dists/trunk/live-helper/functions/arguments.sh
   dists/trunk/live-helper/functions/chroot.sh
   dists/trunk/live-helper/functions/common.sh
   dists/trunk/live-helper/functions/conffile.sh
   dists/trunk/live-helper/functions/echo.sh
   dists/trunk/live-helper/functions/lockfile.sh
   dists/trunk/live-helper/functions/stagefile.sh
   dists/trunk/live-helper/helpers/lh_binary
   dists/trunk/live-helper/helpers/lh_testroot
Log:


Modified: dists/trunk/live-helper/functions/arguments.sh
===================================================================
--- dists/trunk/live-helper/functions/arguments.sh	2007-03-29 14:39:36 UTC (rev 879)
+++ dists/trunk/live-helper/functions/arguments.sh	2007-03-29 15:06:58 UTC (rev 880)
@@ -17,7 +17,7 @@
 
 	if [ "${?}" != "0" ]
 	then
-		echo "terminating" >&2
+		Echo_error "terminating" >&2
 		exit 1
 	fi
 
@@ -67,7 +67,7 @@
 				;;
 
 			*)
-				echo "internal error"
+				Echo_error "internal error"
 				exit 1
 				;;
 		esac

Modified: dists/trunk/live-helper/functions/chroot.sh
===================================================================
--- dists/trunk/live-helper/functions/chroot.sh	2007-03-29 14:39:36 UTC (rev 879)
+++ dists/trunk/live-helper/functions/chroot.sh	2007-03-29 15:06:58 UTC (rev 880)
@@ -14,5 +14,6 @@
 	COMMANDS="${1}"
 
 	# Executing commands in chroot
+	Echo_debug "Executing: ${COMMANDS}"
 	chroot chroot /usr/bin/env -i HOME="/root" PATH="/usr/sbin:/usr/bin:/sbin:/bin" TERM="${TERM}" ftp_proxy="${LH_APT_FTPPROXY}" http_proxy="${LH_APT_HTTPPPROXY}" DEBIAN_FRONTEND="${LH_DEBCONF_FRONTEND}" DEBIAN_PRIORITY="${LH_DEBCONF_PRIORITY}" ${COMMANDS}
 }

Modified: dists/trunk/live-helper/functions/common.sh
===================================================================
--- dists/trunk/live-helper/functions/common.sh	2007-03-29 14:39:36 UTC (rev 879)
+++ dists/trunk/live-helper/functions/common.sh	2007-03-29 15:06:58 UTC (rev 880)
@@ -9,5 +9,8 @@
 
 set -e
 
+# Starting helper
+Echo_debug "Init ${PROGRAM}"
+
 # Ensure that a system is built as root
 lh_testroot

Modified: dists/trunk/live-helper/functions/conffile.sh
===================================================================
--- dists/trunk/live-helper/functions/conffile.sh	2007-03-29 14:39:36 UTC (rev 879)
+++ dists/trunk/live-helper/functions/conffile.sh	2007-03-29 15:06:58 UTC (rev 880)
@@ -13,15 +13,14 @@
 {
 	FILE="${1}"
 
-	# Reading configuration file
 	if [ -f "${FILE}" ]
 	then
 		if [ -r "${FILE}" ]
 		then
-			# Sourcing configurationfile
+			Echo_debug "Reading configuration file ${FILE}"
 			. "${FILE}"
 		else
-			echo "W: failed to read ${FILE}"
+			Echo_warning "Failed to read configuration file ${FILE}"
 		fi
 	fi
 }

Modified: dists/trunk/live-helper/functions/echo.sh
===================================================================
--- dists/trunk/live-helper/functions/echo.sh	2007-03-29 14:39:36 UTC (rev 879)
+++ dists/trunk/live-helper/functions/echo.sh	2007-03-29 15:06:58 UTC (rev 880)
@@ -13,23 +13,20 @@
 {
 	if [ "${DEBUG}" = "true" ]
 	then
-		echo "${@}"
+		echo "D: ${@}"
 	fi
 }
 
-Echo_message ()
+Echo_error ()
 {
-	if [ "${QUIET}" != "true" ]
-	then
-		echo "${@}"
-	fi
+	echo "E: ${@}"
 }
 
-Echo_quiet ()
+Echo_message ()
 {
-	if [ "${QUIET}" = "true" ]
+	if [ "${QUIET}" != "true" ]
 	then
-		echo "${@}"
+		echo "P: ${@}"
 	fi
 }
 
@@ -37,6 +34,11 @@
 {
 	if [ "${VERBOSE}" = "true" ]
 	then
-		echo "${@}"
+		echo "I: ${@}"
 	fi
 }
+
+Echo_warning ()
+{
+	echo "W: ${@}"
+}

Modified: dists/trunk/live-helper/functions/lockfile.sh
===================================================================
--- dists/trunk/live-helper/functions/lockfile.sh	2007-03-29 14:39:36 UTC (rev 879)
+++ dists/trunk/live-helper/functions/lockfile.sh	2007-03-29 15:06:58 UTC (rev 880)
@@ -16,7 +16,7 @@
 	# Checking lock file
 	if [ -f "${FILE}" ]
 	then
-		echo "E: system locked"
+		Echo_error "system locked"
 		exit 1
 	fi
 }

Modified: dists/trunk/live-helper/functions/stagefile.sh
===================================================================
--- dists/trunk/live-helper/functions/stagefile.sh	2007-03-29 14:39:36 UTC (rev 879)
+++ dists/trunk/live-helper/functions/stagefile.sh	2007-03-29 15:06:58 UTC (rev 880)
@@ -23,7 +23,7 @@
 			rm -f "${FILE}"
 		else
 			# Skipping execution
-			echo "W: skipping ${NAME}"
+			Echo_warning "skipping ${NAME}"
 			exit 0
 		fi
 	fi
@@ -52,7 +52,7 @@
 	# Checking stage file
 	if [ ! -f "${FILE}" ]
 	then
-		echo "E: ${NAME} missing"
+		Echo_error "${NAME} missing"
 		exit 1
 	fi
 }

Modified: dists/trunk/live-helper/helpers/lh_binary
===================================================================
--- dists/trunk/live-helper/helpers/lh_binary	2007-03-29 14:39:36 UTC (rev 879)
+++ dists/trunk/live-helper/helpers/lh_binary	2007-03-29 15:06:58 UTC (rev 880)
@@ -22,6 +22,8 @@
 
 Arguments "${@}"
 
+Echo_debug "Init lh_cdebootstrap"
+
 # Preparing root filesystem
 lh_binary_chroot "${@}"
 

Modified: dists/trunk/live-helper/helpers/lh_testroot
===================================================================
--- dists/trunk/live-helper/helpers/lh_testroot	2007-03-29 14:39:36 UTC (rev 879)
+++ dists/trunk/live-helper/helpers/lh_testroot	2007-03-29 15:06:58 UTC (rev 880)
@@ -27,6 +27,6 @@
 # Checking user account
 if [ "`id -u`" -ne "0" ]
 then
-	echo "E: need root privileges"
+	Echo_error "need root privileges"
 	exit 1
 fi




More information about the Debian-live-changes mailing list