Ticket #109 (closed defect: fixed)

Opened 3 years ago

Last modified 7 months ago

--Exclude option crashes yum when matches nothing

Reported by: Kyum Assigned to: skvidal
Priority: major Milestone: Translation stuff and i18n
Component: yum Version: Stable: 3.2.x
Keywords: Cc:

Description

The following command crashes when the --exclude matches nothing:

yum -y --exclude=kernel* update

(with no kernel* update files)

At the same time the following command succeeds:

yum -y update

However, if there are rpm files with names starting with "kernel", then the exclude works fine.

This error has existed for a long time, but I only noticed the cause a few months ago ...

OS: fc10

Yum rpm: Name : yum Relocations: (not relocatable) Version : 3.2.21 Vendor: Fedora Project Release : 2.fc10 Build Date: Tue 13 Jan 2009 04:30:54 AM EST Install Date: Sun 05 Apr 2009 06:25:44 PM EST Build Host: xenbuilder2.fedora.redhat.com Group : System Environment/Base Source RPM: yum-3.2.21-2.fc10.src.rpm Size : 3274957 License: GPLv2+ Signature : DSA/SHA1, Thu 05 Feb 2009 07:24:30 AM EST, Key ID bf226fcc4ebfc273 Packager : Fedora Project

Error:


Excluding Packages in global exclude list Finished Setting up Update Process 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 229, in user_main

errcode = main(args)

File "/usr/share/yum-cli/yummain.py", line 104, in main

result, resultmsgs = base.doCommands()

File "/usr/share/yum-cli/cli.py", line 343, in doCommands

return self.yum_cli_commands[self.basecmd].doCommand(self, self.basecmd, self.extcmds)

File "/usr/share/yum-cli/yumcommands.py", line 197, in doCommand

return base.updatePkgs(extcmds)

File "/usr/share/yum-cli/cli.py", line 596, in updatePkgs

self.update()

File "/usr/lib/python2.5/site-packages/yum/init.py", line 2648, in update

updates = self.up.getUpdatesTuples()

File "/usr/lib/python2.5/site-packages/yum/init.py", line 605, in <lambda>

up = property(fget=lambda self: self._getUpdates(),

File "/usr/lib/python2.5/site-packages/yum/init.py", line 496, in _getUpdates

self._up.rawobsoletes = self.pkgSack.returnObsoletes(newest=True)

File "/usr/lib/python2.5/site-packages/yum/init.py", line 592, in <lambda>

pkgSack = property(fget=lambda self: self._getSacks(),

File "/usr/lib/python2.5/site-packages/yum/init.py", line 417, in _getSacks

if self._pkgSack and thisrepo is None:

File "/usr/lib/python2.5/site-packages/yum/packageSack.py", line 263, in len

ret += len(sack)

ValueError?: len() should return >= 0

Change History

09/10/09 23:28:42 changed by james

  • status changed from new to closed.
  • resolution set to fixed.

This is now def. fixed in 3.2.24, as I the excludes system doesn't work the way it used to.