summaryrefslogtreecommitdiff
path: root/sys-fs
diff options
context:
space:
mode:
authorDoug Goldstein <cardoe@gentoo.org>2007-05-21 14:05:37 +0000
committerDoug Goldstein <cardoe@gentoo.org>2007-05-21 14:05:37 +0000
commit91516e3b2f356806bd1384774ae6f251d291dc5f (patch)
tree6cd796deb537d17642ee752258fc9affe118116e /sys-fs
parentRemove old (diff)
downloadgentoo-2-91516e3b2f356806bd1384774ae6f251d291dc5f.tar.gz
gentoo-2-91516e3b2f356806bd1384774ae6f251d291dc5f.tar.bz2
gentoo-2-91516e3b2f356806bd1384774ae6f251d291dc5f.zip
de-bash-ification by Uberlord
(Portage version: 2.1.2.7)
Diffstat (limited to 'sys-fs')
-rw-r--r--sys-fs/device-mapper/ChangeLog5
-rw-r--r--sys-fs/device-mapper/files/dm-start.sh26
2 files changed, 15 insertions, 16 deletions
diff --git a/sys-fs/device-mapper/ChangeLog b/sys-fs/device-mapper/ChangeLog
index 5246493a2993..0ca9300521ce 100644
--- a/sys-fs/device-mapper/ChangeLog
+++ b/sys-fs/device-mapper/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for sys-fs/device-mapper
# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/device-mapper/ChangeLog,v 1.62 2007/05/14 08:48:42 robbat2 Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/device-mapper/ChangeLog,v 1.63 2007/05/21 14:05:37 cardoe Exp $
+
+ 21 May 2007; Doug Goldstein <cardoe@gentoo.org> files/dm-start.sh:
+ de-bash-ification by Uberlord
*device-mapper-1.02.19 (14 May 2007)
diff --git a/sys-fs/device-mapper/files/dm-start.sh b/sys-fs/device-mapper/files/dm-start.sh
index 01b056165d84..d3d0287b2f58 100644
--- a/sys-fs/device-mapper/files/dm-start.sh
+++ b/sys-fs/device-mapper/files/dm-start.sh
@@ -1,5 +1,5 @@
# /lib/rcscripts/addons/dm-start.sh: Setup DM volumes at boot
-# $Header: /var/cvsroot/gentoo-x86/sys-fs/device-mapper/files/dm-start.sh,v 1.3 2006/11/01 19:02:56 dsd Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-fs/device-mapper/files/dm-start.sh,v 1.4 2007/05/21 14:05:37 cardoe Exp $
# char **get_new_dm_volumes(void)
#
@@ -25,14 +25,14 @@ get_new_dm_volumes() {
dmvolume_exists() {
local x line volume=$1
- [[ -z ${volume} ]] && return 1
+ [ -z "${volume}" ] && return 1
/sbin/dmsetup ls 2>/dev/null | \
while read line ; do
for x in ${line} ; do
# the following conditonal return only breaks out
# of the while loop, as it is running in a pipe.
- [[ ${x} == "${volume}" ]] && return 1
+ [ "${x}" = "${volume}" ] && return 1
# We only want to check the volume name
break
done
@@ -40,7 +40,7 @@ dmvolume_exists() {
# if 1 was returned from the above loop, then indicate that
# volume exists
- [[ $? == 1 ]] && return 0
+ [ $? = 1 ] && return 0
# otherwise the loop exited normally and the volume does not
# exist
@@ -53,33 +53,29 @@ dmvolume_exists() {
is_empty_dm_volume() {
local table volume=$1
- table=$(/sbin/dmsetup table 2>/dev/null | grep -e "^${volume}:")
-
- # dmsetup seems to print an space after the colon for the moment
- [[ -n ${table} && -z ${table/${volume}:*} ]] && return 0
-
- return 1
+ set -- $(/sbin/dmsetup table 2>/dev/null | grep -e "^${volume}:")
+ [ "${volume}" = "$1" -a -z "$2" ]
}
local x volume
-if [[ -x /sbin/dmsetup && -c /dev/mapper/control && -f /etc/dmtab ]] ; then
- [[ -n $(get_new_dm_volumes) ]] && \
+if [ -x /sbin/dmsetup -a -c /dev/mapper/control -a -f /etc/dmtab ] ; then
+ [ -n "$(get_new_dm_volumes)" ] && \
einfo " Setting up device-mapper volumes:"
get_new_dm_volumes | \
while read x ; do
- [[ -n ${x} ]] || continue
+ [ -n "${x}" ] || continue
volume="${x##* }"
ebegin " Creating volume: ${volume}"
- if ! eval ${x} &>/dev/null ; then
+ if ! eval "${x}" >/dev/null 2>/dev/null ; then
eend 1 " Error creating volume: ${volume}"
# dmsetup still adds an empty volume in some cases,
# so lets remove it
is_empty_dm_volume "${volume}" && \
- /sbin/dmsetup remove "${volume}" &>/dev/null
+ /sbin/dmsetup remove "${volume}" 2>/dev/null
else
eend 0
fi