Accepting request 260523 from home:Ledest:misc

fix bashisms in pre script

OBS-URL: https://build.opensuse.org/request/show/260523
OBS-URL: https://build.opensuse.org/package/show/network:utilities/nbd?expand=0&rev=25
This commit is contained in:
Marcus Meissner 2014-11-10 10:16:19 +00:00 committed by Git OBS Bridge
parent e613a2a5da
commit b152c83e84
2 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Sun Nov 09 19:27:00 UTC 2014 - Led <ledest@gmail.com>
- fix bashisms in pre script
-------------------------------------------------------------------
Thu Apr 18 19:38:29 UTC 2013 - dmueller@suse.com

View File

@ -1,7 +1,7 @@
#
# spec file for package nbd
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -143,18 +143,20 @@ if test -e /etc/nbd-server.conf; then
# Do we have to create a generic section?
unset generic
if test -e /etc/nbd-server/config; then generic=1; fi
grep -vE '^(#|[[:blank:]]*$)' /etc/nbd-server.conf |
while read port file opts; do
if test -z "$port"; then continue; fi
if test "${port:0:1}" = "#"; then continue; fi
if test -z "$generic"; then
echo -e "[generic]\n\t# No generic options yet\n" > /etc/nbd-server/config
echo > /etc/nbd-server/config
echo "[generic]" >> /etc/nbd-server/config
echo " # No generic options yet" >> /etc/nbd-server/config
echo >> /etc/nbd-server/config
generic=1
fi
FN=${file%/*}
nm="cvt.$port.${FN##*/}.${file##*/}"
echo " ... convert $port $file $opts -> $nm"
/usr/bin/nbd-server $port $file $opts -o "$nm" >> /etc/nbd-server/config
done < /etc/nbd-server.conf
done
mv /etc/nbd-server.conf /etc/nbd-server.conf.converted
fi