[oe-commits] [openembedded-core] 28/28: archiver.bbclass: Fix tar name for git repositories

git at git.openembedded.org git at git.openembedded.org
Wed Mar 23 17:53:49 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 6a315a417f5dcba8aa85fb3afa6e2295c2103c12
Author: Mariano Lopez <mariano.lopez at linux.intel.com>
AuthorDate: Tue Mar 22 14:04:03 2016 +0000

    archiver.bbclass: Fix tar name for git repositories
    
    When archiving the original source, the git repositories have the name as
    they are in the $DL_DIR plus the source revision; i.e.
    "git.yoctoproject.org.linux-yocto-4.4.git.89419d8b90_dadb436904.tar.gz".
    This change set the tar name to $PF.tar.gz instead, to have consistency with
    the others archives created by the class.
    
    Signed-off-by: Mariano Lopez <mariano.lopez at linux.intel.com>
    Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/classes/archiver.bbclass | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index d709f78..7758f3c 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -126,21 +126,9 @@ python do_ar_original() {
         if os.path.isfile(local):
             shutil.copy(local, ar_outdir)
         elif os.path.isdir(local):
-            basename = os.path.basename(local)
-
             tmpdir = tempfile.mkdtemp(dir=d.getVar('ARCHIVER_WORKDIR', True))
             fetch.unpack(tmpdir, (url,))
-
-            os.chdir(tmpdir)
-            # We eliminate any AUTOINC+ in the revision.
-            try:
-                src_rev = bb.fetch2.get_srcrev(d).replace('AUTOINC+','')
-            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()
+            create_tarball(d, tmpdir + '/.', '', ar_outdir)
 
     # Emit patch series files for 'original'
     bb.note('Writing patch series files...')
@@ -222,8 +210,11 @@ def create_tarball(d, srcdir, suffix, ar_outdir):
         return
 
     bb.utils.mkdirhier(ar_outdir)
-    tarname = os.path.join(ar_outdir, '%s-%s.tar.gz' % \
-            (d.getVar('PF', True), suffix))
+    if suffix:
+        filename = '%s-%s.tar.gz' % (d.getVar('PF', True), suffix)
+    else:
+        filename = '%s.tar.gz' % d.getVar('PF', True)
+    tarname = os.path.join(ar_outdir, filename)
 
     srcdir = srcdir.rstrip('/')
     dirname = os.path.dirname(srcdir)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list