Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gnap-dev
Navigation:
Lists: gnap-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gnap-dev@g.o
From: Philipp Riegger <lists@...>
Subject: [PATCH] Custom GNAP TEMPDIR in gnap_make
Date: Thu, 21 Jun 2007 14:48:45 +0300
Good day.

I though it might be nice to be able to tell gnap_make which tempdir  
to use. I can think of 2 scenarios where this will make sense:

   - /tmp does not have that much space and the portage snapshot/the  
overlays are big. At the moment overlays are rsynced (or something  
like that) over the portage snapshot, therefore the snapshot is  
unpacked into /tmp and this might be very very big. My patch enables  
the user to use /var/tmp or whatever instead.

   - For debugging and development purposes, it might be interesting  
to use catalyst directly. A reason for that might be that more  
advanced festures are wanted and gnap_make does not support them yet.

In future versions of gnap i'd also like to have better support for  
resume (possibly reuse of the TEMPDIR) and something like a no- 
cleanup flag (since the tempdir is deleted after gnap_make). I'll  
look into that, soon.

This patch was made after a not that small change in the generl  
structure of gnap_make, i will try to send those patches today. If  
this patch does not apply, it is due to a big difference in line  
numbers.

Feedback and comments are welcome,
     Philipp

Index: gnap_make
===================================================================
--- gnap_make   (revision 44)
+++ gnap_make   (working copy)
@@ -15,6 +15,7 @@
         echo '    -l logfile           Use specific log file prefix'
         echo '    -c catalyst.conf     Use specific catalyst.conf file'
         echo '    -e specs             Specs directory or tar.bz2 file'
+       echo '    -T gnap_tempdir      Use specific temp dir'
         echo
         echo "Please man ${GNAPNAME} for more details."
}
@@ -29,7 +30,7 @@
# Read options
NOTARGET=1
STAMP=$(date +%Y%m%d)
-while getopts ':hs:p:m:o:v:t:fl:c:e:' options; do
+while getopts ':hs:p:m:o:v:t:fl:c:e:T:' options; do
         case ${options} in
                 h ) usage
                         exit 0;;
@@ -60,6 +61,7 @@
                 l ) GNAPLOGPREFIX="${OPTARG}";;
                 c ) CATALYST_CONF="${OPTARG}";;
                 e ) SPECS="${OPTARG}";;
+               T ) TEMPDIR="${OPTARG}";;
                 * ) gtest 1 'Specified options are incomplete or  
unknown!';;
         esac
done
@@ -69,8 +71,18 @@
gtest continued $? "You need to be root to run ${GNAPNAME}"
# Setting up temporary directory
-TEMPDIR=$(mktemp -d -t gnap_make.XXXXXX)
-gtest continued $? 'Failed to create temporary directory'
+if [[ "${TEMPDIR}" = "" ]]; then
+       TEMPDIR=$(mktemp -d -t gnap_make.XXXXXX)
+       gtest continued $? 'Failed to create temporary directory'
+else
+       test -d "${TEMPDIR}" && \
+               gconfirm "${TEMPDIR} already exists. If this  
directory is used " \
+                       "there might be side effects due to existing  
files and the " \
+                       "directory will be deleted when the program  
terminates. " \
+                       "Continue?"
+       mkdir -p "${TEMPDIR}"
+       gtest continued $? "Failed to create ${TEMPDIR}"
+fi
# Prepare specs dir and check common.conf file
SPECDIR="${TEMPDIR}/specs"

Attachment:
PGP.sig (This is a digitally signed message part)
Replies:
Re: [PATCH] Custom GNAP TEMPDIR in gnap_make
-- josé Alberto Suárez López
Navigation:
Lists: gnap-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Meet rememeber: today (Monday) at 14:00 UTC
Next by thread:
Re: [PATCH] Custom GNAP TEMPDIR in gnap_make
Previous by date:
Meet rememeber: today (Monday) at 14:00 UTC
Next by date:
Re: [PATCH] Custom GNAP TEMPDIR in gnap_make


Updated Jun 17, 2009

Summary: Archive of the gnap-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.