Bug 458589

Summary: Traceback trying to yum install source rpm.
Product: [Fedora] Fedora Reporter: Mat Booth <mat.booth>
Component: yumAssignee: Seth Vidal <skvidal>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 9CC: ffesti, james.antill, katzj, pmatilai, tla
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: yum-3.2.19 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-09-03 13:57:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Mat Booth 2008-08-10 15:38:28 UTC
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.


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

Comment 1 James Antill 2008-08-10 15:43:33 UTC
 We fixed yum to not install .src.rpm's in 3.2.17 at the latest, so this bug is fixed now.

Comment 2 Mat Booth 2008-08-10 22:17:09 UTC
Are you sure? That's the version I'm using and is the version that generates the traceback I posted above...

Comment 3 James Antill 2008-08-10 22:35:47 UTC
 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)

Comment 4 seth vidal 2008-09-03 13:57:10 UTC
And this is available in 3.2.19