[Yum] what do You think about this?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



                Hi!

===================================
diff -u -r1.51 clientStuff.py
--- clientStuff.py	5 Nov 2002 01:33:45 -0000	1.51
+++ clientStuff.py	5 Nov 2002 22:02:42 -0000
@@ -212,6 +212,11 @@
 
     return h
 
+MAP_OBSOLETES = [('>', 1),
+                 ('>=', 1), ('>=', 0),
+                 ('=', 0),
+                 ('<=', 0), ('<=', -1),
+                 ('<', -1)]
 
 def returnObsoletes(headerNevral, rpmNevral, uninstNAlist):
     obsdict = {} # obsdict[obseletinglist] = packageitobsoletes
@@ -243,41 +248,8 @@
                         (e1, v1, r1) = rpmNevral.evr(name, arch)
                         (e2, v2, r2) = str_to_version(obvalue[3])
                         rc = compareEVR((e1, v1, r1), (e2, v2, r2))
-                        if obvalue[2] == '>':
-                            if rc >= 1:
-                                obsdict[(name, arch)] = obvalue[0]
-                            elif rc == 0:
-                                pass
-                            elif rc <= -1:
-                                pass
-                        elif obvalue[2] == '>=':
-                            if rc >= 1:
-                                obsdict[(name, arch)] = obvalue[0]
-                            elif rc == 0:
-                                obsdict[(name, arch)] = obvalue[0]
-                            elif rc <= -1:
-                                pass
-                        elif obvalue[2] == '=':
-                            if rc >= 1:
-                                pass
-                            elif rc == 0:
-                                obsdict[(name, arch)] = obvalue[0]
-                            elif rc <= -1:
-                                pass
-                        elif obvalue[2] == '<=':
-                            if rc >= 1:
-                                pass
-                            elif rc == 0:
-                                obsdict[(name, arch)] = obvalue[0]
-                            elif rc <= -1:
-                                obsdict[(name, arch)] = obvalue[0]
-                        elif obvalue[2] == '<':
-                            if rc >= 1:
-                                pass
-                            elif rc == 0:
-                                pass
-                            elif rc <= -1:
-                                obsdict[(name, arch)] = obvalue[0]
+                        if (obvalue[2], rc) in MAP_OBSOLETES:
+                            obsdict[(name, arch)] = obvalue[0]
     return obsdict
 
 def progresshook(blocks, blocksize, total):
===================================
-- 
		Bor.


[Index of Archives]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux