Bug 458589 - Traceback trying to yum install source rpm.
Summary: Traceback trying to yum install source rpm.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: 9
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Seth Vidal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-08-10 15:38 UTC by Mat Booth
Modified: 2014-01-21 23:03 UTC (History)
5 users (show)

Fixed In Version: yum-3.2.19
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-09-03 13:57:10 UTC
Type: ---


Attachments (Terms of Use)

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.

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

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


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