Gentoo Archives: gnap-dev

From: Philipp Riegger <lists@××××××××××××.de>
To: gnap-dev@l.g.o
Subject: [gnap-dev] 06-feature-gnap_remaster-T.patch
Date: Thu, 05 Jul 2007 13:08:23
Message-Id: 44062.130.230.11.107.1183640899.squirrel@my.bawue.net
In Reply to: [gnap-dev] Some patches for gnap by Philipp Riegger
1 Index: tools/gnap_remaster
2 ===================================================================
3 --- tools/gnap_remaster (revision 55)
4 +++ tools/gnap_remaster (working copy)
5 @@ -20,6 +20,7 @@
6 echo ' -b basefs basefs.tar.bz2 file to use as base'
7 echo ' -d extdir Directory where to find extensions'
8 echo ' -f Force all answers to yes (dangerous !)'
9 + echo ' -T gnap_tempdir Use given temp dir'
10 echo
11 echo "Please man ${GNAPNAME} for more details."
12 }
13 @@ -32,7 +33,8 @@
14 gbegin 'Checking parameters'
15
16 # Read options
17 -while getopts ':he:k:m:o:g:b:d:f' options; do
18 +TEMPDIR=''
19 +while getopts ':he:k:m:o:g:b:d:fT:' options; do
20 case ${options} in
21 h ) usage
22 exit 0;;
23 @@ -44,6 +46,7 @@
24 b ) GNAPBASEFS="${OPTARG}";;
25 d ) GNAPEXTDIR="${OPTARG}";;
26 f ) FORCEYES=1;;
27 + T ) TEMPDIR="${OPTARG}";;
28 * ) gtest 1 'Specified options are incomplete or unknown !';;
29 esac
30 done
31 @@ -69,10 +72,19 @@
32 gconfirm "${OUTPUT} already exists, overwrite"
33 fi
34
35 +# Setting up temporary directory
36 +if [[ "${TEMPDIR}" = "" ]]; then
37 + TEMPDIR=$(mktemp -d -t gnap_remaster.XXXXXX)
38 + gtest continued $? 'Failed to create temporary directory'
39 +elif [[ -d "${TEMPDIR}" ]]
40 + gconfirm "${TEMPDIR} already exists. Continue?"
41 +else
42 + mkdir -p "${TEMPDIR}"
43 + gtest continued $? "Failed to create ${TEMPDIR}"
44 +fi
45 +
46 # Preparing new FS
47 gbegin "Unpacking ${GNAPBASEFS} basefs"
48 -TEMPDIR=$(mktemp -d -t gnap_remaster.XXXXXX)
49 -gtest continued $? 'Failed to create temporary directory'
50 TEMPOVERDIR="${TEMPDIR}/basefs"
51 mkdir "${TEMPOVERDIR}"
52 gtest continued $? 'Failed to create basefs temporary subdirectory'
53
54 --
55 gnap-dev@g.o mailing list