public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [gentoo-commits] gentoo-x86 commit in sys-fs/udftools/files: pktcdvd.init
@ 2008-10-31 20:07 99% Daniel Drake (dsd)
  0 siblings, 0 replies; 1+ results
From: Daniel Drake (dsd) @ 2008-10-31 20:07 UTC (permalink / raw
  To: gentoo-commits

dsd         08/10/31 20:07:41

  Modified:             pktcdvd.init
  Log:
  Make pktcdvd initscript POSIX-compatible, patch from  Martin Väth in bug #192420
  (Portage version: 2.2_rc12/cvs/Linux 2.6.27-gentoo-r2 i686)

Revision  Changes    Path
1.2                  sys-fs/udftools/files/pktcdvd.init

file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udftools/files/pktcdvd.init?rev=1.2&view=markup
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udftools/files/pktcdvd.init?rev=1.2&content-type=text/plain
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udftools/files/pktcdvd.init?r1=1.1&r2=1.2

Index: pktcdvd.init
===================================================================
RCS file: /var/cvsroot/gentoo-x86/sys-fs/udftools/files/pktcdvd.init,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pktcdvd.init	5 Sep 2005 22:10:58 -0000	1.1
+++ pktcdvd.init	31 Oct 2008 20:07:41 -0000	1.2
@@ -1,14 +1,14 @@
 #!/sbin/runscript
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License, v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/udftools/files/pktcdvd.init,v 1.1 2005/09/05 22:10:58 dsd Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/udftools/files/pktcdvd.init,v 1.2 2008/10/31 20:07:41 dsd Exp $
 
 depend() {
 	need localmount modules
 }
 
 checkconfig() {
-	if [[ ! -e /dev/pktcdvd/control ]]; then
+	if ! [ -e /dev/pktcdvd/control ]; then
 		eerror "Could not find packet-writing control device at /dev/pktcdvd/control"
 		eerror "Please ensure that your kernel includes packet writing support,"
 		eerror "and if modular, ensure that the module is loaded."
@@ -18,15 +18,19 @@
 
 get_rw_devices() {
 	devices_raw=$(sed -re '/^drive name:/I!d; s/.*:\s+//' /proc/sys/dev/cdrom/info)
-	devices=($devices_raw)
+	count=0
+	for i in $devices_raw; do
+		eval "devices_$count=\"\$i\""
+		count=$(( $count + 1 ))
+	done
 	devs=""
 
 	cdrw_caps=$(sed -re '/^Can write CD-RW:/I!d; s/.*:\s+//' /proc/sys/dev/cdrom/info)
 
 	count=0
 	for i in $cdrw_caps; do
-		[[ $i == 1 ]] && devs="${devs} ${devices[$count]}"
-		((count++))
+		[ "$i" -eq 1 ] && eval "devs=\"\$devs \$devices_$count\""
+		count=$(( $count + 1 ))
 	done
 
 	echo ${devs}
@@ -38,12 +42,12 @@
 	for i in $(get_rw_devices)
 	do
 		devnode="/dev/${i}"
-		[[ ! -e ${devnode} ]] && continue
+		[ -e "${devnode}" ] || continue
 
-		/usr/bin/pktsetup ${i} ${devnode} > /dev/null
-		[[ ! -e /dev/pktcdvd/${i} ]] && continue
-		chmod 660 /dev/pktcdvd/${i}
-		chgrp cdrw /dev/pktcdvd/${i}
+		/usr/bin/pktsetup "${i}" "${devnode}" > /dev/null
+		[ -e "/dev/pktcdvd/${i}" ] || continue
+		chmod 660 "/dev/pktcdvd/${i}"
+		chgrp cdrw "/dev/pktcdvd/${i}"
 	done
 }
 
@@ -52,7 +56,7 @@
 	
 	for i in $(get_rw_devices)
 	do
-		/usr/bin/pktsetup -d ${i} > /dev/null
+		/usr/bin/pktsetup -d "${i}" > /dev/null
 	done
 }
 






^ permalink raw reply	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2008-10-31 20:07 99% [gentoo-commits] gentoo-x86 commit in sys-fs/udftools/files: pktcdvd.init Daniel Drake (dsd)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox