[Debian-live-changes] r878 - dists/trunk/live-helper/functions

Daniel Baumann daniel at alioth.debian.org
Thu Mar 29 15:20:17 CET 2007


Author: daniel
Date: 2007-03-29 14:20:16 +0000 (Thu, 29 Mar 2007)
New Revision: 878

Modified:
   dists/trunk/live-helper/functions/arguments.sh
   dists/trunk/live-helper/functions/cache.sh
   dists/trunk/live-helper/functions/conffile.sh
   dists/trunk/live-helper/functions/lockfile.sh
   dists/trunk/live-helper/functions/stagefile.sh
Log:


Modified: dists/trunk/live-helper/functions/arguments.sh
===================================================================
--- dists/trunk/live-helper/functions/arguments.sh	2007-03-29 14:14:22 UTC (rev 877)
+++ dists/trunk/live-helper/functions/arguments.sh	2007-03-29 14:20:16 UTC (rev 878)
@@ -13,8 +13,7 @@
 
 Arguments ()
 {
-	ARGUMENTS="`getopt --longoptions force,help,usage,version \
-		--name=${PROGRAM} --options huv --shell sh -- "${@}"`"
+	ARGUMENTS="`getopt --longoptions conffile:,debug,force,help,logfile:,quiet,usage,verbose,version --name=${PROGRAM} --options huv --shell sh -- "${@}"`"
 
 	if [ "${?}" != "0" ]
 	then
@@ -28,7 +27,7 @@
 	do
 		case "${1}" in
 			--conffile)
-				CONFFILE="FIXME"; shift
+				CONFFILE="${2}"; shift 2
 				;;
 
 			--debug)
@@ -44,7 +43,7 @@
 				;;
 
 			--logfile)
-				LOGFILE="FIXME"; shift
+				LOGFILE="${2}"; shift 2
 				;;
 
 			--quiet)

Modified: dists/trunk/live-helper/functions/cache.sh
===================================================================
--- dists/trunk/live-helper/functions/cache.sh	2007-03-29 14:14:22 UTC (rev 877)
+++ dists/trunk/live-helper/functions/cache.sh	2007-03-29 14:20:16 UTC (rev 878)
@@ -11,21 +11,21 @@
 
 Restore_cache ()
 {
-	CACHEDIRECTORY="${1}"
+	DIRECTORY="${1}"
 
 	if [ "${LH_CACHE}" = "enabled" ]
 	then
-		if [ -d "${CACHEDIRECTORY}" ]
+		if [ -d "${DIRECTORY}" ]
 		then
 			# Restore old cache
-			cp "${CACHEDIRECTORY}"/*.deb chroot/var/cache/apt/archives
+			cp "${DIRECTORY}"/*.deb chroot/var/cache/apt/archives
 		fi
 	fi
 }
 
 Save_cache ()
 {
-	CACHEDIRECTORY="${1}"
+	DIRECTORY="${1}"
 
 	if [ "${LH_CACHE}" = "enabled" ]
 	then
@@ -35,13 +35,13 @@
 		if ls chroot/var/cache/apt/archives/*.deb &> /dev/null
 		then
 			# Creating cache directory
-			if [ ! -d "${CACHEDIRECTORY}" ]
+			if [ ! -d "${DIRECTORY}" ]
 			then
-				mkdir -p "${CACHEDIRECTORY}"
+				mkdir -p "${DIRECTORY}"
 			fi
 
 			# Saving new cache
-			mv -f chroot/var/cache/apt/archives/*.deb "${CACHEDIRECTORY}"
+			mv -f chroot/var/cache/apt/archives/*.deb "${DIRECTORY}"
 		fi
 	else
 		# Purging current cache

Modified: dists/trunk/live-helper/functions/conffile.sh
===================================================================
--- dists/trunk/live-helper/functions/conffile.sh	2007-03-29 14:14:22 UTC (rev 877)
+++ dists/trunk/live-helper/functions/conffile.sh	2007-03-29 14:20:16 UTC (rev 878)
@@ -11,17 +11,17 @@
 
 Read_conffile ()
 {
-	CONFFILE="${1}"
+	FILE="${1}"
 
 	# Reading configuration file
-	if [ -f "${CONFFILE}" ]
+	if [ -f "${FILE}" ]
 	then
-		if [ -r "${CONFFILE}" ]
+		if [ -r "${FILE}" ]
 		then
 			# Sourcing configurationfile
-			. "${CONFFILE}"
+			. "${FILE}"
 		else
-			echo "W: failed to read ${CONFFILE}"
+			echo "W: failed to read ${FILE}"
 		fi
 	fi
 }

Modified: dists/trunk/live-helper/functions/lockfile.sh
===================================================================
--- dists/trunk/live-helper/functions/lockfile.sh	2007-03-29 14:14:22 UTC (rev 877)
+++ dists/trunk/live-helper/functions/lockfile.sh	2007-03-29 14:20:16 UTC (rev 878)
@@ -11,10 +11,10 @@
 
 Check_lockfile ()
 {
-	LOCKFILE="${1}"
+	FILE="${1}"
 
 	# Checking lock file
-	if [ -f "${LOCKFILE}" ]
+	if [ -f "${FILE}" ]
 	then
 		echo "E: system locked"
 		exit 1
@@ -23,18 +23,18 @@
 
 Create_lockfile ()
 {
-	LOCKFILE="${1}"
-	LOCKDIRECTORY="`dirname ${1}`"
+	FILE="${1}"
+	DIRECTORY="`dirname ${1}`"
 
 	# Creating lock directory
-	if [ ! -d "${LOCKDIRECTORY}" ]
+	if [ ! -d "${DIRECTORY}" ]
 	then
-		mkdir -p "${LOCKDIRECTORY}"
+		mkdir -p "${DIRECTORY}"
 	fi
 
 	# Creating lock trap
-	trap "test -f ${LOCKFILE} && rm -f ${LOCKFILE}; exit 0" 0 2 15
+	trap "test -f ${FILE} && rm -f ${FILE}; exit 0" 0 2 15
 
 	# Creating lock file
-	touch "${LOCKFILE}"
+	touch "${FILE}"
 }

Modified: dists/trunk/live-helper/functions/stagefile.sh
===================================================================
--- dists/trunk/live-helper/functions/stagefile.sh	2007-03-29 14:14:22 UTC (rev 877)
+++ dists/trunk/live-helper/functions/stagefile.sh	2007-03-29 14:20:16 UTC (rev 878)
@@ -11,19 +11,19 @@
 
 Check_stagefile ()
 {
-	STAGEFILE="${1}"
-	STAGENAME="`basename ${1}`"
+	FILE="${1}"
+	NAME="`basename ${1}`"
 
 	# Checking stage file
-	if [ -f "${STAGEFILE}" ]
+	if [ -f "${FILE}" ]
 	then
 		if [ "${FORCE}" = "true" ]
 		then
 			# Forcing execution
-			rm -f "${STAGEFILE}"
+			rm -f "${FILE}"
 		else
 			# Skipping execution
-			echo "W: skipping ${STAGENAME}"
+			echo "W: skipping ${NAME}"
 			exit 0
 		fi
 	fi
@@ -31,28 +31,28 @@
 
 Create_stagefile ()
 {
-	STAGEFILE="${1}"
-	STAGEDIRECTORY="`dirname ${1}`"
+	FILE="${1}"
+	DIRECTORY="`dirname ${1}`"
 
 	# Creating stage directory
-	if [ ! -d "${STAGEDIRECTORY}" ]
+	if [ ! -d "${DIRECTORY}" ]
 	then
-		mkdir -p "${STAGEDIRECTORY}"
+		mkdir -p "${DIRECTORY}"
 	fi
 
 	# Creating stage file
-	touch "${STAGEFILE}"
+	touch "${FILE}"
 }
 
 Require_stagefile ()
 {
-	STAGEFILE="${1}"
-	STAGENAME="`basename ${1}`"
+	FILE="${1}"
+	NAME="`basename ${1}`"
 
 	# Checking stage file
-	if [ ! -f "${STAGEFILE}" ]
+	if [ ! -f "${FILE}" ]
 	then
-		echo "E: ${STAGENAME} missing"
+		echo "E: ${NAME} missing"
 		exit 1
 	fi
 }




More information about the Debian-live-changes mailing list