Description of problem: I accidentally tried to yum install a source rpm instead of the binary rpm. It gave an error message, but then threw an exception. It should probably exit a little more gracefully than that. yum-3.2.17-2.fc9.noarch How reproducible: Very, try yum installing a source rpm. This is the stack trace and the step I took to produce the problem: [mbooth@sd devel]$ sudo yum install /home/mbooth/fedora-cvs/eclipse-phpeclipse/devel/eclipse-phpeclipse-1.2.0-1.fc10.src.rpm --nogpgcheck [sudo] password for mbooth: Loaded plugins: refresh-packagekit Setting up Install Process Parsing package install arguments Examining /home/mbooth/fedora-cvs/eclipse-phpeclipse/devel/eclipse-phpeclipse-1.2.0-1.fc10.src.rpm: eclipse-phpeclipse-1.2.0-1.fc10.src Cannot add package /home/mbooth/fedora-cvs/eclipse-phpeclipse/devel/eclipse-phpeclipse-1.2.0-1.fc10.src.rpm to transaction. Not a compatible architecture: src Traceback (most recent call last): File "/usr/bin/yum", line 29, in <module> yummain.user_main(sys.argv[1:], exit_code=True) File "/usr/share/yum-cli/yummain.py", line 243, in user_main errcode = main(args) File "/usr/share/yum-cli/yummain.py", line 118, in main result, resultmsgs = base.doCommands() File "/usr/share/yum-cli/cli.py", line 338, in doCommands return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds) File "/usr/share/yum-cli/yumcommands.py", line 171, in doCommand return base.installPkgs(extcmds) File "/usr/share/yum-cli/cli.py", line 523, in installPkgs val, msglist = self.localInstall(filelist=[arg]) File "/usr/share/yum-cli/cli.py", line 647, in localInstall txmbrs = self.installLocal(pkg, updateonly=updateonly) File "/usr/lib/python2.5/site-packages/yum/__init__.py", line 2575, in installLocal return result NameError: global name 'result' is not defined
We fixed yum to not install .src.rpm's in 3.2.17 at the latest, so this bug is fixed now.
Are you sure? That's the version I'm using and is the version that generates the traceback I posted above...
You're right, this is the fix (in upstream now): diff --git a/yum/__init__.py b/yum/__init__.py index 16a56b2..3e547f5 100644 --- a/yum/__init__.py +++ b/yum/__init__.py @@ -2672,7 +2672,7 @@ class YumBase(depsolve.Depsolve): # do this: but it's not a config file sort of thing if po.arch not in rpmUtils.arch.getArchList(): self.logger.critical(_('Cannot add package %s to transaction. Not a - return result + return tx_return # everything installed that matches the name installedByKey = self.rpmdb.searchNevra(name=po.name)
And this is available in 3.2.19