summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2016-03-22 14:04:03 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-25 10:29:17 +0000
commitd7cf2c3230083b08e7443a52af6227a4e2186acb (patch)
tree7f06180f7964d31246efb8bfe99f1a0b3794d4a4 /meta/classes
parent2cb4cb7a6c94d91623fce2ff1260c26a77f69ac6 (diff)
downloadpoky-d7cf2c3230083b08e7443a52af6227a4e2186acb.tar.gz
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. (From OE-Core rev: 3f903cb767150e316337929d72559cad6931039a) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/archiver.bbclass21
1 files changed, 6 insertions, 15 deletions
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index d709f788a7..7758f3c44d 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -126,21 +126,9 @@ python do_ar_original() {
126 if os.path.isfile(local): 126 if os.path.isfile(local):
127 shutil.copy(local, ar_outdir) 127 shutil.copy(local, ar_outdir)
128 elif os.path.isdir(local): 128 elif os.path.isdir(local):
129 basename = os.path.basename(local)
130
131 tmpdir = tempfile.mkdtemp(dir=d.getVar('ARCHIVER_WORKDIR', True)) 129 tmpdir = tempfile.mkdtemp(dir=d.getVar('ARCHIVER_WORKDIR', True))
132 fetch.unpack(tmpdir, (url,)) 130 fetch.unpack(tmpdir, (url,))
133 131 create_tarball(d, tmpdir + '/.', '', ar_outdir)
134 os.chdir(tmpdir)
135 # We eliminate any AUTOINC+ in the revision.
136 try:
137 src_rev = bb.fetch2.get_srcrev(d).replace('AUTOINC+','')
138 except:
139 src_rev = 'NOREV'
140 tarname = os.path.join(ar_outdir, basename + '.' + src_rev + '.tar.gz')
141 tar = tarfile.open(tarname, 'w:gz')
142 tar.add('.')
143 tar.close()
144 132
145 # Emit patch series files for 'original' 133 # Emit patch series files for 'original'
146 bb.note('Writing patch series files...') 134 bb.note('Writing patch series files...')
@@ -222,8 +210,11 @@ def create_tarball(d, srcdir, suffix, ar_outdir):
222 return 210 return
223 211
224 bb.utils.mkdirhier(ar_outdir) 212 bb.utils.mkdirhier(ar_outdir)
225 tarname = os.path.join(ar_outdir, '%s-%s.tar.gz' % \ 213 if suffix:
226 (d.getVar('PF', True), suffix)) 214 filename = '%s-%s.tar.gz' % (d.getVar('PF', True), suffix)
215 else:
216 filename = '%s.tar.gz' % d.getVar('PF', True)
217 tarname = os.path.join(ar_outdir, filename)
227 218
228 srcdir = srcdir.rstrip('/') 219 srcdir = srcdir.rstrip('/')
229 dirname = os.path.dirname(srcdir) 220 dirname = os.path.dirname(srcdir)