Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gnap-dev
Navigation:
Lists: gnap-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gnap-dev@g.o
From: "Philipp Riegger" <lists@...>
Subject: 06-feature-gnap_remaster-T.patch
Date: Thu, 5 Jul 2007 16:08:19 +0300 (EEST)
Index: tools/gnap_remaster
===================================================================
--- tools/gnap_remaster	(revision 55)
+++ tools/gnap_remaster	(working copy)
@@ -20,6 +20,7 @@
 	echo '  -b basefs       basefs.tar.bz2 file to use as base'
 	echo '  -d extdir       Directory where to find extensions'
 	echo '  -f              Force all answers to yes (dangerous !)'
+	echo '  -T gnap_tempdir Use given temp dir'
 	echo
 	echo "Please man ${GNAPNAME} for more details."
 }
@@ -32,7 +33,8 @@
 gbegin 'Checking parameters'

 # Read options
-while getopts ':he:k:m:o:g:b:d:f' options; do
+TEMPDIR=''
+while getopts ':he:k:m:o:g:b:d:fT:' options; do
 	case ${options} in
 		h ) usage
 			exit 0;;
@@ -44,6 +46,7 @@
 		b ) GNAPBASEFS="${OPTARG}";;
 		d ) GNAPEXTDIR="${OPTARG}";;
 		f ) FORCEYES=1;;
+		T ) TEMPDIR="${OPTARG}";;
 		* ) gtest 1 'Specified options are incomplete or unknown !';;
 	esac
 done
@@ -69,10 +72,19 @@
 	gconfirm "${OUTPUT} already exists, overwrite"
 fi

+# Setting up temporary directory
+if [[ "${TEMPDIR}" = "" ]]; then
+	TEMPDIR=$(mktemp -d -t gnap_remaster.XXXXXX)
+	gtest continued $? 'Failed to create temporary directory'
+elif [[ -d "${TEMPDIR}" ]]
+	gconfirm "${TEMPDIR} already exists. Continue?"
+else
+	mkdir -p "${TEMPDIR}"
+	gtest continued $? "Failed to create ${TEMPDIR}"
+fi
+
 # Preparing new FS
 gbegin "Unpacking ${GNAPBASEFS} basefs"
-TEMPDIR=$(mktemp -d -t gnap_remaster.XXXXXX)
-gtest continued $? 'Failed to create temporary directory'
 TEMPOVERDIR="${TEMPDIR}/basefs"
 mkdir "${TEMPOVERDIR}"
 gtest continued $? 'Failed to create basefs temporary subdirectory'

-- 
gnap-dev@g.o mailing list


References:
Some patches for gnap
-- Philipp Riegger
Navigation:
Lists: gnap-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
05-festure-gnap_overlay-T.patch
Next by thread:
07-split-make_tempdir.patch
Previous by date:
05-festure-gnap_overlay-T.patch
Next by date:
07-split-make_tempdir.patch


Updated Jun 17, 2009

Summary: Archive of the gnap-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.