Fix yum spider for versions with >1 repo rpm
authorMagnus Hagander <magnus@hagander.net>
Thu, 15 Feb 2018 15:34:50 +0000 (16:34 +0100)
committerMagnus Hagander <magnus@hagander.net>
Thu, 15 Feb 2018 15:34:50 +0000 (16:34 +0100)
The code was supposed to pick the latest version of the repo rpm in this
scenario, but at some point the data structure was updated and the code
was not, so it ended up actually picking the *oldest* version of the
repo rpm.

tools/ftp/spider_yum.py

index 3c576a8f633ad053b6c02d90a11b381269ced207..5db952509869b0950f0b193c70e39b80be49daf6 100755 (executable)
@@ -77,7 +77,7 @@ if __name__ == "__main__":
                                                if pinfo['p'] == familypath and pinfo['f'] == shortdist:
                                                        if not reporpms[v].has_key(p):
                                                                reporpms[v][p] = {}
-                                                       reporpms[v][p][arch] = max(ver, reporpms[v].get(p, 0))
+                                                       reporpms[v][p][arch] = max(ver, reporpms[v][p].get(arch, 0))
                                                        platforms[p]['found'] = True
                                                        break
                                        else: