Bug 469825 - package-cleanup --oldkernels fails if running kernel has no '-' in its name
Summary: package-cleanup --oldkernels fails if running kernel has no '-' in its name
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: yum-utils
Version: 10
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-11-04 10:13 UTC by Zdenek Kabelac
Modified: 2014-01-21 23:06 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-03-05 15:42:39 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Zdenek Kabelac 2008-11-04 10:13:44 UTC
Description of problem:

package-cleanup gives this error message:
Traceback (most recent call last):
  File "/usr/bin/package-cleanup", line 451, in <module>
    main()
  File "/usr/bin/package-cleanup", line 419, in main
    removeKernels(my, opts.kernelcount, opts.confirmed, opts.keepdevel)
  File "/usr/bin/package-cleanup", line 314, in removeKernels
    (kver,krel) = runningkernel.split('-')

If my running kernel is without any '-' in its name - i.e. when I run clean 2.6.27 kernel which is not packages by fedora.

I've fixed this by using this small patch thought I'm surely not a pythonist ;)


--- /tmp/package-cleanup	2008-11-04 11:06:36.000000000 +0100
+++ /usr/bin/package-cleanup	2008-11-04 11:07:14.000000000 +0100
@@ -311,8 +311,13 @@
         sys.exit(100)
     kernels = getKernels(my)
     runningkernel = os.uname()[2]
-    (kver,krel) = runningkernel.split('-')
-    
+
+    if runningkernel.find('-') != -1:
+        (kver,krel) = runningkernel.split('-')
+    else
+         kver=runningkernel
+         krel=""
+
     remove = kernels[count:]
     toremove = []




Version-Release number of selected component (if applicable):
yum-utils-1.1.17-2.fc10.noarch

How reproducible:


Steps to Reproduce:
1. boot kernel linus git kernel 2.6.27
2. run package-cleanup --oldkernels
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Bug Zapper 2008-11-26 04:43:56 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping


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