summaryrefslogtreecommitdiffstats
path: root/meta/classes/archiver.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/archiver.bbclass')
-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)