allow gitrev to be read from file #1934

Merged
merged 2 commits into from Feb 7, 2013

Projects

None yet

3 participants

@wsnipex
Member
wsnipex commented Dec 14, 2012

needed for building outside of a git repo

for post frodo

@wsnipex
Member
wsnipex commented Dec 14, 2012

well, gitrev is just a text file that has the git revision of the build. Its a replacement for what the git log - that is used when configure is run from within a git repo - spits out. Its what the system info screen shows besides the build date.
It would be up to the user to fill it with the last git revision this source has.

This patch is probably only useful for packaging on linux, because e.g. launchpad only takes tarballs, you cannot build out of a git repo. That means that the Xbmc info screen shows buildate with revision Unknown. With this patch the packager could include this gitrev file to include that information and be in line with all other platforms that build from git dirs.

I'm not sure myself if this is necessary to be included in xbmc, up to you.

I agree that the filename could be more self explanatory, can change it if you agree with the idea of the PR.

@theuni
Member
theuni commented Dec 15, 2012

ping @wsnipex

If you use tools/tools/mk-release-source to create your tarballs, you'll get pre-bootstrapped/codegen's sources that also contain a VERSION file.

The first line is the git revision as it was given (it could be a tag, branch, HEAD~5, etc)
The second line is the real git hash for that commit.
For non-tagged revisions, they will be the same thing.

I think this is what you needed here? If you change this to use VERSION (i used that filename because it's relatively common to indicate the version of the tarball), I believe you should be all set.

@wsnipex
Member
wsnipex commented Dec 15, 2012

@theuni great :) I adjusted this to use the VERSION file. the cut command trims the revision to 16 chars, which would allow the exact same revision format as like building out of git (e.g. 20121215-abcdefg). What do you think?

@wsnipex
Member
wsnipex commented Dec 16, 2012

@theuni I updated to use awk. I'd like to keep it generic enough to work also with VERSION files that contain only one line or more then two, so we always use the last line from the file.

@theuni
Member
theuni commented Dec 16, 2012

@wsnipex mind simplifying a bit for readability?

awk 'END{print substr($1,1,16)}' VERSION

After that, I'd say we should get this in for Frodo, since it's harmless and will help us package it better

@wsnipex
Member
wsnipex commented Dec 16, 2012

this is much cleaner indeed :) updated

wsnipex added some commits Dec 9, 2012
@wsnipex wsnipex configure: allow GIT_REV to be read from VERSION file
needed for building outside of a git repo
1704ff6
@wsnipex wsnipex release-source script needs bash
on some systems /bin/sh is a simplistic posix shell
4377a98
@davilla davilla merged commit 4af88e7 into xbmc:master Feb 7, 2013
@wsnipex wsnipex deleted the wsnipex:gitrev branch Apr 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment