|
|
|
@ -6,17 +6,19 @@ from collections import namedtuple
|
|
|
|
|
import rpmfluff
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RPM = namedtuple('RPM', ['name', 'version', 'release', 'epoch'])
|
|
|
|
|
RPM = namedtuple('RPM', ['name', 'version', 'release', 'epoch', 'recommends'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SPECS = [
|
|
|
|
|
RPM('foo', '1.0', '1', None),
|
|
|
|
|
RPM('foo', '1.0', '2', '1'),
|
|
|
|
|
RPM('foo', '1.1', '1', '1'),
|
|
|
|
|
RPM('foo-bar', '1.0', '1', None),
|
|
|
|
|
RPM('foo-bar', '1.1', '1', None),
|
|
|
|
|
RPM('bar', '1.0', '1', None),
|
|
|
|
|
RPM('bar', '1.1', '1', None),
|
|
|
|
|
RPM('foo', '1.0', '1', None, None),
|
|
|
|
|
RPM('foo', '1.0', '2', '1', None),
|
|
|
|
|
RPM('foo', '1.1', '1', '1', None),
|
|
|
|
|
RPM('foo-bar', '1.0', '1', None, None),
|
|
|
|
|
RPM('foo-bar', '1.1', '1', None, None),
|
|
|
|
|
RPM('bar', '1.0', '1', None, None),
|
|
|
|
|
RPM('bar', '1.1', '1', None, None),
|
|
|
|
|
RPM('foo-with-weak-dep', '1.0', '1', None, ['foo-weak-dep']),
|
|
|
|
|
RPM('foo-weak-dep', '1.0', '1', None, None),
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -30,6 +32,15 @@ def main():
|
|
|
|
|
for spec in SPECS:
|
|
|
|
|
pkg = rpmfluff.SimpleRpmBuild(spec.name, spec.version, spec.release, [arch])
|
|
|
|
|
pkg.epoch = spec.epoch
|
|
|
|
|
|
|
|
|
|
if spec.recommends:
|
|
|
|
|
# Skip packages that require weak deps but an older version of RPM is being used
|
|
|
|
|
if not hasattr(rpmfluff, "can_use_rpm_weak_deps") or not rpmfluff.can_use_rpm_weak_deps():
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
for recommend in spec.recommends:
|
|
|
|
|
pkg.add_recommends(recommend)
|
|
|
|
|
|
|
|
|
|
pkgs.append(pkg)
|
|
|
|
|
|
|
|
|
|
repo = rpmfluff.YumRepoBuild(pkgs)
|
|
|
|
|