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: 03-split-gnap_remaster.patch
Date: Thu, 5 Jul 2007 16:05:46 +0300 (EEST)
Index: tools/gnap_shared.sh
===================================================================
--- tools/gnap_shared.sh	(revision 54)
+++ tools/gnap_shared.sh	(working copy)
@@ -1,9 +1,10 @@
 GNAPNAME=$(basename "$0")

 case ${GNAPNAME} in
-	gnap_make )    GNAPPRODUCT="Build";;
-	gnap_overlay ) GNAPPRODUCT="Overlay";;
-	* )            GNAPPRODUCT="Something";;
+	gnap_make )     GNAPPRODUCT="Build";;
+	gnap_overlay )  GNAPPRODUCT="Overlay";;
+	gnap_remaster ) GNAPPRODUCT="Remaster";;
+	* )             GNAPPRODUCT="Something";;
 esac

 GNAPLIBDIR='/usr/lib/gnap'
@@ -12,6 +13,8 @@
 SPECS="${GNAPLIBDIR}/gnap-specs.tar.bz2"
 GNAPCORE="${GNAPLIBDIR}/gnap-core.tar"
 GNAPMBR="${GNAPLIBDIR}/mbr/mbr.bin"
+GNAPEXTDIR="${GNAPLIBDIR}/extensions"
+GNAPBASEFS="${GNAPLIBDIR}/gnap-basefs.tar.bz2"

 LOOP=''

Index: tools/gnap_remaster
===================================================================
--- tools/gnap_remaster	(revision 52)
+++ tools/gnap_remaster	(working copy)
@@ -1,72 +1,11 @@
 #!/bin/bash
 VERSION='2.0'

-GNAPNAME=$(basename "$0")
+source "gnap_shared.sh"
 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} ${*}"
-}
-
-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
-
-	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
-}
-
 usage() {
 	echo
 	echo 'Usage:'
@@ -85,18 +24,6 @@
 	echo "Please 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
 	usage
 	exit 0
Index: src/gnap_shared.sh
===================================================================
--- src/gnap_shared.sh	(revision 54)
+++ src/gnap_shared.sh	(working copy)
@@ -1,9 +1,10 @@
 GNAPNAME=$(basename "$0")

 case ${GNAPNAME} in
-	gnap_make )    GNAPPRODUCT="Build";;
-	gnap_overlay ) GNAPPRODUCT="Overlay";;
-	* )            GNAPPRODUCT="Something";;
+	gnap_make )     GNAPPRODUCT="Build";;
+	gnap_overlay )  GNAPPRODUCT="Overlay";;
+	gnap_remaster ) GNAPPRODUCT="Remaster";;
+	* )             GNAPPRODUCT="Something";;
 esac

 GNAPLIBDIR='/usr/lib/gnap'
@@ -12,6 +13,8 @@
 SPECS="${GNAPLIBDIR}/gnap-specs.tar.bz2"
 GNAPCORE="${GNAPLIBDIR}/gnap-core.tar"
 GNAPMBR="${GNAPLIBDIR}/mbr/mbr.bin"
+GNAPEXTDIR="${GNAPLIBDIR}/extensions"
+GNAPBASEFS="${GNAPLIBDIR}/gnap-basefs.tar.bz2"

 LOOP=''


-- 
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:
01-split-gnap_make.patch
Next by thread:
04-feature-gnap_make-T.patch
Previous by date:
02-split-gnap_overlay.patch
Next by date:
04-feature-gnap_make-T.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.