[Fai-commit] r4909 - trunk/bin

lange at alioth.debian.org lange at alioth.debian.org
Wed May 21 13:21:45 UTC 2008


Author: lange
Date: 2008-05-21 13:21:44 +0000 (Wed, 21 May 2008)
New Revision: 4909

Modified:
   trunk/bin/fai-cd
Log:
check if list of Packages files is non-empty,
change syntax of ${...:=...}


Modified: trunk/bin/fai-cd
===================================================================
--- trunk/bin/fai-cd	2008-05-21 13:20:40 UTC (rev 4908)
+++ trunk/bin/fai-cd	2008-05-21 13:21:44 UTC (rev 4909)
@@ -30,7 +30,7 @@
 #*********************************************************************
 
 set -e 
-version="fai-cd 3.3.2, 13-may-2008"
+version="fai-cd 3.3.3, 20-may-2008"
 
 forceremoval=0;
 burn=0
@@ -178,7 +178,8 @@
 EOF
 
     dists=$(find $mirrordir -name "Packages*" | grep binary | sed 's/binary-.*//' | \
-         sed "s#$mirrordir/*dists/##" | xargs -n 1 dirname | uniq )
+         sed "s#$mirrordir/*dists/##" | xargs -r -n 1 dirname | sort | uniq )
+    [ -z "$dists" ] && die 19 "No suitable Packages file found in mirror."
 
     for i in $dists ; do
 	comp=$(find $mirrordir/dists/$i -maxdepth 2 -type d -name "binary-*" | \
@@ -257,7 +258,7 @@
     cfdir=$FAI_ETC_DIR
 fi
 [ -n "$cdir" ] && cfdir=$cdir
-cfdir=${cfdir:=/etc/fai}
+: ${cfdir:=/etc/fai}
 cfdir=$(readlink -f $cfdir) # canonicalize path
 if [ ! -d "$cfdir" ]; then
     echo "$cfdir is not a directory"




More information about the Fai-commit mailing list