summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/archiver.bbclass35
1 files changed, 3 insertions, 32 deletions
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 089d70748c..eec8024db7 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -99,27 +99,6 @@ python () {
99 d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_patched' % pn) 99 d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_patched' % pn)
100 elif ar_src == "configured": 100 elif ar_src == "configured":
101 d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_configured' % pn) 101 d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_configured' % pn)
102
103 # The gcc staff uses shared source
104 flag = d.getVarFlag("do_unpack", "stamp-base", True)
105 if flag:
106 if ar_src in [ 'original', 'patched' ]:
107 ar_outdir = os.path.join(d.getVar('ARCHIVER_TOPDIR', True), 'work-shared')
108 d.setVar('ARCHIVER_OUTDIR', ar_outdir)
109 d.setVarFlag('do_ar_original', 'stamp-base', flag)
110 d.setVarFlag('do_ar_patched', 'stamp-base', flag)
111 d.setVarFlag('do_unpack_and_patch', 'stamp-base', flag)
112 d.setVarFlag('do_ar_original', 'vardepsexclude', 'PN PF ARCHIVER_OUTDIR WORKDIR')
113 d.setVarFlag('do_unpack_and_patch', 'vardepsexclude', 'PN PF ARCHIVER_OUTDIR WORKDIR')
114 d.setVarFlag('do_ar_patched', 'vardepsexclude', 'PN PF ARCHIVER_OUTDIR WORKDIR')
115 d.setVarFlag('create_diff_gz', 'vardepsexclude', 'PF')
116 d.setVarFlag('create_tarball', 'vardepsexclude', 'PF')
117
118 flag_clean = d.getVarFlag('do_unpack', 'stamp-base-clean', True)
119 if flag_clean:
120 d.setVarFlag('do_ar_original', 'stamp-base-clean', flag_clean)
121 d.setVarFlag('do_ar_patched', 'stamp-base-clean', flag_clean)
122 d.setVarFlag('do_unpack_and_patch', 'stamp-base-clean', flag_clean)
123} 102}
124 103
125# Take all the sources for a recipe and puts them in WORKDIR/archiver-work/. 104# Take all the sources for a recipe and puts them in WORKDIR/archiver-work/.
@@ -179,12 +158,7 @@ python do_ar_patched() {
179 ar_outdir = d.getVar('ARCHIVER_OUTDIR', True) 158 ar_outdir = d.getVar('ARCHIVER_OUTDIR', True)
180 bb.note('Archiving the patched source...') 159 bb.note('Archiving the patched source...')
181 d.setVar('WORKDIR', d.getVar('ARCHIVER_WORKDIR', True)) 160 d.setVar('WORKDIR', d.getVar('ARCHIVER_WORKDIR', True))
182 # The gcc staff uses shared source 161 create_tarball(d, d.getVar('S', True), 'patched', ar_outdir)
183 flag = d.getVarFlag('do_unpack', 'stamp-base', True)
184 if flag:
185 create_tarball(d, d.getVar('S', True), 'patched', ar_outdir, 'gcc')
186 else:
187 create_tarball(d, d.getVar('S', True), 'patched', ar_outdir)
188} 162}
189 163
190python do_ar_configured() { 164python do_ar_configured() {
@@ -222,17 +196,14 @@ python do_ar_configured() {
222 create_tarball(d, srcdir, 'configured', ar_outdir) 196 create_tarball(d, srcdir, 'configured', ar_outdir)
223} 197}
224 198
225def create_tarball(d, srcdir, suffix, ar_outdir, pf=None): 199def create_tarball(d, srcdir, suffix, ar_outdir):
226 """ 200 """
227 create the tarball from srcdir 201 create the tarball from srcdir
228 """ 202 """
229 import tarfile 203 import tarfile
230 204
231 bb.utils.mkdirhier(ar_outdir) 205 bb.utils.mkdirhier(ar_outdir)
232 if pf: 206 tarname = os.path.join(ar_outdir, '%s-%s.tar.gz' % \
233 tarname = os.path.join(ar_outdir, '%s-%s.tar.gz' % (pf, suffix))
234 else:
235 tarname = os.path.join(ar_outdir, '%s-%s.tar.gz' % \
236 (d.getVar('PF', True), suffix)) 207 (d.getVar('PF', True), suffix))
237 208
238 srcdir = srcdir.rstrip('/') 209 srcdir = srcdir.rstrip('/')