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] r109 - in trunk: src tools
Date: Tue, 17 Jun 2008 11:59:21 -0700
Author: rieggepp
Date: Tue Jun 17 11:55:23 2008
New Revision: 109

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

Log:
Applied 02-gnap-split.patch from Summer of Code 2007.

Modified: trunk/src/gnap_make
==============================================================================
--- trunk/src/gnap_make	(original)
+++ trunk/src/gnap_make	Tue Jun 17 11:55:23 2008
@@ -1,78 +1,9 @@
 #!/bin/bash
 GNAPVERSION='2.0'

-GNAPNAME=$(basename "$0")
-echo "GNAP Core Building tool ${GNAPNAME} version ${GNAPVERSION}"
 GNAPLIBDIR='/usr/lib/gnap'
-STAGE3FILE="${GNAPLIBDIR}/gnap-stage3seed.tar.bz2"
-SNAPSHOTFILE="${GNAPLIBDIR}/gnap-portagesnapshot.tar.bz2"
-SPECS="${GNAPLIBDIR}/gnap-specs.tar.bz2"
-TEMPDIR=''
-
-G=$'\e[32;01m'
-B=$'\e[31;01m'
-N=$'\e[0m'
-W=$'\e[33;01m'
-K=$'\e[34;01m'
-C="$[$(set -- $(stty size 2>/dev/null); echo ${2}) - 7]"
-E=$'\e['${C}'G'
-
-gwarn() {
-	echo -e " ${W}*${N} ${*}"
-}
-
-ginfo() {
-	echo -e " ${G}*${N} ${*}"
-}
-
-gmkdir() {
-	mkdir -p "$1"
-	gtest continued $? "Failed to create directory \"$1\"."
-}
-
-gconfirm() {
-	if [[ "${FORCEYES}" -eq 1 ]]; then
-		gwarn "${*} forced to yes"
-	else
-		read -ep " ${W}*${N} ${*} [N]: " answer
-		if [[ "${answer}" != 'y' && "${answer}" != 'Y' ]]; then
-			if [[ -n "${TEMPDIR}" ]]; then
-				cleanup
-			fi
-			echo Build aborted!
-			exit 2
-		fi
-	fi
-}
-
-gbegin() {
-	echo -ne " ${G}*${N} ${*}..."
-}
-
-gtest() {
-	continued=0
-	if [[ "$#" -gt 0 && "${1}" == 'continued' ]]; then
-		shift
-		continued=1
-	fi
-	if [[ "$#" -eq 0 || "${1}" -eq 0 ]]; then
-		if [[ "${continued}" -eq 0 ]]; then
-			echo -e "${E}  ${K}[ ${G}ok${K} ]${N}"
-		fi
-	else
-		echo -e "${E}  ${K}[ ${B}!!${K} ]${N}"
-		if [[ "$#" -ge 2 ]]; then
-			shift
-			echo -en " ${B}*${N} ${*}"
-			echo -e "${E}  ${K}[ ${B}!!${K} ]${N}"
-		fi
-		if [[ -n "${TEMPDIR}" ]]; then
-			cleanup
-		fi
-		echo "Build failed, try man ${GNAPNAME} for more help"
-		exit 1
-	fi
-}
+source ${GNAPLIBDIR}/gnap_shared.sh
+echo "GNAP Core Building tool ${GNAPNAME} version ${GNAPVERSION}"

 usage() {
 	echo 'Options:'
@@ -89,18 +20,6 @@
 	echo "Please use man ${GNAPNAME} for more details."
 }

-cleanup() {
-	gbegin 'Cleaning temporary directories'
-	if [[ -d "${TEMPDIR}" ]]; then
-		DIRTOREMOVE="${TEMPDIR}"
-		TEMPDIR=''
-		rm -rf "${DIRTOREMOVE}"
-		gtest $? "Failed to remove ${DIRTOREMOVE}"
-	else
-		gtest 0
-	fi
-}
-
 if [[ "$#" -eq 0 ]]; then
 	usage
 	exit 0
@@ -109,7 +28,7 @@
 gbegin 'Checking parameters'

 # Catalyst executable and config file
-CATALYST_BIN="/usr/bin/catayst"
+CATALYST_BIN="/usr/bin/catalyst"
 CATALYST_CONF="/etc/catalyst/catalyst.conf"

 # Read options
@@ -250,7 +169,7 @@
 ginfo "${TARGETLIST}"

 # Confirm tarball overwrite if TARBALL stage selected
-if [[ "${TARBALL}" -eq 1 -a -e "gnap-${GNAPVERSION}-${STAMP}.tar" ]]; then
+if [[ "${TARBALL}" -eq 1 && -e "gnap-${GNAPVERSION}-${STAMP}.tar" ]]; then
 	gconfirm "gnap-${GNAPVERSION}-${STAMP}.tar already exists, overwrite"
 fi


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

-GNAPNAME=$(basename "$0")
-echo "GNAP overlay tool ${GNAPNAME} ${VERSION}"
 GNAPLIBDIR='/usr/lib/gnap'
-GNAPCORE="${GNAPLIBDIR}/gnap-core.tar"
-GNAPMBR="${GNAPLIBDIR}/mbr/mbr.bin"
-TEMPDIR=''
-IMG_SIZE=15
-
-G=$'\e[32;01m'
-B=$'\e[31;01m'
-N=$'\e[0m'
-W=$'\e[33;01m'
-K=$'\e[34;01m'
-C="$[$(set -- $(stty size 2>/dev/null); echo ${2}) - 7]"
-E=$'\e['${C}'G'
-
-gwarn() {
-	echo -e " ${W}*${N} ${*}"
-}
-
-ginfo() {
-	echo -e " ${G}*${N} ${*}"
-}
-
-gmkdir() {
-	mkdir -p "$1"
-	gtest continued $? "Failed to create directory \"$1\"."
-}
-
-gconfirm() {
-	if [[ "${FORCEYES}" -eq 1 ]]; then
-		gwarn "${*} forced to yes"
-	else
-		read -ep " ${W}*${N} ${*} [N]: " answer
-		if [[ "${answer}" != 'y' && "${answer}" != 'Y' ]]; then
-			if [[ -n "${TEMPDIR}" || -n "${LOOP}" ]]; then
-				cleanup
-			fi
-			echo 'Overlay aborted!'
-			exit 2
-		fi
-	fi
-}
-
-gbegin() {
-	echo -ne " ${G}*${N} ${*}..."
-}
+source ${GNAPLIBDIR}/gnap_shared.sh
+echo "GNAP overlay tool ${GNAPNAME} ${VERSION}"

-gtest() {
-	continued=0
-	if [[ "$#" -gt 0 && "${1}" == 'continued' ]]; then
-		shift
-		continued=1
-	fi
-
-	if [[ "${#}" -eq 0 || "${1}" -eq 0 ]]; then
-		if [[ "${continued}" -eq 0 ]]; then
-			echo -e "${E}  ${K}[ ${G}ok${K} ]${N}"
-		fi
-	else
-		echo -e "${E}  ${K}[ ${B}!!${K} ]${N}"
-		if [[ "$#" -ge 2 ]]; then
-			shift
-			echo -en " ${B}*${N} ${*}"
-			echo -e "${E}  ${K}[ ${B}!!${K} ]${N}"
-		fi
-		if [[ -n "${TEMPDIR}" || -n "${LOOP}" ]]; then
-			cleanup
-		fi
-		echo "Overlay failed, try ${GNAPNAME} -h for more help"
-		exit 1
-	fi
-}
+IMG_SIZE=15

 usage() {
 	echo
@@ -107,23 +39,6 @@
     echo "Please use man ${GNAPNAME} for more details."
 }

-cleanup() {
-	if [[ -n "${LOOP}" ]]; then
-		gbegin 'Unmounting loop filesystem'
-		umount "${LOOP}" && losetup -d "${LOOP}"
-		gtest $? "Failed to unmount ${LOOP}"
-	fi
-	gbegin 'Cleaning temporary directories'
-	if [[ -d "${TEMPDIR}" ]]; then
-		DIRTOREMOVE="${TEMPDIR}"
-		TEMPDIR=''
-		rm -rf "${DIRTOREMOVE}"
-		gtest $? "Failed to remove ${DIRTOREMOVE}"
-	else
-		gtest 0
-	fi
-}
-
 if [[ "$#" -eq 0 || "${1}" == '-h' ]]; then
 	usage
 	exit 0
@@ -226,7 +141,7 @@

 if [[ -n "${BAUDRATE}" ]]; then
 	gbegin 'Adding baudrate for serial console'
-	gmkdir "${TEMPOVERDIR}/etc/gnap"
+	gmkdir -p "${TEMPOVERDIR}/etc/gnap"
 	echo -n "${BAUDRATE}" > "${TEMPOVERDIR}/etc/gnap/baudrate"
 	gtest $? 'Failed to create /etc/gnap/baudrate'
 fi

Modified: trunk/tools/gnap_remaster
==============================================================================
--- trunk/tools/gnap_remaster	(original)
+++ trunk/tools/gnap_remaster	Tue Jun 17 11:55:23 2008
@@ -1,76 +1,11 @@
 #!/bin/bash
 VERSION='2.0'

-GNAPNAME=$(basename "$0")
-echo "GNAP remastering tool ${GNAPNAME} ${VERSION}"
 GNAPLIBDIR='/usr/lib/gnap'
-GNAPEXTDIR="${GNAPLIBDIR}/extensions"
-TEMPDIR=''
-GNAPCORE="${GNAPLIBDIR}/gnap-core.tar"
-GNAPBASEFS="${GNAPLIBDIR}/gnap-basefs.tar.bz2"
-OUTPUT='mygnap-core.tar'
-
-G=$'\e[32;01m'
-B=$'\e[31;01m'
-N=$'\e[0m'
-W=$'\e[33;01m'
-K=$'\e[34;01m'
-C="$[$(set -- $(stty size 2>/dev/null); echo ${2}) - 7]"
-E=$'\e['${C}'G'
-
-gwarn() {
-	echo -e " ${W}*${N} ${*}"
-}
-
-gmkdir() {
-	mkdir -p "$1"
-	gtest continued $? "Failed to create directory \"$1\"."
-}
-
-gconfirm() {
-	if [[ "${FORCEYES}" -eq 1 ]]; then
-		gwarn "${*} forced to yes"
-	else
-		read -ep " ${W}*${N} ${*} [N]: " answer
-		if [[ "${answer}" != 'y' && "${answer}" != 'Y' ]]; then
-			if [[ -n "${TEMPDIR}" ]]; then
-				cleanup
-			fi
-			echo 'Remaster aborted!'
-			exit 2
-		fi
-	fi
-}
-
-gbegin() {
-	echo -ne " ${G}*${N} ${*}..."
-}
-
-gtest() {
-	continued=0
-	if [[ "$#" -gt 0 && "${1}" == 'continued' ]]; then
-		shift
-		continued=1
-	fi
+source ${GNAPLIBDIR}/gnap_shared.sh
+echo "GNAP remastering tool ${GNAPNAME} ${VERSION}"

-	if [[ "${#}" -eq 0 || "${1}" -eq 0 ]]; then
-		if [[ "${continued}" -eq 0 ]]; then
-			echo -e "${E}  ${K}[ ${G}ok${K} ]${N}"
-		fi
-	else
-		echo -e "${E}  ${K}[ ${B}!!${K} ]${N}"
-		if [[ "$#" -ge 2 ]]; then
-			shift
-			echo -en " ${B}*${N} ${*}"
-			echo -e "${E}  ${K}[ ${B}!!${K} ]${N}"
-		fi
-		if [[ -n "${TEMPDIR}" ]]; then
-			cleanup
-		fi
-		echo "Remaster failed, try ${GNAPNAME} -h for more help"
-		exit 1
-	fi
-}
+OUTPUT='mygnap-core.tar'

 usage() {
 	echo
@@ -88,18 +23,6 @@
 	echo '  -f              Force all answers to yes (dangerous!)'
 	echo
 	echo "Please use man ${GNAPNAME} for more details."
-}
-
-cleanup() {
-	gbegin 'Cleaning temporary directories'
-	if [[ -d "${TEMPDIR}" ]]; then
-		DIRTOREMOVE="${TEMPDIR}"
-		TEMPDIR=''
-	 	rm -rf "${DIRTOREMOVE}"
-		gtest $? "Failed to remove ${DIRTOREMOVE}"
-	else
-		gtest 0
-	fi
 }

 if [[ "$#" -eq 0 || "${1}" == '-h' ]]; then
-- 
gnap-dev@g.o mailing list


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


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.