Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Unified Diff: third_party/opus/src/update_version

Issue 2962373002: [Opus] Update to v1.2.1 (Closed)
Patch Set: Pre-increment instead of post-increment Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/opus/src/tests/test_opus_encode.c ('k') | third_party/opus/src/win32/.gitignore » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/opus/src/update_version
diff --git a/third_party/opus/src/update_version b/third_party/opus/src/update_version
new file mode 100755
index 0000000000000000000000000000000000000000..a9999918d0f7e3cd52eb1c2cdbc70c1d85ccb226
--- /dev/null
+++ b/third_party/opus/src/update_version
@@ -0,0 +1,65 @@
+#!/bin/bash
+
+# Creates and updates the package_version information used by configure.ac
+# (or other makefiles). When run inside a git repository it will use the
+# version information that can be queried from it unless AUTO_UPDATE is set
+# to 'no'. If no version is currently known it will be set to 'unknown'.
+#
+# If called with the argument 'release', the PACKAGE_VERSION will be updated
+# even if AUTO_UPDATE=no, but the value of AUTO_UPDATE shall be preserved.
+# This is used to force a version update whenever `make dist` is run.
+#
+# The exit status is 1 if package_version is not modified, else 0 is returned.
+#
+# This script should NOT be included in distributed tarballs, because if a
+# parent directory contains a git repository we do not want to accidentally
+# retrieve the version information from it instead. Tarballs should ship
+# with only the package_version file.
+#
+# Ron <ron@debian.org>, 2012.
+
+SRCDIR=$(dirname $0)
+
+if [ -e "$SRCDIR/package_version" ]; then
+ . "$SRCDIR/package_version"
+fi
+
+if [ "$AUTO_UPDATE" = no ]; then
+ [ "$1" = release ] || exit 1
+else
+ AUTO_UPDATE=yes
+fi
+
+# We run `git status` before describe here to ensure that we don't get a false
+# -dirty from files that have been touched but are not actually altered in the
+# working dir.
+GIT_VERSION=$(cd "$SRCDIR" && git status > /dev/null 2>&1 \
+ && git describe --tags --match 'v*' --dirty 2> /dev/null)
+GIT_VERSION=${GIT_VERSION#v}
+
+if [ -n "$GIT_VERSION" ]; then
+
+ [ "$GIT_VERSION" != "$PACKAGE_VERSION" ] || exit 1
+ PACKAGE_VERSION="$GIT_VERSION"
+
+elif [ -z "$PACKAGE_VERSION" ]; then
+ # No current package_version and no git ...
+ # We really shouldn't ever get here, because this script should only be
+ # included in the git repository, and should usually be export-ignored.
+ PACKAGE_VERSION="unknown"
+else
+ exit 1
+fi
+
+cat > "$SRCDIR/package_version" <<-EOF
+ # Automatically generated by update_version.
+ # This file may be sourced into a shell script or makefile.
+
+ # Set this to 'no' if you do not wish the version information
+ # to be checked and updated for every build. Most people will
+ # never want to change this, it is an option for developers
+ # making frequent changes that they know will not be released.
+ AUTO_UPDATE=$AUTO_UPDATE
+
+ PACKAGE_VERSION="$PACKAGE_VERSION"
+EOF
« no previous file with comments | « third_party/opus/src/tests/test_opus_encode.c ('k') | third_party/opus/src/win32/.gitignore » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698