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 |