Git can tell you what the root dir of the repo is, so the scripts don't
need to force the user to cd there first.
Signed-off-by: Sebastian Kuzminsky <seb@highlab.com>
The get-version-from-git script makes a debian version number from
information it gets from git. Part of this is replacing any characters
that are invalid in version numbers with the character "-", but due to a
bug it used to just replace the *first* invalid character. This commit
fixes it to replace *all* invalid characters.
On our official release branches (v2.4_branch, v2.5_branch, and master),
the package version number comes from the "git describe" of the most
recent signed tag, and this has always worked well.
But unknown branches (all but the three above) sometimes accidentally
got the wrong version number. This commit fixes that, unknown branches
now always get "contents of VERSION file", plus "branch name", plus
"SHA1 of branch tip", which I think is about as good as we can get it.
This fixes the recent commit f176b044930dec1cb22d64cb7fc590c79cd30485...
The scripts/get-version-from-git script is used to produce a version
number based on things like the current branch and most recent tag signed
by the release managers.
It used to fail completely on branches other than 2.4, 2.5, and master.
This commit makes it do something hopefully reasonable on branches it
doesn't know about: it uses the version from the VERSION file, plus "~",
plus the branch name, plus another "~", plus the sha1 of the HEAD commit.
This commit does these things:
* Add a small shell library called githelper.sh, which reads a bunch
of info from git and makes it available as environment variables
in the caller.
* Add a script called version-is-release, which checks to see if
the current version (HEAD) has a signed release tag pointing to it.
* Update update-dch-from-git and get-version-from-git to use the
new githelper library, for consistency.
This commit splits the debian/update-dch-from-git script, factoring
out the code that determines the version, leaving behind the code that
updates the changelog.
This way the version information can be used to overwrite the VERSION
file, and generally be useful elsewhere.