summaryrefslogtreecommitdiffstats
path: root/chrome/installer
diff options
context:
space:
mode:
authormmoss@chromium.org <mmoss@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-11 22:30:07 +0000
committermmoss@chromium.org <mmoss@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-11 22:30:07 +0000
commit1250cb8c654bc9a0c26ff330dfe3f3c3278c5352 (patch)
tree56eb51fb4ed1ef9c96e99827d7a3048dbff99c1e /chrome/installer
parent385a467616a675d979514c64bda2fa5ddddb70c0 (diff)
downloadchromium_src-1250cb8c654bc9a0c26ff330dfe3f3c3278c5352.zip
chromium_src-1250cb8c654bc9a0c26ff330dfe3f3c3278c5352.tar.gz
chromium_src-1250cb8c654bc9a0c26ff330dfe3f3c3278c5352.tar.bz2
Allow passing in package version info, since it's already calculated by the
buildbot scripts. Review URL: http://codereview.chromium.org/42095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11489 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r--chrome/installer/linux/common/chromium-browser/chromium-browser.info32
-rwxr-xr-xchrome/installer/linux/debian/build.sh96
2 files changed, 56 insertions, 72 deletions
diff --git a/chrome/installer/linux/common/chromium-browser/chromium-browser.info b/chrome/installer/linux/common/chromium-browser/chromium-browser.info
index fc6606e..6439951 100644
--- a/chrome/installer/linux/common/chromium-browser/chromium-browser.info
+++ b/chrome/installer/linux/common/chromium-browser/chromium-browser.info
@@ -5,38 +5,6 @@
# This file provides common configuration information for building
# chromium-browser packages for various platforms.
-
-# Determine the string to use for package versioning. The strings are placed in
-# the VERSION, REVISION, and VERSIONFULL variables and should be formatted
-# appropriately for a variety of package standards.
-get_versioninfo() {
- EPOCHTIME=$(date +"%s")
- # TODO(mmoss) Use the real version once we start packaging a real browser
- VERSION="0.0.0.1"
- # Support both svn and git clients to get the latest revision.
- set +e
- git config -l 2>/dev/null | grep -qs -E "chrome|chromium"
- if [ $? -eq 0 ]; then
- REVISION=$(git-svn info | sed -e '/^Revision: */!d' -e "s/Revision: *//")
- if [ -n "$REVISION" ]; then
- if [ "$REVISION" != "$(git-svn find-rev HEAD)" ]; then
- REVISION+="custom"
- fi
- fi
- else
- svn info 2>/dev/null | grep -qs -E "chrome|chromium"
- if [ $? -eq 0 ]; then
- REVISION=$(svn info | sed -e '/^Revision: */!d' -e "s/Revision: *//")
- fi
- fi
- set -e
- if [ -z "$REVISION" ]; then
- echo "Error: Could not determine source revision."
- exit 1
- fi
- VERSIONFULL="${VERSION}-${EPOCHTIME}r${REVISION}"
-}
-
# Base name of the package.
PACKAGE="chromium-browser"
diff --git a/chrome/installer/linux/debian/build.sh b/chrome/installer/linux/debian/build.sh
index 8bdebe2..d06226b 100755
--- a/chrome/installer/linux/debian/build.sh
+++ b/chrome/installer/linux/debian/build.sh
@@ -254,10 +254,51 @@ cleanup() {
}
usage() {
- echo "usage: $(basename $0) [-r] [-o 'dir'] [-b 'dir']"
- echo "-r release build"
- echo "-o dir package output directory [current: ${OUTPUTDIR}]"
- echo "-b dir build input directory [current: ${BUILDDIR}]"
+ echo "usage: $(basename $0) [-g] [-o 'dir'] [-b 'dir'] [-v '#.#.#.#'] [-r #]"
+ echo "-g build google-chrome package (default is chromium-browser)"
+ echo "-o dir package output directory [${OUTPUTDIR}]"
+ echo "-b dir build input directory [${BUILDDIR}]"
+ echo "-v str product version string"
+ echo "-r # svn revision #"
+ echo "-h this help message"
+}
+
+process_opts() {
+ while getopts ":o:b:r:v:gh" OPTNAME
+ do
+ case $OPTNAME in
+ o )
+ OUTPUTDIR="$OPTARG"
+ mkdir -p "${OUTPUTDIR}"
+ ;;
+ v )
+ VERSION="$OPTARG"
+ ;;
+ r )
+ REVISION="$OPTARG"
+ ;;
+ b )
+ BUILDDIR="$OPTARG"
+ ;;
+ g )
+ GOOGLECHROME=1
+ ;;
+ h )
+ usage
+ exit 0
+ ;;
+ \: )
+ echo "'-$OPTARG' needs an argument."
+ usage
+ exit 1
+ ;;
+ * )
+ echo "invalid command-line option: $OPTARG"
+ usage
+ exit 1
+ ;;
+ esac
+ done
}
#=========
@@ -269,52 +310,27 @@ OUTPUTDIR="${PWD}"
STAGEDIR=deb.build
BUILDDIR=$(readlink -f "${SCRIPTDIR}/../../../Hammer")
CHANGELOG=changelog.auto
+# Default to a bogus low version, so if somebody creates and installs a package
+# with no version info, it won't prevent upgrading when trying to install a
+# properly versioned package (i.e. a proper package will always be "newer").
+VERSION="0.0.0.0"
+# Use epoch timestamp so packages with bogus versions still increment and will
+# upgrade older bogus-versioned packages.
+REVISION=$(date +"%s")
-while getopts ":o:b:rh" OPTNAME
-do
- case $OPTNAME in
- o )
- OUTPUTDIR="$OPTARG"
- mkdir -p "${OUTPUTDIR}"
- ;;
- b )
- BUILDDIR="$OPTARG"
- ;;
- r )
- RELEASE=1
- exit 0
- ;;
- h )
- usage
- exit 0
- ;;
- \: )
- echo "'-$OPTARG' needs an argument."
- usage
- exit 1
- ;;
- * )
- echo "invalid command-line option: $OPTARG"
- usage
- exit 1
- ;;
- esac
-done
+process_opts "$@"
-if [ "$RELEASE" = "1" ]; then
+if [ "$GOOGLECHROME" ]; then
source "${SCRIPTDIR}/../common/google-chrome/google-chrome.info"
else
source "${SCRIPTDIR}/../common/chromium-browser/chromium-browser.info"
fi
+VERSIONFULL="${VERSION}-r${REVISION}"
+
# Some Debian packaging tools want these set.
export DEBFULLNAME="${MAINTNAME}"
export DEBEMAIL="${MAINTMAIL}"
-# Version check currently uses repository info, so make sure we're in the src
-# tree.
-cd "${SCRIPTDIR}"
-get_versioninfo
-
# Make everything happen in the OUTPUTDIR.
cd "${OUTPUTDIR}"
cleanup