From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.62) (envelope-from <gnap-dev+bounces-32-garchives=archives.gentoo.org@gentoo.org>) id 1I6R4I-0006cD-Lm for garchives@archives.gentoo.org; Thu, 05 Jul 2007 13:08:23 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.0/8.14.0) with SMTP id l65D8KKf009163; Thu, 5 Jul 2007 13:08:20 GMT Received: from mail.bawue.net (phoenix.bawue.net [193.7.176.60]) by robin.gentoo.org (8.14.0/8.14.0) with ESMTP id l65D8JxR009144 for <gnap-dev@lists.gentoo.org>; Thu, 5 Jul 2007 13:08:19 GMT Received: from my.bawue.net (imap.bawue.net [193.7.176.64]) by mail.bawue.net (Postfix) with ESMTP id 960C5B9292 for <gnap-dev@lists.gentoo.org>; Thu, 5 Jul 2007 15:08:19 +0200 (CEST) Received: from 130.230.11.107 (SquirrelMail authenticated user stoile) by my.bawue.net with HTTP; Thu, 5 Jul 2007 16:08:19 +0300 (EEST) Message-ID: <44062.130.230.11.107.1183640899.squirrel@my.bawue.net> In-Reply-To: <59506.130.230.11.107.1183640031.squirrel@my.bawue.net> References: <59506.130.230.11.107.1183640031.squirrel@my.bawue.net> Date: Thu, 5 Jul 2007 16:08:19 +0300 (EEST) Subject: [gnap-dev] 06-feature-gnap_remaster-T.patch From: "Philipp Riegger" <lists@anderedomain.de> To: gnap-dev@lists.gentoo.org User-Agent: SquirrelMail/1.4.2 Precedence: bulk List-Post: <mailto:gnap-dev@lists.gentoo.org> List-Help: <mailto:gnap-dev+help@gentoo.org> List-Unsubscribe: <mailto:gnap-dev+unsubscribe@gentoo.org> List-Subscribe: <mailto:gnap-dev+subscribe@gentoo.org> List-Id: Gentoo GNAP development <gnap-dev.gentoo.org> X-BeenThere: gnap-dev@gentoo.org Reply-to: gnap-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal X-Archives-Salt: 068de88d-f48e-4344-9546-2bb48c64a6ae X-Archives-Hash: 543517d6055a5a60354dd258af6e6251 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@gentoo.org mailing list