Description of problem: The yum-changelog command does not work with rpms which do not contain any changelog information. Although every file should contain changelog information this problem should not brake down yum I think. The problem appears for example if I want to update the ifolder server. The server rpms are provided as a yum repository by the ifolder project. Here is the changelog output of such a file: # rpm -q --changelog ifolder3-server (none)[yum.repos.d]# Note that there is not even a new line created! Here is the error output of yum: yum --changelog update ifolder3-server Loading "changelog" plugin [...] Resolving Dependencies --> Populating transaction set with selected packages. Please wait. ---> Package ifolder3-server.i386 0:3.5.6129.1-1 set to be updated --> Running transaction check Traceback (most recent call last): File "/usr/bin/yum", line 29, in ? yummain.main(sys.argv[1:]) File "/usr/share/yum-cli/yummain.py", line 138, in main (result, resultmsgs) = base.buildTransaction() File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 402, in buildTransaction self.plugins.run('postresolve', rescode=rescode, restring=restring) File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 164, in run func(conduitcls(self, self.base, conf, **kwargs)) File "/usr/lib/yum-plugins/changelog.py", line 97, in postresolve_hook origpkgs[n] = times[0] IndexError: list index out of range
Created attachment 130358 [details] Handle packages with no changelogs Could you try whether the attached patch to changelog plugin will fix it? It should but I don't have a testcase at hand here...
I did a patch -i yum-changelog-nochangelog.patch changelog.py downgraded to an old version of the ifolder3-server and tried to update using yum with --changelog , and it crashed again: Changes in packages about to be updated: ifolder3-server - 3.5.6151.1-1.i386, ifolder3-server - 3.5.6152.1-1.i386 Traceback (most recent call last): File "/usr/bin/yum", line 29, in ? yummain.main(sys.argv[1:]) File "/usr/share/yum-cli/yummain.py", line 138, in main (result, resultmsgs) = base.buildTransaction() File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 402, in buildTransaction self.plugins.run('postresolve', rescode=rescode, restring=restring) File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 164, in run func(conduitcls(self, self.base, conf, **kwargs)) File "/usr/lib/yum-plugins/changelog.py", line 104, in postresolve_hook show_changes(conduit, 'Changes in packages about to be updated:') File "/usr/lib/yum-plugins/changelog.py", line 63, in show_changes for line in changelog_delta(srpms[name][0], origpkgs[name]): File "/usr/lib/yum-plugins/changelog.py", line 35, in changelog_delta for date, author, message in pkg.returnChangelog(): File "/usr/lib/python2.4/site-packages/repomd/packageObject.py", line 79, in returnChangelog return self.changelog AttributeError: YumInstalledPackage instance has no attribute 'changelog' In case you want to set up a testcase fast: Copy this repo-file to your /etc/yum.repos.d/*: http://forgeftp.novell.com/ifolder/server/3.5/iFolderServer-Fedora.repo Install the server: yum install ifolder3-server Downgrade to an older version: rpm -Uvh --force http://forgeftp.novell.com/ifolder/server/3.5/20060531-1507/linux/FEDORA-CORE-5.0-i386/rpms/ifolder3-server-3.5.6151.1-1.i386.rpm Update this with yum: yum --changelog ifolder3-server Whenever you want to test this again, reinstall the old server version (you can even make a rpm rollback if this is enabled in your system, which is not by default) and update again.
Ok, so it moves the crash to another spot, this latest crash is arguably a yum bug as it blindly returns an attribute that doesn't necessarily exist. I'll add a workaround to the plugin for now but I think the proper fix is to make yum do if hasattr(self, 'changelog'): return self.changelog else: return [] ..or something like that. I'll have a closer look next week, a bit busy right now.
This is solved in the currrent version of yum, where changelog is a property, so it is always defined.