Gentoo Archives: gnap-dev

From: Philipp Riegger <lists@××××××××××××.de>
To: gnap-dev@l.g.o
Subject: [gnap-dev] [PATCH] Custom GNAP TEMPDIR in gnap_make
Date: Thu, 21 Jun 2007 11:49:03
Message-Id: F2E92FC5-5C44-4542-8E6A-54B2DC580BF2@anderedomain.de
1 Good day.
2
3 I though it might be nice to be able to tell gnap_make which tempdir
4 to use. I can think of 2 scenarios where this will make sense:
5
6 - /tmp does not have that much space and the portage snapshot/the
7 overlays are big. At the moment overlays are rsynced (or something
8 like that) over the portage snapshot, therefore the snapshot is
9 unpacked into /tmp and this might be very very big. My patch enables
10 the user to use /var/tmp or whatever instead.
11
12 - For debugging and development purposes, it might be interesting
13 to use catalyst directly. A reason for that might be that more
14 advanced festures are wanted and gnap_make does not support them yet.
15
16 In future versions of gnap i'd also like to have better support for
17 resume (possibly reuse of the TEMPDIR) and something like a no-
18 cleanup flag (since the tempdir is deleted after gnap_make). I'll
19 look into that, soon.
20
21 This patch was made after a not that small change in the generl
22 structure of gnap_make, i will try to send those patches today. If
23 this patch does not apply, it is due to a big difference in line
24 numbers.
25
26 Feedback and comments are welcome,
27 Philipp
28
29 Index: gnap_make
30 ===================================================================
31 --- gnap_make (revision 44)
32 +++ gnap_make (working copy)
33 @@ -15,6 +15,7 @@
34 echo ' -l logfile Use specific log file prefix'
35 echo ' -c catalyst.conf Use specific catalyst.conf file'
36 echo ' -e specs Specs directory or tar.bz2 file'
37 + echo ' -T gnap_tempdir Use specific temp dir'
38 echo
39 echo "Please man ${GNAPNAME} for more details."
40 }
41 @@ -29,7 +30,7 @@
42 # Read options
43 NOTARGET=1
44 STAMP=$(date +%Y%m%d)
45 -while getopts ':hs:p:m:o:v:t:fl:c:e:' options; do
46 +while getopts ':hs:p:m:o:v:t:fl:c:e:T:' options; do
47 case ${options} in
48 h ) usage
49 exit 0;;
50 @@ -60,6 +61,7 @@
51 l ) GNAPLOGPREFIX="${OPTARG}";;
52 c ) CATALYST_CONF="${OPTARG}";;
53 e ) SPECS="${OPTARG}";;
54 + T ) TEMPDIR="${OPTARG}";;
55 * ) gtest 1 'Specified options are incomplete or
56 unknown!';;
57 esac
58 done
59 @@ -69,8 +71,18 @@
60 gtest continued $? "You need to be root to run ${GNAPNAME}"
61 # Setting up temporary directory
62 -TEMPDIR=$(mktemp -d -t gnap_make.XXXXXX)
63 -gtest continued $? 'Failed to create temporary directory'
64 +if [[ "${TEMPDIR}" = "" ]]; then
65 + TEMPDIR=$(mktemp -d -t gnap_make.XXXXXX)
66 + gtest continued $? 'Failed to create temporary directory'
67 +else
68 + test -d "${TEMPDIR}" && \
69 + gconfirm "${TEMPDIR} already exists. If this
70 directory is used " \
71 + "there might be side effects due to existing
72 files and the " \
73 + "directory will be deleted when the program
74 terminates. " \
75 + "Continue?"
76 + mkdir -p "${TEMPDIR}"
77 + gtest continued $? "Failed to create ${TEMPDIR}"
78 +fi
79 # Prepare specs dir and check common.conf file
80 SPECDIR="${TEMPDIR}/specs"

Attachments

File name MIME type
PGP.sig application/pgp-signature

Replies

Subject Author
Re: [gnap-dev] [PATCH] Custom GNAP TEMPDIR in gnap_make "josé Alberto Suárez López" <bass@g.o>