archiver.bbclass: add revision to git tarfile name

When archiving original source, insert the first 10
characters of srcrev, after stripping off any
AUTOINC+, into the filename for tarfiles created
from directories.

(From OE-Core rev: 36726049a6a452f85d7cc849d57ad6af05d6d3ea)

Signed-off-by: Joe Slater <jslater@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Joe Slater 2014-08-26 10:29:31 -07:00 committed by Richard Purdie
parent 3a1b605992
commit a9b080405e
1 changed files with 6 additions and 1 deletions

View File

@ -146,7 +146,12 @@ python do_ar_original() {
fetch.unpack(tmpdir, (url,))
os.chdir(tmpdir)
tarname = os.path.join(ar_outdir, basename + '.tar.gz')
# We split on '+' to chuck any annoying AUTOINC+ in the revision.
try:
src_rev = bb.fetch2.get_srcrev(d).split('+')[-1][:10]
except:
src_rev = 'NOREV'
tarname = os.path.join(ar_outdir, basename + '.' + src_rev + '.tar.gz')
tar = tarfile.open(tarname, 'w:gz')
tar.add('.')
tar.close()