Skip to content

Instantly share code, notes, and snippets.

@scop
Created July 10, 2015 07:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scop/53c410f148860c4884f0 to your computer and use it in GitHub Desktop.
Save scop/53c410f148860c4884f0 to your computer and use it in GitHub Desktop.
--- Pkg.py
+++ Pkg.py
@@ -403,10 +403,19 @@
current_version=d[1]
if current_version.find(':') > 0:
current_version=''.join(current_version.split(':')[1:])
- if d[2] & rpm.RPMSENSE_EQUAL != rpm.RPMSENSE_EQUAL or current_version != version:
- return 0
- else:
- return 1
+
+ if d[2] & rpm.RPMSENSE_EQUAL:
+ if current_version == version:
+ return 1
+
+ if d[2] & rpm.RPMSENSE_GREATER:
+ if current_version.count('.') > version.count('.'):
+ current_version = '.'.join(current_version.split('.')[0:version.count('.')])
+
+ if current_version == version:
+ return 1
+
+ return 0
return 0
def conflicts(self):
@@ -429,7 +438,7 @@
flags=[flags]
for loop in range(len(versions)):
if prereq != None and flags[loop] & PREREQ_FLAG:
- prereq.append((names[loop], versions[loop], flags[loop] & PREREQ_FLAG))
+ prereq.append((names[loop], versions[loop], flags[loop] & (~PREREQ_FLAG)))
else:
list.append((names[loop], versions[loop], flags[loop]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment