[or-cvs] r16190: Re-worked a stupid change I made in the build scripts in Jan (incognito/trunk)

anonym at seul.org anonym at seul.org
Fri Jul 25 13:46:27 UTC 2008


Author: anonym
Date: 2008-07-25 09:46:27 -0400 (Fri, 25 Jul 2008)
New Revision: 16190

Modified:
   incognito/trunk/livecd-stage2.sh
Log:
Re-worked a stupid change I made in the build scripts in January.


Modified: incognito/trunk/livecd-stage2.sh
===================================================================
--- incognito/trunk/livecd-stage2.sh	2008-07-25 13:38:45 UTC (rev 16189)
+++ incognito/trunk/livecd-stage2.sh	2008-07-25 13:46:27 UTC (rev 16190)
@@ -6,9 +6,8 @@
 
 # Verify arguments
 SPEC="$1"
-VER="$2"
 if [[ -z "${SPEC}" ]] || [[ ! -r "${SPEC}" ]]; then
-	echo "Usage: $0 spec_file [Incognito version>]"
+	echo "Usage: $0 spec_file"
 	exit 1
 fi
 
@@ -57,39 +56,42 @@
 sed -i "s:/usr/src/incognito:$(pwd):g" "${DIR}/livecd-stage2.spec"
 
 # Do branding replacement
-# TODO: Get these two from somewhere else
+# TODO: Get these from somewhere else
 INCOGNITO="Incognito"
 INCOGNITO_TITLE="Incognito"
 INCOGNITO_USER="incognito"
+INCOGNITO_REVISION="r$( svnversion | cut -d ":" -f 2 )"
 
-if [[ -z ${VER} ]]; then
-	INCOGNITO_VERSION="custom"
-else
-	INCOGNITO_VERSION="${VER}"
-fi
-
-# Add revision
+# Determine type:
+# If building trunk, set type as "trunk".
+# If building a tag, set type to tag name.
+# If building a branch, type to branch name.
 SVN_URL="$(svn info --xml 2>/dev/null | grep url | sed 's/<url>\(.*\)<\/url>/\1/')"
-grep trunk >/dev/null <<EOF && INCOGNITO_VERSION="trunk" && INCOGNITO_TITLE="${INCOGNITO_TITLE} r$(svnversion | cut -d ":" -f 2)"
+grep trunk >/dev/null <<EOF && INCOGNITO_TYPE="trunk"
 ${SVN_URL}
 EOF
-grep tags  >/dev/null <<EOF && INCOGNITO_VERSION="$(basename ${SVN_URL})" && INCOGNITO_TITLE="${INCOGNITO_TITLE} ${INCOGNITO_VERSION}"
+grep tags >/dev/null <<EOF && INCOGNITO_TYPE="$(basename ${SVN_URL})"
 ${SVN_URL}
 EOF
-grep branches >/dev/null <<EOF && INCOGNITO_VERSION="$(basename ${SVN_URL})" && INCOGNITO_TITLE="${INCOGNITO_TITLE} ${INCOGNITO_VERSION} r$(svnversion | cut -d ":" -f 2)"
+grep branches >/dev/null <<EOF && INCOGNITO_TYPE="$(basename ${SVN_URL})"
 ${SVN_URL}
 EOF
 
+INCOGNITO_VERSION="${INCOGNITO_TYPE} (${INCOGNITO_REVISION})"
+
+INCOGNITO_TITLE="${INCOGNITO_TITLE} ${INCOGNITO_VERSION}"
+
 echo "========"
 echo "Building: ${INCOGNITO_TITLE}"
 echo "========"
 
-export INCOGNITO INCOGNITO_USER INCOGNITO_TITLE INCOGNITO_VERSION
+export INCOGNITO INCOGNITO_USER INCOGNITO_TITLE INCOGNITO_VERSION INCOGNITO_TYPE
 
 find "${DIR}" -type f | while read FILE; do
 	sed -i "s/__INCOGNITO__/${INCOGNITO//\//\/}/g" "${FILE}"
 	sed -i "s/__INCOGNITO_USER__/${INCOGNITO_USER//\//\/}/g" "${FILE}"
 	sed -i "s/__INCOGNITO_TITLE__/${INCOGNITO_TITLE//\//\/}/g" "${FILE}"
+	sed -i "s/__INCOGNITO_TYPE__/${INCOGNITO_TYPE//\//\/}/g" "${FILE}"
 	sed -i "s/__INCOGNITO_VERSION__/${INCOGNITO_VERSION//\//\/}/g" "${FILE}"
 done
 



More information about the tor-commits mailing list