[Fai-commit] r4331 - in trunk: bin man

lange at alioth.debian.org lange at alioth.debian.org
Wed Jun 13 10:48:25 UTC 2007


Author: lange
Date: 2007-06-13 10:48:25 +0000 (Wed, 13 Jun 2007)
New Revision: 4331

Modified:
   trunk/bin/fai-cd
   trunk/man/fai-cd.8
Log:
add option -f, force removal of an existing ISO image


Modified: trunk/bin/fai-cd
===================================================================
--- trunk/bin/fai-cd	2007-06-13 10:38:38 UTC (rev 4330)
+++ trunk/bin/fai-cd	2007-06-13 10:48:25 UTC (rev 4331)
@@ -32,6 +32,7 @@
 set -e 
 version="fai-cd 3.0.1, 13 june 2007"
 
+forceremoval=0;
 burn=0
 hidedirs="/usr/share/locale /usr/share/doc /var/lib/apt /var/cache/apt /usr/share/man /var/lib/dpkg/info /media/mirror/aptcache /media/mirror/.apt-move"
 
@@ -170,9 +171,10 @@
 esac
 
 # Parse commandline options
-while getopts "hg:bm:C:" opt ; do
+while getopts "fhg:bm:C:" opt ; do
     case "$opt" in
-        C) cfdir=$OPTARG ;;
+        C)  cfdir=$OPTARG ;;
+	f)  forceremoval=1 ;;
 	h)  usage ;;
 	g)  grub_config="$OPTARG" ;;
 	m)  mirrordir="$OPTARG" ;;
@@ -186,6 +188,7 @@
 [ "$#" -eq 0 ]        && die 2 "Please specify the output file for the ISO image."
 [ -z "$mirrordir" ]   && die 4 "Please specify the directory of your mirror using -m"
 [ -d "$mirrordir" ]   || die 5 "$mirrordir is not a directory"
+[ -f "$isoname" ]     && [ $forceremoval -eq 1 ] && rm $isoname
 [ -f "$isoname" ]     && die 3 "Outputfile $isoname already exists. Please remove it."
 [ $(id -u) != "0" ]   && die 9 "Run this program as root."
 

Modified: trunk/man/fai-cd.8
===================================================================
--- trunk/man/fai-cd.8	2007-06-13 10:38:38 UTC (rev 4330)
+++ trunk/man/fai-cd.8	2007-06-13 10:48:25 UTC (rev 4331)
@@ -1,7 +1,7 @@
 .\"                                      Hey, EMACS: -*- nroff -*-
 .if \n(zZ=1 .ig zZ
 .if \n(zY=1 .ig zY
-.TH fai-cd 8 "24 march 2005" "FAI 2.7"
+.TH fai-cd 8 "13 june 2007" "FAI 3.2"
 .\" Please adjust this date whenever revising the manpage.
 .\"
 .\" Some roff macros, for reference:
@@ -51,6 +51,9 @@
 .BI \-b
 After creating the ISO image burn it by calling cdrecord(1).
 .TP
+.BI \-f
+Force removal of an existin ISO image before creating a new one.
+.TP
 .BI "\-g " FILE
 Use FILE as grub menu.lst file. If not specified, use /etc/fai/menu.lst.
 .TP




More information about the Fai-commit mailing list