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: codesite-noreply@...
Subject: [gnap-dev commit] r111 - in trunk: src tools
Date: Tue, 17 Jun 2008 12:07:22 -0700
Author: rieggepp
Date: Tue Jun 17 11:56:28 2008
New Revision: 111

Modified:
   trunk/src/gnap_make
   trunk/tools/gnap_overlay
   trunk/tools/gnap_remaster

Log:
Applied 04-gnap-environment.patch from Summer of Code 2007.

Modified: trunk/src/gnap_make
==============================================================================
--- trunk/src/gnap_make	(original)
+++ trunk/src/gnap_make	Tue Jun 17 11:56:28 2008
@@ -1,7 +1,7 @@
 #!/bin/bash
 VERSION='2.0'

-GNAP_LIBDIR='/usr/lib/gnap'
+GNAP_LIBDIR=${GNAP_LIBDIR:-'/usr/lib/gnap'}
 source ${GNAP_LIBDIR}/gnap_shared.sh
 echo "GNAP Core Building tool ${NAME} version ${VERSION}"

@@ -25,65 +25,36 @@
 	exit 0
 fi

-gbegin 'Checking parameters'
-
 # Catalyst executable and config file
-GNAP_CATALYST_BIN="/usr/bin/catalyst"
-GNAP_CATALYST_CONF="/etc/catalyst/catalyst.conf"
+GNAP_CATALYST_BIN=${GNAP_CATALYST_BIN:-"/usr/bin/catalyst"}
+GNAP_CATALYST_CONF=${GNAP_CATALYST_CONF:-"/etc/catalyst/catalyst.conf"}

-# Read options
-GNAP_STAGE3=0
-GNAP_LIVECD1=0
-GNAP_LIVECD2=0
-GNAP_TARBALL=0
-GNAP_MODULES=0
-GNAP_STAMP=$(date +%Y%m%d)
-NOTARGET=1
-NEEDS_SNAPSHOT=0
+# Default options
+GNAP_STAMP=${GNAP_STAMP:-$(date +%Y%m%d)}
+GNAP_STAGE3=${GNAP_STAGE3:-0}
+GNAP_LIVECD1=${GNAP_LIVECD1:-0}
+GNAP_LIVECD2=${GNAP_LIVECD2:-0}
+GNAP_TARBALL=${GNAP_TARBALL:-0}
+GNAP_MODULES=${GNAP_MODULES:-0}
+
+# Read options (phase 1)
+gbegin 'Checking parameters'
+
+OPTIND=0
 while getopts ':hs:p:m:o:v:t:fl:c:e:' option; do
 	case ${option} in
-		h )
+		h )
+			gtest
 			usage
 			exit 0;;
-		s ) GNAP_STAGE3FILE="${OPTARG}";;
-		p ) GNAP_SNAPSHOTFILE="${OPTARG}";;
-		o ) GNAP_PORTAGE_OVERLAYS="${GNAP_PORTAGE_OVERLAYS} ${OPTARG}";;
-		v ) GNAP_STAMP="${OPTARG}";;
-		t )
-			case "${OPTARG}" in
-				all )
-					GNAP_STAGE3=1
-					GNAP_LIVECD1=1
-					GNAP_LIVECD2=1
-					GNAP_TARBALL=1
-					GNAP_MODULES=1
-					NEEDS_SNAPSHOT=1;;
-				stage3 )
-					GNAP_STAGE3=1
-					NEEDS_SNAPSHOT=1;;
-				livecd-stage1 )
-					GNAP_LIVECD1=1
-					NEEDS_SNAPSHOT=1;;
-				livecd-stage2 )
-					GNAP_LIVECD2=1
-					NEEDS_SNAPSHOT=1;;
-				tarball )
-					GNAP_TARBALL=1;;
-				extensions )
-					GNAP_MODULES=1
-					NEEDS_SNAPSHOT=1;;
-				* ) gtest 1 'Specified stage is unknown!';;
-			esac
-			NOTARGET=0;;
-		f ) GNAP_FORCEYES=1;;
-		l ) GNAP_LOGPREFIX="${OPTARG}";;
-		c ) GNAP_CATALYST_CONF="${OPTARG}";;
 		e ) GNAP_SPECS="${OPTARG}";;
+		s|p|o|v|t|f|l|c ) :;;
 		* ) gtest 1 'Specified options are incomplete or unknown!';;
 	esac
 done

 # Root is needed
+# * non-root can only use "gnap_make -h"
 test "${EUID}" -eq 0
 gtest continued $? "You need to be root to run ${NAME}"

@@ -113,15 +84,71 @@
 	DISTCCSPEC="distcc_hosts: ${DISTCC_HOSTS}"
 fi

+
+# Read options (phase 2)
+OPTIND=0
+while getopts ':hs:p:m:o:v:t:fl:c:e:' option; do
+	case ${option} in
+		c ) GNAP_CATALYST_CONF="${OPTARG}";;
+		s|p|o|v|t|f|l|e|h ) :;;
+		* ) gtest 1 'Specified options are incomplete or unknown!';;
+	esac
+done
+
 # catalyst.conf file
 test -f "${GNAP_CATALYST_CONF}"
 gtest continued $? "${GNAP_CATALYST_CONF} file not found!"
 source "${GNAP_CATALYST_CONF}"

+# Read options (phase 3)
+OPTIND=0
+while getopts ':hs:p:m:o:v:t:fl:c:e:' option; do
+	case ${option} in
+		s ) GNAP_STAGE3FILE="${OPTARG}";;
+		p ) GNAP_SNAPSHOTFILE="${OPTARG}";;
+		o ) GNAP_PORTAGE_OVERLAYS="${GNAP_PORTAGE_OVERLAYS} ${OPTARG}";;
+		v ) GNAP_STAMP="${OPTARG}";;
+		t )
+			case "${OPTARG}" in
+				all )
+					GNAP_STAGE3=1
+					GNAP_LIVECD1=1
+					GNAP_LIVECD2=1
+					GNAP_TARBALL=1
+					GNAP_MODULES=1;;
+				stage3 ) GNAP_STAGE3=1;;
+				livecd-stage1 ) GNAP_LIVECD1=1;;
+				livecd-stage2 ) GNAP_LIVECD2=1;;
+				tarball ) GNAP_TARBALL=1;;
+				extensions ) GNAP_MODULES=1;;
+				* ) gtest 1 'Specified stage is unknown!';;
+			esac;;
+		f ) GNAP_FORCEYES=1;;
+		l ) GNAP_LOGPREFIX="${OPTARG}";;
+		c|e|h ) :;;
+		* ) gtest 1 'Specified options are incomplete or unknown!';;
+	esac
+done
+
 # At least one target is needed
-test "${NOTARGET}" -eq 0
-gtest continued $? \
+test "${GNAP_STAGE3}" -eq 0 &&
+test "${GNAP_LIVECD1}" -eq 0 &&
+test "${GNAP_LIVECD2}" -eq 0 &&
+test "${GNAP_TARBALL}" -eq 0 &&
+test "${GNAP_MODULES}" -eq 0
+if [[ $? -eq 0 ]]; then
+	gtest continued 1 \
 	'No target specified. You should provide at least one -t option.'
+fi
+
+NEEDS_SNAPSHOT=0
+test "${GNAP_STAGE3}" -eq 1 ||
+test "${GNAP_LIVECD1}" -eq 1 ||
+test "${GNAP_LIVECD2}" -eq 1 ||
+test "${GNAP_MODULES}" -eq 1
+if [[ $? -eq 0 ]]; then
+	NEEDS_SNAPSHOT=1
+fi

 # storedir must exist
 gmkdir "${storedir}"

Modified: trunk/tools/gnap_overlay
==============================================================================
--- trunk/tools/gnap_overlay	(original)
+++ trunk/tools/gnap_overlay	Tue Jun 17 11:56:28 2008
@@ -1,7 +1,7 @@
 #!/bin/bash
 VERSION='2.0'

-GNAP_LIBDIR='/usr/lib/gnap'
+GNAP_LIBDIR=${GNAP_LIBDIR:-'/usr/lib/gnap'}
 source ${GNAP_LIBDIR}/gnap_shared.sh
 echo "GNAP overlay tool ${NAME} ${VERSION}"

@@ -42,19 +42,14 @@
 	exit 0
 fi

-gbegin 'Checking parameters'
+# Default settings
+GNAP_NOLOGO=${GNAP_NOLOGO:-0}
+GNAP_CREATE=${GNAP_CREATE:-'n'}
+GNAP_IMG_SIZE=${GNAP_IMG_SIZE:-15}

 # Read options
-GNAP_NOLOGO=0
-GNAP_FORCEYES=0
-GNAP_OUTPUT=''
-GNAP_TYPE=''
-GNAP_CREATE='n'
-GNAP_IMG_SIZE=15
-GNAP_TARGETROOT=''
-GNAP_CACHE=''
-GNAP_SERIAL=''
-GNAP_BAUDRATE=''
+gbegin 'Checking parameters'
+
 while getopts ':hg:o:c:nfi:d:l:r:ms:S:L:' option; do
 	case ${option} in
 		h ) usage

Modified: trunk/tools/gnap_remaster
==============================================================================
--- trunk/tools/gnap_remaster	(original)
+++ trunk/tools/gnap_remaster	Tue Jun 17 11:56:28 2008
@@ -1,12 +1,10 @@
 #!/bin/bash
 VERSION='2.0'

-GNAP_LIBDIR='/usr/lib/gnap'
+GNAP_LIBDIR=${GNAP_LIBDIR:-'/usr/lib/gnap'}
 source ${GNAP_LIBDIR}/gnap_shared.sh
 echo "GNAP remastering tool ${NAME} ${VERSION}"

-GNAP_OUTPUT='mygnap-core.tar'
-
 usage() {
 	echo
 	echo 'Usage:'
@@ -33,12 +31,8 @@
 gbegin 'Checking parameters'

 # Read options
-GNAP_EXTENSIONS=''
-GNAP_KERNEXT=''
-GNAP_MODEXT=''
-GNAP_BASEFS=''
-GNAP_EXTDIR=''
-GNAP_FORCEYES=0
+GNAP_OUTPUT=${GNAP_OUTPUT:-'mygnap-core.tar'}
+
 while getopts ':he:k:m:o:g:b:d:f' option; do
 	case ${option} in
 		h ) usage
-- 
gnap-dev@g.o mailing list


Navigation:
Lists: gnap-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
[gnap-dev commit] r110 - in trunk: src tools
Next by thread:
[gnap-dev commit] r112 - wiki
Previous by date:
[gnap-dev commit] r110 - in trunk: src tools
Next by date:
[gnap-dev commit] r112 - wiki


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.