On Sun, 27 Jan 2013, Niels Thykier wrote:
>
> You refer to a patch "0015", but it does not appear to be attached
> (instead "0016" appears twice).
Thanks Niels for pointing that out.
0015 patch attached here.
Cheers,
--
Cristian
From b601a2cb04e5a533d74c7816a8ab696de3d0efb7 Mon Sep 17 00:00:00 2001
From: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
Date: Sun, 27 Jan 2013 09:05:06 +0100
Subject: [PATCH 15/21] List fstab files without forking `ls', `grep' nor
`sed' and no pipes.
Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbo...@axis.com>
---
debian/src/initscripts/lib/init/mount-functions.sh | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/debian/src/initscripts/lib/init/mount-functions.sh b/debian/src/initscripts/lib/init/mount-functions.sh
index 3a526b9..67a4578 100644
--- a/debian/src/initscripts/lib/init/mount-functions.sh
+++ b/debian/src/initscripts/lib/init/mount-functions.sh
@@ -6,10 +6,17 @@
# List available fstab files, including any files in /etc/fstab.d.
# This looks ugly, but we can't use find and it's safer than globbing.
fstab_files() {
- echo /etc/fstab
- if [ -d /etc/fstab.d ]; then
- ls -1 /etc/fstab.d | grep '\.fstab$' | sed -e 's;^;/etc/fstab.d/;'
- fi
+ _fstab=/etc/fstab
+ echo $_fstab
+ _fstabd="$_fstab.d/*.fstab"
+ for _f in $_fstabd; do
+ case "$_f" in
+ "$_fstabd")
+ break
+ ;;
+ esac
+ echo $_f
+ done
}
# $1: directory
--
1.7.10.4