summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorNathan Rossi <nathan@nathanrossi.com>2019-09-05 14:41:31 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-09-06 12:45:47 +0100
commit7289dccd09fcabdc917396a7675e19f466e4445c (patch)
treede8416534189515ababcbfdb3621691e0c5d4fba /meta
parente5fe46c4c09b4a73da0983328700311a63736a5e (diff)
downloadpoky-7289dccd09fcabdc917396a7675e19f466e4445c.tar.gz
archiver.bbclass: Do not archive srpm's if there are no package tasks
Do not attempt to archive recipes which have no packaging tasks (e.g. inherits nopackages). (From OE-Core rev: 8618425e3f5a095a4fd409029c46e770c9526eee) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/archiver.bbclass14
1 files changed, 8 insertions, 6 deletions
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index af9f010dfc..13b05bb5f2 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -78,6 +78,9 @@ python () {
78 bb.debug(1, 'archiver: %s is excluded, covered by gcc-source' % pn) 78 bb.debug(1, 'archiver: %s is excluded, covered by gcc-source' % pn)
79 return 79 return
80 80
81 def hasTask(task):
82 return bool(d.getVarFlag(task, "task", False)) and not bool(d.getVarFlag(task, "noexec", False))
83
81 ar_src = d.getVarFlag('ARCHIVER_MODE', 'src') 84 ar_src = d.getVarFlag('ARCHIVER_MODE', 'src')
82 ar_dumpdata = d.getVarFlag('ARCHIVER_MODE', 'dumpdata') 85 ar_dumpdata = d.getVarFlag('ARCHIVER_MODE', 'dumpdata')
83 ar_recipe = d.getVarFlag('ARCHIVER_MODE', 'recipe') 86 ar_recipe = d.getVarFlag('ARCHIVER_MODE', 'recipe')
@@ -98,9 +101,6 @@ python () {
98 101
99 # There is a corner case with "gcc-source-${PV}" recipes, they don't have 102 # There is a corner case with "gcc-source-${PV}" recipes, they don't have
100 # the "do_configure" task, so we need to use "do_preconfigure" 103 # the "do_configure" task, so we need to use "do_preconfigure"
101 def hasTask(task):
102 return bool(d.getVarFlag(task, "task", False)) and not bool(d.getVarFlag(task, "noexec", False))
103
104 if hasTask("do_preconfigure"): 104 if hasTask("do_preconfigure"):
105 d.appendVarFlag('do_ar_configured', 'depends', ' %s:do_preconfigure' % pn) 105 d.appendVarFlag('do_ar_configured', 'depends', ' %s:do_preconfigure' % pn)
106 elif hasTask("do_configure"): 106 elif hasTask("do_configure"):
@@ -118,7 +118,11 @@ python () {
118 118
119 # Output the SRPM package 119 # Output the SRPM package
120 if d.getVarFlag('ARCHIVER_MODE', 'srpm') == "1" and d.getVar('PACKAGES'): 120 if d.getVarFlag('ARCHIVER_MODE', 'srpm') == "1" and d.getVar('PACKAGES'):
121 if "package_rpm" in d.getVar('PACKAGE_CLASSES'): 121 if "package_rpm" not in d.getVar('PACKAGE_CLASSES'):
122 bb.fatal("ARCHIVER_MODE[srpm] needs package_rpm in PACKAGE_CLASSES")
123
124 # Some recipes do not have any packaging tasks
125 if hasTask("do_package_write_rpm"):
122 d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_package_write_rpm' % pn) 126 d.appendVarFlag('do_deploy_archives', 'depends', ' %s:do_package_write_rpm' % pn)
123 d.appendVarFlag('do_package_write_rpm', 'dirs', ' ${ARCHIVER_RPMTOPDIR}') 127 d.appendVarFlag('do_package_write_rpm', 'dirs', ' ${ARCHIVER_RPMTOPDIR}')
124 d.appendVarFlag('do_package_write_rpm', 'sstate-inputdirs', ' ${ARCHIVER_RPMTOPDIR}') 128 d.appendVarFlag('do_package_write_rpm', 'sstate-inputdirs', ' ${ARCHIVER_RPMTOPDIR}')
@@ -133,8 +137,6 @@ python () {
133 d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_patched' % pn) 137 d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_patched' % pn)
134 elif ar_src == "configured": 138 elif ar_src == "configured":
135 d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_configured' % pn) 139 d.appendVarFlag('do_package_write_rpm', 'depends', ' %s:do_ar_configured' % pn)
136 else:
137 bb.fatal("ARCHIVER_MODE[srpm] needs package_rpm in PACKAGE_CLASSES")
138} 140}
139 141
140# Take all the sources for a recipe and puts them in WORKDIR/archiver-work/. 142# Take all the sources for a recipe and puts them in WORKDIR/archiver-work/.