]> code.ossystems Code Review - openembedded-core.git/commitdiff
archiver.bbclass: add revision to git tarfile name
authorJoe Slater <jslater@windriver.com>
Tue, 26 Aug 2014 17:29:31 +0000 (10:29 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 27 Aug 2014 11:12:05 +0000 (12:12 +0100)
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>
meta/classes/archiver.bbclass

index 35e541194c1d5fbe3bbeb709d08eed32a014defb..058ba63437a3d060accce4a30540176e1d0f0c6b 100644 (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()