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: 07-split-make_tempdir.patch
Date: Thu, 5 Jul 2007 16:09:39 +0300 (EEST)
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@g.o mailing list


References:
Some patches for gnap
-- Philipp Riegger
Navigation:
Lists: gnap-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
06-feature-gnap_remaster-T.patch
Next by thread:
08-namespace-gnap_shared.patch
Previous by date:
06-feature-gnap_remaster-T.patch
Next by date:
08-namespace-gnap_shared.patch


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.