1 |
Index: src/gnap_make |
2 |
=================================================================== |
3 |
--- src/gnap_make (revision 55) |
4 |
+++ src/gnap_make (revision 57) |
5 |
@@ -15,6 +15,7 @@ |
6 |
echo ' -l logfile Use specific log file prefix' |
7 |
echo ' -c catalyst.conf Use specific catalyst.conf file' |
8 |
echo ' -e specs Specs directory or tar.bz2 file' |
9 |
+ echo ' -T gnap_tempdir Use given temp dir' |
10 |
echo |
11 |
echo "Please man ${GNAPNAME} for more details." |
12 |
} |
13 |
@@ -29,7 +30,8 @@ |
14 |
# Read options |
15 |
NOTARGET=1 |
16 |
STAMP=$(date +%Y%m%d) |
17 |
-while getopts ':hs:p:m:o:v:t:fl:c:e:' options; do |
18 |
+TEMPDIR='' |
19 |
+while getopts ':hs:p:m:o:v:t:fl:c:e:T:' options; do |
20 |
case ${options} in |
21 |
h ) usage |
22 |
exit 0;; |
23 |
@@ -59,6 +61,7 @@ |
24 |
l ) GNAPLOGPREFIX="${OPTARG}";; |
25 |
c ) CATALYST_CONF="${OPTARG}";; |
26 |
e ) SPECS="${OPTARG}";; |
27 |
+ T ) TEMPDIR="${OPTARG}";; |
28 |
* ) gtest 1 'Specified options are incomplete or unknown !';; |
29 |
esac |
30 |
done |
31 |
@@ -68,8 +71,15 @@ |
32 |
gtest continued $? "You need to be root to run ${GNAPNAME}" |
33 |
|
34 |
# Setting up temporary directory |
35 |
-TEMPDIR=$(mktemp -d -t gnap_make.XXXXXX) |
36 |
-gtest continued $? 'Failed to create temporary directory' |
37 |
+if [[ "${TEMPDIR}" = "" ]]; then |
38 |
+ TEMPDIR=$(mktemp -d -t gnap_make.XXXXXX) |
39 |
+ gtest continued $? 'Failed to create temporary directory' |
40 |
+elif [[ -d "${TEMPDIR}" ]] |
41 |
+ gconfirm "${TEMPDIR} already exists. Continue?" |
42 |
+else |
43 |
+ mkdir -p "${TEMPDIR}" |
44 |
+ gtest continued $? "Failed to create ${TEMPDIR}" |
45 |
+fi |
46 |
|
47 |
# Prepare specs dir and check common.conf file |
48 |
SPECDIR="${TEMPDIR}/specs" |
49 |
|
50 |
-- |
51 |
gnap-dev@g.o mailing list |