summaryrefslogtreecommitdiff
path: root/meta
diff options
context:
space:
mode:
authorJoe Slater <jslater@windriver.com>2014-08-26 10:29:31 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-08-27 12:12:05 +0100
commit36726049a6a452f85d7cc849d57ad6af05d6d3ea (patch)
tree3aa783fe50d93ca665b3fd28e0bcc13896e30287 /meta
parentb6cc93f1008e2313eb9a17a11bfbc9980736878d (diff)
downloadopenembedded-core-36726049a6a452f85d7cc849d57ad6af05d6d3ea.tar.gz
openembedded-core-36726049a6a452f85d7cc849d57ad6af05d6d3ea.tar.bz2
openembedded-core-36726049a6a452f85d7cc849d57ad6af05d6d3ea.zip
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. Signed-off-by: Joe Slater <jslater@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/archiver.bbclass7
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 35e541194c..058ba63437 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -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()