aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/init.d/functions
diff options
context:
space:
mode:
authorMiloslav Trmac <mitr@volny.cz>2006-07-27 02:17:03 +0000
committerMiloslav Trmac <mitr@volny.cz>2006-07-27 02:17:03 +0000
commit3db5ad738151d27001658d570bce0c61648fc2cc (patch)
treefcb9a69ac7f3896e0636f929fd87f13828c51852 /rc.d/init.d/functions
parent02315ee166c1625d9524a783a1ad49383a4623db (diff)
downloadinitscripts-3db5ad738151d27001658d570bce0c61648fc2cc.tar
initscripts-3db5ad738151d27001658d570bce0c61648fc2cc.tar.gz
initscripts-3db5ad738151d27001658d570bce0c61648fc2cc.tar.bz2
initscripts-3db5ad738151d27001658d570bce0c61648fc2cc.tar.xz
initscripts-3db5ad738151d27001658d570bce0c61648fc2cc.zip
Consistently exclude backup files when globbing
Diffstat (limited to 'rc.d/init.d/functions')
-rwxr-xr-xrc.d/init.d/functions12
1 files changed, 12 insertions, 0 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index 19a86c16..2576f463 100755
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -573,3 +573,15 @@ resolve_dm_name() {
/sbin/dmsetup table | egrep -iv "no block devices found|No devices found" | sed -n "s/\(^[^:]\+\): $newline\( \+$\|$\)/\1/p"
) 2>/dev/null
}
+
+# Check whether file $1 is a backup or rpm-generated file and should be ignored
+is_ignored_file() {
+ case "$1" in
+ *~ | *.bak | *.orig | *.rpmnew | *.rpmorig | *.rpmsave)
+ return 0
+ ;;
+ esac
+ return 1
+}
+# A sed expression to filter out the files that is_ignored_file recognizes
+__sed_discard_ignored_files='/\(~\|\.bak\|\.orig\|\.rpmnew\|\.rpmorig\|\.rpmsave\)$/d'