Skip to contentSkip to conversation

archiver.bbclass

PATCH New Joe Slater 1 participant 2 messages Aug 26, 2014

lore
Share & tools
lore

Joe Slater

author
#0 lore raw

v2 cover archiver.bbclass

Do not accidently undo commit a5393823...

Joe Slater (1):
archiver.bbclass: add revision to git tarfile name

 meta/classes/archiver.bbclass |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
Signature · 1 line
1.7.3.4
author
#1 lore raw

PATCH v2 1/1 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.

---
 meta/classes/archiver.bbclass |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
meta/classes/archiver.bbclass +6 -1
index 35e5411..058ba63 100644
@@ -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()
Signature · 1 line
1.7.3.4