[Fai-commit] r6751 - trunk/examples/simple/basefiles
Thomas Lange
lange at alioth.debian.org
Sat Oct 22 23:45:20 UTC 2011
Author: lange
Date: 2011-10-22 23:45:19 +0000 (Sat, 22 Oct 2011)
New Revision: 6751
Modified:
trunk/examples/simple/basefiles/mk-basefile
Log:
add optiopn -d for target directory, set default to /var/tmp
Modified: trunk/examples/simple/basefiles/mk-basefile
===================================================================
--- trunk/examples/simple/basefiles/mk-basefile 2011-10-22 23:40:48 UTC (rev 6750)
+++ trunk/examples/simple/basefiles/mk-basefile 2011-10-22 23:45:19 UTC (rev 6751)
@@ -18,12 +18,6 @@
# debootstrap, rinse, xz-utils
-xtmp=$(mktemp -d /tmp/basefiles.XXXXXXXX)
-if [ $? -eq 1 ]; then
- echo "mktemp failed. Aborting."
- exit 2
-fi
-
# Define your local mirros here
# For the first stage, set the CentOS/SLC mirror in /etc/rinse/rinse.conf
MIRROR_DEBIAN=http://cdn.debian.net/debian/
@@ -201,15 +195,22 @@
ext=tar
zip=cat
+tmpdir=/var/tmp
-while getopts zJ opt ; do
+while getopts zJd: opt ; do
case "$opt" in
+ d) tmpdir=$OPTARG ;;
z) zip="gzip -9"; ext=tar.gz ;;
J) zip="xz -8" ext=tar.xz ;;
esac
done
shift $(($OPTIND - 1))
+xtmp=$(mktemp -d $tmpdir/basefiles.XXXXXXXX)
+if [ $? -eq 1 ]; then
+ echo "mktemp failed. Aborting."
+ exit 2
+fi
target=$1 # also the name of the output file
More information about the Fai-commit
mailing list