From: "Philipp Riegger" <lists@anderedomain.de>
To: gnap-dev@lists.gentoo.org
Subject: [gnap-dev] 07-split-make_tempdir.patch
Date: Thu, 5 Jul 2007 16:09:39 +0300 (EEST) [thread overview]
Message-ID: <51428.130.230.11.107.1183640979.squirrel@my.bawue.net> (raw)
In-Reply-To: <59506.130.230.11.107.1183640031.squirrel@my.bawue.net>
Index: tools/gnap_shared.sh
===================================================================
--- tools/gnap_shared.sh (revision 55)
+++ tools/gnap_shared.sh (working copy)
@@ -16,6 +16,7 @@
GNAPEXTDIR="${GNAPLIBDIR}/extensions"
GNAPBASEFS="${GNAPLIBDIR}/gnap-basefs.tar.bz2"
+TEMPDIR=''
LOOP=''
G=$'\e[32;01m'
@@ -90,3 +91,15 @@
gtest 0
fi
}
+
+make_tempdir() {
+ if [[ "${TEMPDIR}" = "" ]]; then
+ TEMPDIR=$(mktemp -d -t gnap_make.XXXXXX)
+ gtest continued $? 'Failed to create temporary directory'
+ elif [[ -d "${TEMPDIR}" ]]
+ gconfirm "${TEMPDIR} already exists. Continue?"
+ else
+ mkdir -p "${TEMPDIR}"
+ gtest continued $? "Failed to create ${TEMPDIR}"
+ fi
+}
Index: tools/gnap_overlay
===================================================================
--- tools/gnap_overlay (revision 60)
+++ tools/gnap_overlay (working copy)
@@ -47,7 +47,6 @@
gbegin 'Checking parameters'
# Read options
-TEMPDIR=''
while getopts ':hg:o:c:nfi:d:l:r:ms:S:L:T:' options; do
case ${options} in
h ) usage
@@ -120,15 +119,7 @@
fi
# Setting up temporary directory
-if [[ "${TEMPDIR}" = "" ]]; then
- TEMPDIR=$(mktemp -d -t gnap_overlay.XXXXXX)
- gtest continued $? 'Failed to create temporary directory'
-elif [[ -d "${TEMPDIR}" ]]
- gconfirm "${TEMPDIR} already exists. Continue?"
-else
- mkdir -p "${TEMPDIR}"
- gtest continued $? "Failed to create ${TEMPDIR}"
-fi
+make_tempdir
# Common actions
gbegin "Expanding ${GNAPCORE} core"
Index: tools/gnap_remaster
===================================================================
--- tools/gnap_remaster (revision 61)
+++ tools/gnap_remaster (working copy)
@@ -33,7 +33,6 @@
gbegin 'Checking parameters'
# Read options
-TEMPDIR=''
while getopts ':he:k:m:o:g:b:d:fT:' options; do
case ${options} in
h ) usage
@@ -73,15 +72,7 @@
fi
# Setting up temporary directory
-if [[ "${TEMPDIR}" = "" ]]; then
- TEMPDIR=$(mktemp -d -t gnap_remaster.XXXXXX)
- gtest continued $? 'Failed to create temporary directory'
-elif [[ -d "${TEMPDIR}" ]]
- gconfirm "${TEMPDIR} already exists. Continue?"
-else
- mkdir -p "${TEMPDIR}"
- gtest continued $? "Failed to create ${TEMPDIR}"
-fi
+make_tempdir
# Preparing new FS
gbegin "Unpacking ${GNAPBASEFS} basefs"
Index: src/gnap_make
===================================================================
--- src/gnap_make (revision 58)
+++ src/gnap_make (working copy)
@@ -30,7 +30,6 @@
# Read options
NOTARGET=1
STAMP=$(date +%Y%m%d)
-TEMPDIR=''
while getopts ':hs:p:m:o:v:t:fl:c:e:T:' options; do
case ${options} in
h ) usage
@@ -71,15 +70,7 @@
gtest continued $? "You need to be root to run ${GNAPNAME}"
# Setting up temporary directory
-if [[ "${TEMPDIR}" = "" ]]; then
- TEMPDIR=$(mktemp -d -t gnap_make.XXXXXX)
- gtest continued $? 'Failed to create temporary directory'
-elif [[ -d "${TEMPDIR}" ]]
- gconfirm "${TEMPDIR} already exists. Continue?"
-else
- mkdir -p "${TEMPDIR}"
- gtest continued $? "Failed to create ${TEMPDIR}"
-fi
+make_tempdir
# Prepare specs dir and check common.conf file
SPECDIR="${TEMPDIR}/specs"
Index: src/gnap_shared.sh
===================================================================
--- src/gnap_shared.sh (revision 55)
+++ src/gnap_shared.sh (working copy)
@@ -16,6 +16,7 @@
GNAPEXTDIR="${GNAPLIBDIR}/extensions"
GNAPBASEFS="${GNAPLIBDIR}/gnap-basefs.tar.bz2"
+TEMPDIR=''
LOOP=''
G=$'\e[32;01m'
@@ -90,3 +91,15 @@
gtest 0
fi
}
+
+make_tempdir() {
+ if [[ "${TEMPDIR}" = "" ]]; then
+ TEMPDIR=$(mktemp -d -t gnap_make.XXXXXX)
+ gtest continued $? 'Failed to create temporary directory'
+ elif [[ -d "${TEMPDIR}" ]]
+ gconfirm "${TEMPDIR} already exists. Continue?"
+ else
+ mkdir -p "${TEMPDIR}"
+ gtest continued $? "Failed to create ${TEMPDIR}"
+ fi
+}
--
gnap-dev@gentoo.org mailing list
next prev parent reply other threads:[~2007-07-05 13:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-05 12:53 [gnap-dev] Some patches for gnap Philipp Riegger
2007-07-05 13:03 ` [gnap-dev] 01-split-gnap_make.patch Philipp Riegger
2007-07-05 13:05 ` [gnap-dev] 03-split-gnap_remaster.patch Philipp Riegger
2007-07-05 13:06 ` [gnap-dev] 04-feature-gnap_make-T.patch Philipp Riegger
2007-07-05 13:07 ` [gnap-dev] 05-festure-gnap_overlay-T.patch Philipp Riegger
2007-07-05 13:08 ` [gnap-dev] 06-feature-gnap_remaster-T.patch Philipp Riegger
2007-07-05 13:09 ` Philipp Riegger [this message]
2007-07-05 13:10 ` [gnap-dev] 08-namespace-gnap_shared.patch Philipp Riegger
2007-07-05 13:11 ` [gnap-dev] 09-cleanup-gnap_make.patch Philipp Riegger
2007-07-06 7:40 ` [gnap-dev] Some patches for gnap josé Alberto Suárez López
2007-07-06 15:08 ` Philipp Riegger
2007-07-09 7:13 ` josé Alberto Suárez López
2007-07-12 23:49 ` Philipp Riegger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51428.130.230.11.107.1183640979.squirrel@my.bawue.net \
--to=lists@anderedomain.de \
--cc=gnap-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox