[SCM] live-config branch, debian-next, updated. debian/3.0_a32-1-5-g64bf6c4

Daniel Baumann daniel at debian.org
Sun Feb 26 19:48:17 UTC 2012


The following commit has been merged in the debian-next branch:
commit ded4c78e56d142b011425f06fd67ec3cf9d7634f
Author: Daniel Baumann <daniel at debian.org>
Date:   Sun Feb 26 20:46:38 2012 +0100

    Simplifing live-config-update script.

diff --git a/bin/live-config-update b/bin/live-config-update
index df60c5c..775cb7e 100755
--- a/bin/live-config-update
+++ b/bin/live-config-update
@@ -6,87 +6,75 @@ _DIRECTORY="${1:-/lib/live/config}"
 
 if [ ! -e "${_DIRECTORY}" ]
 then
-	echo "E: ${_DIRECTORY} - not found."
+	echo "E: cannot access ${_DIRECTORY}: No such directory."
 	exit 1
 fi
 
 if [ ! -x "$(which lsb_release 2>/dev/null)" ]
 then
-	echo "E: lsb_release - command not found"
+	echo "E: lsb_release: command not found."
 	echo "I: lsb_release can be optained from:"
 	echo "I:   http://www.linux-foundation.org/en/LSB"
 	echo "I: On Debian based systems, lsb_release can be installed with:"
-	echo "I:   apt-get install lsb-release"
+	echo "I:   sudo apt-get install lsb-release"
 	exit 1
 fi
 
 _DISTRIBUTION="$(lsb_release -is | tr [A-Z] [a-z])"
 _RELEASE="$(lsb_release -cs | tr [A-Z] [a-z])"
 
-echo "Removing unused scripts..."
-
 case "${_DISTRIBUTION}" in
 	debian)
-		# Removing ubuntu scripts
-		rm -f "${_DIRECTORY}"/*-apport
-		rm -f "${_DIRECTORY}"/*-ureadahead
-		;;
-
-	progress)
-		# Removing ubuntu scripts
-		rm -f "${_DIRECTORY}"/*-upstart
-		rm -f "${_DIRECTORY}"/*-apport
-		rm -f "${_DIRECTORY}"/*-ureadahead
-		;;
+		NOSCRIPTS="apport ureadahead"
 
-	ubuntu)
-		# Removing debian scripts
-		rm -f "${_DIRECTORY}"/*-gdm3
-		;;
-esac
-
-echo "Setting distribution specific defaults..."
-
-case "${_DISTRIBUTION}" in
-	debian)
 		LIVE_HOSTNAME="debian"
 		LIVE_USERNAME="user"
 		LIVE_USER_FULLNAME="Debian Live user"
+		LIVE_USER_DEFAULT_GROUPS="audio cdrom dip floppy video plugdev netdev powerdev scanner bluetooth debian-tor"
 
 		case "${_RELEASE}" in
 			squeeze)
 				LIVE_USER_DEFAULT_GROUPS="audio cdrom dip floppy video plugdev netdev powerdev scanner bluetooth"
 				;;
-
-			*)
-				LIVE_USER_DEFAULT_GROUPS="audio cdrom dip floppy video plugdev netdev powerdev scanner bluetooth debian-tor"
-				;;
 		esac
 		;;
 
 	progress)
+		NOSCRIPTS="upstart apport ureadahead"
+
 		LIVE_HOSTNAME="progress"
 		LIVE_USERNAME="user"
 		LIVE_USER_FULLNAME="Progress Linux user"
+		LIVE_USER_DEFAULT_GROUPS="audio cdrom dip floppy video plugdev netdev powerdev scanner bluetooth debian-tor sudo"
 
 		case "${_RELEASE}" in
-			artax)
+			artax|artax-backports)
 				LIVE_USER_DEFAULT_GROUPS="audio cdrom dip floppy video plugdev netdev powerdev scanner bluetooth sudo"
 				;;
-
-			*)
-				LIVE_USER_DEFAULT_GROUPS="audio cdrom dip floppy video plugdev netdev powerdev scanner bluetooth debian-tor sudo"
-				;;
 		esac
 		;;
 
 	ubuntu)
+		NOSCRIPTS="gdm3"
+
 		LIVE_HOSTNAME="ubuntu"
 		LIVE_USERNAME="user"
 		LIVE_USER_FULLNAME="Ubuntu Live user"
 		;;
 esac
 
+echo "Removing unused scripts..."
+
+for NOSCRIPT in ${NOSCRIPTS}
+do
+	if ls "${_DIRECTORY}"/*-"${NOSCRIPT}" > /dev/null 2>&1
+	then
+		rm -f "${_DIRECTORY}"/*-"${NOSCRIPT}"
+	fi
+done
+
+echo  "Setting distribution specific defaults..."
+
 sed -i  -e "s|^LIVE_HOSTNAME=.*$|LIVE_HOSTNAME=\"${LIVE_HOSTNAME}\"|" \
 	-e "s|^LIVE_USERNAME=.*$|LIVE_USERNAME=\"${LIVE_USERNAME}\"|" \
 	-e "s|^LIVE_USER_FULLNAME=.*$|LIVE_USER_FULLNAME=\"${LIVE_USER_FULLNAME}\"|" \

-- 
live-config



More information about the debian-live-changes mailing list