From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Kw0HY-0003cU-Jo for garchives@archives.gentoo.org; Fri, 31 Oct 2008 20:07:44 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 08590E025F; Fri, 31 Oct 2008 20:07:44 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id B2CE2E025F for ; Fri, 31 Oct 2008 20:07:43 +0000 (UTC) Received: from stork.gentoo.org (stork.gentoo.org [64.127.104.133]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 06C2564A04 for ; Fri, 31 Oct 2008 20:07:42 +0000 (UTC) Received: from dsd by stork.gentoo.org with local (Exim 4.69) (envelope-from ) id 1Kw0HV-0007CN-Ld for gentoo-commits@lists.gentoo.org; Fri, 31 Oct 2008 20:07:41 +0000 From: "Daniel Drake (dsd)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, dsd@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in sys-fs/udftools/files: pktcdvd.init X-VCS-Repository: gentoo-x86 X-VCS-Files: pktcdvd.init X-VCS-Directories: sys-fs/udftools/files X-VCS-Committer: dsd X-VCS-Committer-Name: Daniel Drake Content-Type: text/plain; charset=utf8 Message-Id: Sender: Daniel Drake Date: Fri, 31 Oct 2008 20:07:41 +0000 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 873e92c2-5c33-430a-aeae-3e59f0b5f9bf X-Archives-Hash: 9a82506aca011cbfce0f6ddbfb8c8942 dsd 08/10/31 20:07:41 Modified: pktcdvd.init Log: Make pktcdvd initscript POSIX-compatible, patch from Martin V=C3=A4th = 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/fi= les/pktcdvd.init?rev=3D1.2&view=3Dmarkup plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udftools/fi= les/pktcdvd.init?rev=3D1.2&content-type=3Dtext/plain diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-fs/udftools/fi= les/pktcdvd.init?r1=3D1.1&r2=3D1.2 Index: pktcdvd.init =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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 $ =20 depend() { need localmount modules } =20 checkconfig() { - if [[ ! -e /dev/pktcdvd/control ]]; then + if ! [ -e /dev/pktcdvd/control ]; then eerror "Could not find packet-writing control device at /dev/pktcdvd/c= ontrol" eerror "Please ensure that your kernel includes packet writing support= ," eerror "and if modular, ensure that the module is loaded." @@ -18,15 +18,19 @@ =20 get_rw_devices() { devices_raw=3D$(sed -re '/^drive name:/I!d; s/.*:\s+//' /proc/sys/dev/c= drom/info) - devices=3D($devices_raw) + count=3D0 + for i in $devices_raw; do + eval "devices_$count=3D\"\$i\"" + count=3D$(( $count + 1 )) + done devs=3D"" =20 cdrw_caps=3D$(sed -re '/^Can write CD-RW:/I!d; s/.*:\s+//' /proc/sys/de= v/cdrom/info) =20 count=3D0 for i in $cdrw_caps; do - [[ $i =3D=3D 1 ]] && devs=3D"${devs} ${devices[$count]}" - ((count++)) + [ "$i" -eq 1 ] && eval "devs=3D\"\$devs \$devices_$count\"" + count=3D$(( $count + 1 )) done =20 echo ${devs} @@ -38,12 +42,12 @@ for i in $(get_rw_devices) do devnode=3D"/dev/${i}" - [[ ! -e ${devnode} ]] && continue + [ -e "${devnode}" ] || continue =20 - /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 } =20 @@ -52,7 +56,7 @@ =09 for i in $(get_rw_devices) do - /usr/bin/pktsetup -d ${i} > /dev/null + /usr/bin/pktsetup -d "${i}" > /dev/null done } =20