From: Mark Wooding Date: Fri, 15 Apr 2016 18:53:37 +0000 (+0100) Subject: Update automatically managed build utilities. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/preload-hacks/commitdiff_plain/e6ecd2c12033354c49a8bf67d0815b7e7a23e2ab?hp=-c Update automatically managed build utilities. --- e6ecd2c12033354c49a8bf67d0815b7e7a23e2ab diff --combined auto-version index 0000000,0000000..79bb44c new file mode 100755 --- /dev/null +++ b/auto-version @@@ -1,0 -1,0 +1,102 @@@ ++#! /bin/sh ++### -*-sh-*- ++### ++### Make autoconf-like substitutions in files ++### ++### (c) 2008 Mark Wooding ++### ++ ++###----- Licensing notice --------------------------------------------------- ++### ++### This file is part of the Common Files Distribution (`common'). ++### ++### `Common' is free software; you can redistribute it and/or modify ++### it under the terms of the GNU General Public License as published by ++### the Free Software Foundation; either version 2 of the License, or ++### (at your option) any later version. ++### ++### `Common' is distributed in the hope that it will be useful, ++### but WITHOUT ANY WARRANTY; without even the implied warranty of ++### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++### GNU General Public License for more details. ++### ++### You should have received a copy of the GNU General Public License ++### along with `common'; if not, write to the Free Software Foundation, ++### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++set -e ++VERSION="1.3.10.1" ++ ++###-------------------------------------------------------------------------- ++### Parse command line arguments. ++ ++while [ $# -gt 0 ]; do ++ case $1 in ++ -h | --h | --he | --hel | --help) ++ cat <&2 ++ exit 1 ++ ;; ++ *) ++ break ++ ;; ++ esac ++ shift ++done ++ ++if [ $# -ne 0 ]; then ++ echo >&2 "Usage: auto-version" ++ exit 1 ++fi ++ ++###-------------------------------------------------------------------------- ++### Main program. ++ ++## If this is a Git checkout then Git should be able to identify the version. ++if [ -d .git ] && version=$(git describe --abbrev=4 2>/dev/null); then ++ ++ ## If the working tree is dirty, indicate with a `+'. ++ case "$(git diff-index --name-only HEAD)" in ++ "") ;; ++ *) version="$version+" ;; ++ esac ++ echo "$version" ++ exit 0 ++fi ++ ++## If this was unpacked from a source distribution, the RELEASE file sould ++## say what the version was. ++if [ -f RELEASE ]; then ++ cat RELEASE ++ exit 0 ++fi ++ ++## If we're Debianized, then the Debian changelog ought to know. ++if [ -f debian/changelog ]; then ++ sed -n '/^.*(\(.*\)).*$/ { s::\1:p; q; }' debian/changelog ++ exit 0 ++fi ++ ++## Otherwise we're screwed. ++echo UNKNOWN ++exit 0 ++ ++###----- That's all, folks --------------------------------------------------