Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

Commit

Permalink
[patterns] Support adding ver tag to pattern entries
Browse files Browse the repository at this point in the history
  • Loading branch information
Islam Amer committed Sep 2, 2013
1 parent 22d9590 commit 7eb9a57
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion repomd-pattern-builder.py
Expand Up @@ -103,7 +103,17 @@ def process_yaml(stream, version, release, xmlroot, nsmap_name, newobsapi):
print "ERROR: Found dict and expected string value. '%s'" % (p)
sys.exit(1)
entry = etree.SubElement(req, "{%s}entry" %rpm_ns)
entry.set("name", p)

name = p
ver = None
for op in [">=", "<=", ">", "<", "="]:
if op in p:
name, ver = p.split(op)
break

entry.set("name", name.strip())
if ver:
entry.set("ver", "%s %s" % (op, ver.strip()))

def create_patterns(patterns_dir, version, release, outputdir, newobsapi):
dirlist = os.listdir(patterns_dir)
Expand Down

0 comments on commit 7eb9a57

Please sign in to comment.