commit aba9a341e6e7cfb2a58f6db7ee1b19372b7b0085
Author: Stanislav Ochotnicky <sochotnicky(a)redhat.com>
Date: Fri Mar 1 16:15:26 2013 +0100
[maven.prov] Generate versioned provides when <skipProvides/> is found
Naming is a bit counter-intuitive, but this means that compat packages
containing versioned jars/poms will not have race conditions with original
packages when autorequires kicks in
depgenerators/maven.prov | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/depgenerators/maven.prov b/depgenerators/maven.prov
index 76ca0c5..1c981d0 100755
--- a/depgenerators/maven.prov
+++ b/depgenerators/maven.prov
@@ -51,14 +51,24 @@ class TagBuilder:
buf.write('</fragments>')
fragments = buf.getvalue()
doc = fromstring(fragments)
+ versioned_provides = False
if doc.find('.//skipProvides') is not None:
- # this is compat package, don't generate mvn provides
- return
+ # this is compat package, generate versioned provides
+ # yes, the naming is weird
+ versioned_provides = True
+
for mpart in doc.findall('.//maven'):
groupId = mpart.find('groupId').text
artifactId = mpart.find('artifactId').text
version = mpart.find('version').text
- print "mvn(%s:%s) = %s" %(groupId, artifactId, version)
+ if versioned_provides:
+ print "mvn({gid}:{aid}:{version}) =
{version}".format(gid=groupId,
+ aid=artifactId,
+ version=version)
+ else:
+ print "mvn({gid}:{aid}) = {version}".format(gid=groupId,
+ aid=artifactId,
+ version=version)
if __name__ == "__main__":
Show replies by date