public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Fabio Erculiani" <lxnay@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/genkernel:master commit in: /, defaults/
Date: Sun, 11 Sep 2011 07:40:46 +0000 (UTC)	[thread overview]
Message-ID: <d6696d0df6e1b31bf169fc34e2a9b0579f2af72d.lxnay@gentoo> (raw)

commit:     d6696d0df6e1b31bf169fc34e2a9b0579f2af72d
Author:     Fabio Erculiani <lxnay <AT> sabayon <DOT> org>
AuthorDate: Sun Sep 11 07:42:30 2011 +0000
Commit:     Fabio Erculiani <lxnay <AT> gentoo <DOT> org>
CommitDate: Sun Sep 11 07:44:29 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=d6696d0d

syntax: drop parse_opt usage and crufty, deprecated subshelling through ``

These changes have been ported from official Gentoo LiveDVD

---
 ChangeLog               |    4 +
 defaults/initrd.scripts |    8 --
 defaults/linuxrc        |  200 +++++++++++++++++++++++-----------------------
 3 files changed, 104 insertions(+), 108 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fd11f8e..fbc1418 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,10 @@
 # Distributed under the GPL v2
 # $Id$
 
+  11 Sep 2011; Fabio Erculiani <lxnay@gentoo.org> defaults/initrd.scripts,
+  defaults/linuxrc:
+  drop parse_opt usage and crufty, deprecated subshelling through 
+
   30 Aug 2011; Sebastian Pipping <sping@gentoo.org> defaults/initrd.scripts:
   Fix quoting issue (bug #380729).
 

diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index bf31042..da8cb01 100755
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -6,14 +6,6 @@ backup() {
 	echo -ne "\033[0G\033[0K"
 }
 
-parse_opt() {
-	case "$1" in
-		*\=*)
-			echo "$1" | cut -d= -f2-
-		;;
-	esac
-}
-
 modules_load() {
 	for module in $*
 	do

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 7aa11e3..ee74d76 100755
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -33,7 +33,7 @@ fi
 
 quiet_kmsg
 
-CMDLINE=`cat /proc/cmdline`
+CMDLINE=$(cat /proc/cmdline)
 # Scan CMDLINE for any specified real_root= or cdroot arguments
 FAKE_ROOT=''
 REAL_ROOTFLAGS=''
@@ -42,41 +42,41 @@ CRYPT_SILENT=0
 for x in ${CMDLINE}
 do
 	case "${x}" in
-		real_root\=*)
-			REAL_ROOT=`parse_opt "${x}"`
+		real_root=*)
+			REAL_ROOT=${x#*=}
 		;;
-		root\=*)
-			FAKE_ROOT=`parse_opt "${x}"`
+		root=*)
+			FAKE_ROOT=${x#*=}
 		;;
-		subdir\=*)
-			SUBDIR=`parse_opt "${x}"`
+		subdir=*)
+			SUBDIR=${x#*=}
 		;;
-		real_init\=*)
-			REAL_INIT=`parse_opt "${x}"`
+		real_init=*)
+			REAL_INIT=${x#*=}
 		;;
-		init_opts\=*)
-			INIT_OPTS=`parse_opt "${x}"`
+		init_opts=*)
+			INIT_OPTS=${x#*=}
 		;;
 		# Livecd options
 		cdroot)
 			CDROOT=1
 		;;
-		cdroot\=*)
+		cdroot=*)
 			CDROOT=1
-			CDROOT_DEV=`parse_opt "${x}"`
+			CDROOT_DEV=${x#*=}
 		;;
-		cdroot_type\=*)
-			CDROOT_TYPE=`parse_opt "${x}"`
+		cdroot_type=*)
+			CDROOT_TYPE=${x#*=}
 		;;
 		# Start livecd loop, looptype options
-		loop\=*)
-			LOOP=`parse_opt "${x}"`
+		loop=*)
+			LOOP=${x#*=}
 		;;
-		looptype\=*)
-			LOOPTYPE=`parse_opt "${x}"`
+		looptype=*)
+			LOOPTYPE=${x#*=}
 		;;
-		isoboot\=*)
-			ISOBOOT=`parse_opt "${x}"`
+		isoboot=*)
+			ISOBOOT=${x#*=}
 		;;
 		# Start Volume manager options 
 		dolvm)
@@ -92,8 +92,8 @@ do
 		dodmraid)
 			USE_DMRAID_NORMAL=1
 		;;
-		dodmraid\=*)
-			DMRAID_OPTS=`parse_opt "${x}"`
+		dodmraid=*)
+			DMRAID_OPTS=${x#*=}
 			USE_DMRAID_NORMAL=1
 		;;
 		# Debug Options
@@ -101,102 +101,102 @@ do
 			DEBUG='yes'
 		;;
 		# Scan delay options 
-		scandelay\=*)
-			SDELAY=`parse_opt "${x}"`
+		scandelay=*)
+			SDELAY=${x#*=}
 		;;
 		scandelay)
 			SDELAY=3
 		;;
 		# Module no-loads
-		doload\=*)
-			MDOLIST=`parse_opt "${x}"`
-			MDOLIST="`echo ${MDOLIST} | sed -e 's/,/ /g'`"
+		doload=*)
+			MDOLIST=${x#*=}
+			MDOLIST=$(echo ${MDOLIST} | sed -e 's/,/ /g'`)
 		;;
 		nodetect)
 			NODETECT=1
 		;;
-		noload\=*)
-			MLIST=`parse_opt "${x}"`
-			MLIST="`echo ${MLIST} | sed -e 's/,/ /g'`"
+		noload=*)
+			MLIST=${x#*=}
+			MLIST="$(echo ${MLIST} | sed -e 's/,/ /g')"
 			export MLIST
 		;;
 		# Redirect output to a specific tty
-		CONSOLE\=*|console\=*)
-			CONSOLE=`parse_opt "${x}"`
-			CONSOLE=`basename ${CONSOLE}`
+		CONSOLE=*|console=*)
+			CONSOLE=${x#*=}
+			CONSOLE=$(basename ${CONSOLE})
 #			exec >${CONSOLE} <${CONSOLE} 2>&1
 		;;
 		# /dev/md
-		lvmraid\=*)
-			RAID_DEVICES="`parse_opt ${x}`"
-			RAID_DEVICES="`echo ${RAID_DEVICES} | sed -e 's/,/ /g'`"
+		lvmraid=*)
+			RAID_DEVICES="${x#*=}"
+			RAID_DEVICES="$(echo ${RAID_DEVICES} | sed -e 's/,/ /g')"
 			USE_LVM_NORMAL=1
 		;;
-		part\=*)
-			MDPART=`parse_opt "${x}"`
+		part=*)
+			MDPART=${x#*=}
 		;;
 		# NFS
-		ip\=*)
-			IP=`parse_opt "${x}"`
+		ip=*)
+			IP=${x#*=}
 		;;
-		nfsroot\=*)
-			NFSROOT=`parse_opt "${x}"`
+		nfsroot=*)
+			NFSROOT=${x#*=}
 		;;
 		# iSCSI
-		iscsi_initiatorname\=*)
-			ISCSI_INITIATORNAME=`parse_opt "${x}"`
+		iscsi_initiatorname=*)
+			ISCSI_INITIATORNAME=${x#*=}
 		;;
-		iscsi_target\=*)
-			ISCSI_TARGET=`parse_opt "${x}"`
+		iscsi_target=*)
+			ISCSI_TARGET=${x#*=}
 		;;
-		iscsi_tgpt\=*)
-			ISCSI_TGPT=`parse_opt "${x}"`
+		iscsi_tgpt=*)
+			ISCSI_TGPT=${x#*=}
 		;;
-		iscsi_address\=*)
-			ISCSI_ADDRESS=`parse_opt "${x}"`
+		iscsi_address=*)
+			ISCSI_ADDRESS=${x#*=}
 		;;
-		iscsi_port\=*)
-			ISCSI_PORT=`parse_opt "${x}"`
+		iscsi_port=*)
+			ISCSI_PORT=${x#*=}
 		;;
-		iscsi_username\=*)
-			ISCSI_USERNAME=`parse_opt "${x}"`
+		iscsi_username=*)
+			ISCSI_USERNAME=${x#*=}
 		;;
-		iscsi_password\=*)
-			ISCSI_PASSWORD=`parse_opt "${x}"`
+		iscsi_password=*)
+			ISCSI_PASSWORD=${x#*=}
 		;;
-		iscsi_username_in\=*)
-			ISCSI_USERNAME_IN=`parse_opt "${x}"`
+		iscsi_username_in=*)
+			ISCSI_USERNAME_IN=${x#*=}
 		;;
-		iscsi_password_in\=*)
-			ISCSI_PASSWORD_IN=`parse_opt "${x}"`
+		iscsi_password_in=*)
+			ISCSI_PASSWORD_IN=${x#*=}
 		;;
-		iscsi_debug\=*)
-			ISCSI_DEBUG=`parse_opt "${x}"`
+		iscsi_debug=*)
+			ISCSI_DEBUG=${x#*=}
 		;;
 		iscsi_noibft)
 			ISCSI_NOIBFT=1
 		;;
 		# Crypto
-		crypt_root\=*)
-			CRYPT_ROOT=`parse_opt "${x}"`
+		crypt_root=*)
+			CRYPT_ROOT=${x#*=}
 		;;
-		crypt_swap\=*)
-			CRYPT_SWAP=`parse_opt "${x}"`
+		crypt_swap=*)
+			CRYPT_SWAP=${x#*=}
 		;;
-		root_key\=*)
-			CRYPT_ROOT_KEY=`parse_opt "${x}"`
+		root_key=*)
+			CRYPT_ROOT_KEY=${x#*=}
 		;;
-		root_keydev\=*)
-			CRYPT_ROOT_KEYDEV=`parse_opt "${x}"`
+		root_keydev=*)
+			CRYPT_ROOT_KEYDEV=${x#*=}
 		;;
-		swap_key\=*)
-			CRYPT_SWAP_KEY=`parse_opt "${x}"`
+		swap_key=*)
+			CRYPT_SWAP_KEY=${x#*=}
 		;;
-		swap_keydev\=*)
-			CRYPT_SWAP_KEYDEV=`parse_opt "${x}"`
+		swap_keydev=*)
+			CRYPT_SWAP_KEYDEV=${x#*=}
 		;;
-		real_resume\=*|resume\=*)
-			REAL_RESUME=`parse_opt "${x}"`
+		real_resume=*|resume=*)
+			REAL_RESUME=${x#*=}
 		;;
 		noresume)
 			NORESUME=1
@@ -204,14 +204,14 @@ do
 		crypt_silent)
 			CRYPT_SILENT=1
 		;;
-		real_rootflags\=*)
-			REAL_ROOTFLAGS=`parse_opt "${x}"`
+		real_rootflags=*)
+			REAL_ROOTFLAGS=${x#*=}
 		;;
-		rootfstype\=*)
-			ROOTFSTYPE=`parse_opt "${x}"`
+		rootfstype=*)
+			ROOTFSTYPE=${x#*=}
 		;;
-		keymap\=*)
-			keymap=`parse_opt "${x}"`
+		keymap=*)
+			keymap=${x#*=}
 		;;
 		aufs)
 			USE_AUFS_NORMAL=1
@@ -228,19 +228,19 @@ do
 		nounionfs)
 			USE_UNIONFS_NORMAL=0
 			;;
-#                 unionfs\=*) 	 
+#                 unionfs=*) 	 
 #                         if [ ! -x /sbin/unionfs ] 	 
 #                         then 	 
 #                                 USE_UNIONFS_NORMAL=0 	 
 #                                 bad_msg 'unionfs binary not found: aborting use of unionfs!'
 #                         else 	 
 #                                 USE_UNIONFS_NORMAL=1 	 
-#                                 CMD_UNIONFS=`parse_opt "${x}"` 	 
+#                                 CMD_UNIONFS=${x#*=} 	 
 #                                 echo ${CMD_UNIONFS}|grep , >/dev/null 2>&1 	 
 #                                 if [ $? -eq 0 ]
 #                                 then 	 
-#                                         UID=`echo ${CMD_UNIONFS#*,}` 	 
-#                                         UNIONFS=`echo ${CMD_UNIONFS%,*}` 	 
+#                                         UID=$(echo ${CMD_UNIONFS#*,}) 	 
+#                                         UNIONFS=$(echo ${CMD_UNIONFS%,*}) 
 #                                 else 	 
 #                                         UNIONFS=${CMD_UNIONFS} 	 
 #                                 fi 	 
@@ -321,23 +321,23 @@ then
 	if [ "${NORESUME}" != '1' ] && [ -n "${REAL_RESUME}" ]
 	then
 		case "${REAL_RESUME}" in
-			LABEL\=*|UUID\=*)
+			LABEL=*|UUID=*)
 
 				RESUME_DEV=""
 				retval=1
 				
 				if [ ${retval} -ne 0 ]; then
-					RESUME_DEV=`findfs "${REAL_RESUME}" 2>/dev/null`
+					RESUME_DEV=$(findfs "${REAL_RESUME}" 2>/dev/null)
 					retval=$?
 				fi
 				
 				if [ ${retval} -ne 0 ]; then
-					RESUME_DEV=`busybox findfs "${REAL_RESUME}" 2>/dev/null`
+					RESUME_DEV=$(busybox findfs "${REAL_RESUME}" 2>/dev/null)
 					retval=$?
 				fi
 				
 				if [ ${retval} -ne 0 ]; then
-					RESUME_DEV=`blkid -l -t "${REAL_RESUME}" | cut -d ":" -f 1 2>/dev/null`
+					RESUME_DEV=$(blkid -l -t "${REAL_RESUME}" | cut -d ":" -f 1 2>/dev/null)
 					retval=$?
 				fi
 				
@@ -434,17 +434,17 @@ do
 				retval=1
 				
 				if [ ${retval} -ne 0 ]; then
-					ROOT_DEV=`findfs "${REAL_ROOT}" 2>/dev/null`
+					ROOT_DEV=$(findfs "${REAL_ROOT}" 2>/dev/null)
 					retval=$?
 				fi
 				
 				if [ ${retval} -ne 0 ]; then
-					ROOT_DEV=`busybox findfs "${REAL_ROOT}" 2>/dev/null`
+					ROOT_DEV=$(busybox findfs "${REAL_ROOT}" 2>/dev/null)
 					retval=$?
 				fi
 				
 				if [ ${retval} -ne 0 ]; then
-					ROOT_DEV=`blkid -l -t "${REAL_ROOT}" | cut -d ":" -f 1 2>/dev/null`
+					ROOT_DEV=$(blkid -l -t "${REAL_ROOT}" | cut -d ":" -f 1 2>/dev/null)
 					retval=$?
 				fi
 				
@@ -630,9 +630,9 @@ then
 	then
 		if [ -e "${NEW_ROOT}/mnt/cdrom/add" ]
 		then
-				for targz in `ls ${NEW_ROOT}/mnt/cdrom/add/*.tar.gz`
+				for targz in $(ls ${NEW_ROOT}/mnt/cdrom/add/*.tar.gz)
 				do	
-					tarname=`basename ${targz}`
+					tarname=$(basename ${targz})
 					good_msg "Adding additional package ${tarname}"
 					(cd ${NEW_ROOT} ; /bin/tar -xzf ${targz})
 				done
@@ -655,7 +655,7 @@ then
 	do
 		if [ -L "${NEW_ROOT}/${FS_LOCATION}/${x}" ]
 		then
-			ln -s "`readlink ${NEW_ROOT}/${FS_LOCATION}/${x}`" "${x}" 2>/dev/null
+			ln -s "$(readlink ${NEW_ROOT}/${FS_LOCATION}/${x})" "${x}" 2>/dev/null
 		else
 			# List all subdirectories of x
 			find "${NEW_ROOT}/${FS_LOCATION}/${x}" -type d 2>/dev/null | while read directory
@@ -665,7 +665,7 @@ then
 
 				# Skip this directory if we already linked a parent directory
 				if [ "${current_parent}" != '' ]; then
-					var=`echo "${directory}" | grep "^${current_parent}"`
+					var=$(echo "${directory}" | grep "^${current_parent}")
 					if [ "${var}" != '' ]; then
 						continue
 					fi
@@ -674,7 +674,7 @@ then
 				if [ -e "/${NEW_ROOT}/${directory}" ]
 				then
 					# It does exist, link all the individual files
-					for file in `ls /${NEW_ROOT}/${FS_LOCATION}/${directory}`
+					for file in $(ls /${NEW_ROOT}/${FS_LOCATION}/${directory})
 					do
 					if [ ! -d "/${NEW_ROOT}/${FS_LOCATION}/${directory}/${file}" ] && [ ! -e "${NEW_ROOT}/${directory}/${file}" ]; then
 							ln -s "/${FS_LOCATION}/${directory}/${file}" "${directory}/${file}" 2> /dev/null
@@ -694,7 +694,7 @@ then
 
 	fi
 
-	#UML=`cat /proc/cpuinfo|grep UML|sed -e 's|model name.*: ||'`
+	#UML=$(cat /proc/cpuinfo|grep UML|sed -e 's|model name.*: ||')
 	#if [ "${UML}" = 'UML' ]
 	#then
 	#	# UML Fixes



             reply	other threads:[~2011-09-11  7:40 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-11  7:40 Fabio Erculiani [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-07-23 23:57 [gentoo-commits] proj/genkernel:master commit in: /, defaults/ Thomas Deutschmann
2019-11-26 13:50 Thomas Deutschmann
2019-07-21 16:26 Thomas Deutschmann
2017-09-04  5:36 Robin H. Johnson
2017-01-08  1:57 Robin H. Johnson
2017-01-07 23:50 Robin H. Johnson
2017-01-02 23:25 Robin H. Johnson
2016-05-16  6:55 Robin H. Johnson
2016-01-05 19:39 Robin H. Johnson
2016-01-05 19:39 Robin H. Johnson
2013-06-06  3:36 [gentoo-commits] proj/genkernel:ryao " Richard Yao
2013-06-03 23:49 ` [gentoo-commits] proj/genkernel:master " Richard Yao
2013-04-25  6:22 Fabio Erculiani
2012-10-16  0:03 Robin H. Johnson
2012-10-03 16:24 Sebastian Pipping
2012-08-30 16:20 Fabio Erculiani
2012-08-12 19:04 Sebastian Pipping
2012-07-24 18:01 Robin H. Johnson
2012-07-24 17:29 Robin H. Johnson
2012-07-24  8:29 Robin H. Johnson
2012-07-19 20:12 Richard Yao
2012-07-09 17:51 Sebastian Pipping
2012-07-08 17:05 Sebastian Pipping
2012-05-17 18:34 Sebastian Pipping
2012-03-17  1:27 Sebastian Pipping
2012-03-17  1:27 Sebastian Pipping
2012-03-17  1:27 Sebastian Pipping
2012-03-17  1:27 Sebastian Pipping
2012-02-20  6:58 Robin H. Johnson
2012-02-09  7:42 Robin H. Johnson
2012-02-06  9:35 Robin H. Johnson
2012-02-06  8:19 Robin H. Johnson
2012-01-14 23:22 Sebastian Pipping
2012-01-13 23:19 Sebastian Pipping
2012-01-13 23:19 Sebastian Pipping
2012-01-06  6:37 Robin H. Johnson
2011-11-08 17:21 Sebastian Pipping
2011-10-08 21:22 Fabio Erculiani
2011-09-13  9:54 Fabio Erculiani
2011-08-30 15:34 Sebastian Pipping
2011-07-27 17:38 Sebastian Pipping
2011-05-31 10:58 Sebastian Pipping

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d6696d0df6e1b31bf169fc34e2a9b0579f2af72d.lxnay@gentoo \
    --to=lxnay@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox