isRegularFile(): added
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Sat, 16 Apr 2005 21:19:05 +0000 (21:19 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Sat, 16 Apr 2005 21:19:05 +0000 (21:19 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2029 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/scripts/functions

index 6b89210..f5987d8 100644 (file)
@@ -66,6 +66,18 @@ function findAndCopy
     $_CP -af "$tmp" "$dst"
 }
 
+## Usage: isRegularFile <filename>
+function isRegularFile
+{
+    test -f "$1" || return 1
+
+    case $file in
+       (*.rpmsave|*.rpmnew|*.rpmorig|*.cfsaved*|*.~*~) return 1;;
+    esac
+
+    return 0
+}
+
 function getPhysicalDir
 {
     ( set -P && cd "$1" && pwd )