2017-10-18 11:07:48 +00:00
|
|
|
#!/usr/bin/env python
|
|
|
|
|
|
|
|
|
|
|
|
import sys
|
|
|
|
from collections import namedtuple
|
|
|
|
import rpmfluff
|
|
|
|
|
|
|
|
|
|
|
|
RPM = namedtuple('RPM', ['name', 'version', 'release', 'epoch'])
|
|
|
|
|
|
|
|
|
|
|
|
SPECS = [
|
|
|
|
RPM('foo', '1.0', '1', None),
|
|
|
|
RPM('foo', '1.0', '2', '1'),
|
|
|
|
RPM('foo', '1.1', '1', '1'),
|
2018-11-08 16:39:02 +00:00
|
|
|
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),
|
2017-10-18 11:07:48 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
try:
|
|
|
|
arch = sys.argv[1]
|
|
|
|
except IndexError:
|
|
|
|
arch = 'x86_64'
|
|
|
|
|
|
|
|
pkgs = []
|
|
|
|
for spec in SPECS:
|
|
|
|
pkg = rpmfluff.SimpleRpmBuild(spec.name, spec.version, spec.release, [arch])
|
|
|
|
pkg.epoch = spec.epoch
|
|
|
|
pkgs.append(pkg)
|
|
|
|
|
|
|
|
repo = rpmfluff.YumRepoBuild(pkgs)
|
|
|
|
repo.make(arch)
|
|
|
|
|
|
|
|
for pkg in pkgs:
|
|
|
|
pkg.clean()
|
|
|
|
|
|
|
|
print(repo.repoDir)
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|