| |
@@ -1218,8 +1218,9 @@
|
| |
# Now assemble into a yum repo:
|
| |
for pkg in self.rpmBuilds:
|
| |
for arch in arches:
|
| |
- for subpackage in pkg.get_subpackage_names():
|
| |
- shutil.copy(pkg.get_built_rpm(arch, name=subpackage), self.repoDir)
|
| |
+ if arch in pkg.get_build_archs():
|
| |
+ for subpackage in pkg.get_subpackage_names():
|
| |
+ shutil.copy(pkg.get_built_rpm(arch, name=subpackage), self.repoDir)
|
| |
|
| |
try:
|
| |
subprocess.check_output(["createrepo_c", self.repoDir], stderr=subprocess.STDOUT)
|
| |
@@ -1879,6 +1880,21 @@
|
| |
self.assert_is_file(os.path.join(repo.repoDir, 'test-multilib-package-0.1-1.i386.rpm'))
|
| |
self.assert_is_file(os.path.join(repo.repoDir, 'test-multilib-package-0.1-1.x86_64.rpm'))
|
| |
|
| |
+ @unittest.skipIf(not shutil.which('createrepo_c'), 'createrepo_c not found in PATH')
|
| |
+ def test_arch_with_noarch(self):
|
| |
+ archful_package = SimpleRpmBuild('test-package', '0.1', '1')
|
| |
+ noarch_package = SimpleRpmBuild('python-package', '0.1', '1', ['noarch'])
|
| |
+ repo = YumRepoBuild([archful_package, noarch_package])
|
| |
+ self.addCleanup(shutil.rmtree, archful_package.get_base_dir())
|
| |
+ self.addCleanup(shutil.rmtree, noarch_package.get_base_dir())
|
| |
+ self.addCleanup(shutil.rmtree, repo.repoDir)
|
| |
+
|
| |
+ repo.make(expectedArch, 'noarch')
|
| |
+
|
| |
+ self.assert_is_dir(os.path.join(repo.repoDir, 'repodata'))
|
| |
+ self.assert_is_file(os.path.join(repo.repoDir, 'test-package-0.1-1.%s.rpm' % expectedArch))
|
| |
+ self.assert_is_file(os.path.join(repo.repoDir, 'python-package-0.1-1.noarch.rpm'))
|
| |
+
|
| |
if __name__ == "__main__":
|
| |
unittest.main()
|
| |
|
| |
Currently the YumRepoBuild class assumes that every package you pass
to it was built for the requested architecture. But this makes it
impossible to put noarch packages into the repository, because
YumRepoBuild will look for an arch-specific package when only a noarch
package was produced.
Change YumRepoBuild to only copy over packages if they actually produced
the requested arch, otherwise skip them.