Bug 458589 - Traceback trying to yum install source rpm.
Traceback trying to yum install source rpm.
Product: Fedora
Classification: Fedora
Component: yum (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Seth Vidal
Fedora Extras Quality Assurance
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2008-08-10 11:38 EDT by Mat Booth
Modified: 2014-01-21 18:03 EST (History)
5 users (show)

See Also:
Fixed In Version: yum-3.2.19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-09-03 09:57:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Mat Booth 2008-08-10 11:38:28 EDT
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 11:43:33 EDT
 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 18:17:09 EDT
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 18:35:47 EDT
 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 09:57:10 EDT
And this is available in 3.2.19

Note You need to log in before you can comment on or make changes to this bug.