Created
July 10, 2015 07:10
-
-
Save scop/53c410f148860c4884f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- 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