when building new vservers allow empty directories for their roots
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Fri, 28 Oct 2005 18:40:39 +0000 (18:40 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Fri, 28 Oct 2005 18:40:39 +0000 (18:40 +0000)
improved error messages a little bit

git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2199 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/scripts/vserver-build.functions

index 18c3c85..4d78cdd 100644 (file)
@@ -105,7 +105,7 @@ function _renameVserverCfg
     local i
     
     for i in "$VDIR" "$SETUP_CONFDIR"; do
-       test ! -e "$i" || {
+       test ! -e "$i" || isDirectoryEmpty "$i" || {
            mv "$i" "$i$suffix"
            say "Renamed '$i' to '$i$suffix'"
        }
@@ -164,13 +164,9 @@ function base._addGeneratedFile
 function base.initFilesystem
 {
     test -z "$1" || _renameVserverCfg
-    test isDirectoryEmpty "$VDIR" -a ! -e "$SETUP_CONFDIR" || {
-       echo \
-"vserver-topdirectory '$VDIR' and/or configuration at '$SETUP_CONFDIR'
-exist already; please try to use '--force', or remove them manually"
->&2
-       exit 1
-    } >&2
+    { isDirectoryEmpty "$VDIR" && test  ! -e "$SETUP_CONFDIR"; } || colpanic $"\
+vserver-topdirectory '$VDIR' and/or configuration at '$SETUP_CONFDIR'
+exist already; please try to use '--force', or remove them manually."
 
     mkdir -p -m755 "$VDIR"
     chattr -t "$VDIR"