[Fai-commit] r3849 - trunk/bin

fai-commit at lists.alioth.debian.org fai-commit at lists.alioth.debian.org
Tue Sep 5 12:04:39 UTC 2006


Author: lange
Date: 2006-09-05 12:04:39 +0000 (Tue, 05 Sep 2006)
New Revision: 3849

Modified:
   trunk/bin/make-fai-nfsroot
Log:
use die() function for fatal error messages


Modified: trunk/bin/make-fai-nfsroot
===================================================================
--- trunk/bin/make-fai-nfsroot	2006-09-05 10:03:58 UTC (rev 3848)
+++ trunk/bin/make-fai-nfsroot	2006-09-05 12:04:39 UTC (rev 3849)
@@ -30,7 +30,7 @@
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 die() {
 
-    echo "$@"
+    echo "ERROR: $@"
     exit 99
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -78,24 +78,15 @@
     exit 8
 fi
 
-[ -n "$packages" ] && die "WARNING: The use of \$packages in make-fai-nfsroot.conf is now deprecated. Please include this information into $cfdir/NFSROOT."
-[ -n "$NFSROOT_PACKAGES" ] && die "WARNING: The use of \$NFSROOT_PACKAGES in make-fai-nfsroot.conf is now deprecated. Please include this information into $cfdir/NFSROOT."
+# IMO this may be removed, since all information should be included into sources.list
+[ -n "$FAI_LOCAL_REPOSITORY" ] && die "The use of \$FAI_LOCAL_REPOSITORY is now deprecated. Please include this information into sources.list." 
+[ -n "$packages" ] && die "The use of \$packages in make-fai-nfsroot.conf is now deprecated. Please include this information into $cfdir/NFSROOT."
+[ -n "$NFSROOT_PACKAGES" ] && die "The use of \$NFSROOT_PACKAGES in make-fai-nfsroot.conf is now deprecated. Please include this information into $cfdir/NFSROOT."
+[ -n "$FAI_SOURCES_LIST" ] && die "The use of \$FAI_SOURCES_LIST is deprecated. Please use sources.list now."
 
-if [ -z "$NFSROOT" ]; then
-    echo "\$NFSROOT is not set. Please check your settings in $cfdir/fai.conf."
-    exit 4
-fi
+[ -z "$NFSROOT" ] && die "\$NFSROOT is not set. Please check your settings in $cfdir/fai.conf."
+[ ! -d "$cfdir/apt" ] && die "$cfdir/apt/ does not exists. Can't continue."
 
-if [ "$FAI_SOURCES_LIST" ]; then
-    echo "The usage of the variable \$FAI_SOURCES_LIST is deprecated. Please use sources.list now."
-    exit 3
-fi
-
-if [ ! -d "$cfdir/apt" ]; then
-    echo "$cfdir/apt/ does not exists. Can't continue."
-    exit 7
-fi
-
 ROOTCMD="chroot $NFSROOT"
 
 RUNDIR=/var/run/fai/make-fai-nfsroot
@@ -217,7 +208,7 @@
 create_nfsroot() {
 
     mkdir -p $NFSROOT/$FAI
-    cd $NFSROOT || die "Error: Can't cd to $NFSROOT"
+    cd $NFSROOT || die "Can't cd to $NFSROOT"
 
     call_with_stamp create_base
     # save the list of all packages in the base.tgz
@@ -300,8 +291,6 @@
 EOF
     chmod a+rx $NFSROOT/etc/rc2.d/S01fai_abort
 
-    # IMO this may be removed, since all information should be included into sources.list
-    [ -n "$FAI_LOCAL_REPOSITORY" ] && echo "WARNING: The use of \$FAI_LOCAL_REPOSITORY is now deprecated. Please include this information into sources.list." || true
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 upgrade_nfsroot() {




More information about the Fai-commit mailing list