Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having a newer kernel version installed kinda throws an exception #7

Closed
StefanescuCristian opened this issue Nov 17, 2013 · 5 comments
Assignees
Labels

Comments

@StefanescuCristian
Copy link
Contributor

I've recommended your script to my friends and on some forums and on of them asked me why the script gave him this error:
"Contacting http://kernel.ubuntu.com/~kernel-ppa/mainline/
Please enter an integer [0]: 0
Please enter an integer [0]: 0
Please enter an integer [0]:
Traceback (most recent call last):
File "kmpd.py", line 96, in
print("You chose: {0}".format(kernels[selk-1]))
IndexError: list index out of range"

Reading the script and testing my theory I found that when you have a newer version installed than what version is available on the site leaves you with only one choice: killing the script.
My toughts are that it would be better to make a check and if the versions are equal, to print and inform the user that no newer kernel is available and then exit.
I've tried with no success to fiddle with the program and make it exit to shell.

Also, if you are running a custom kernel, altough comparing works, I think that it is better to use re.sub(r"-[\w]*","",platform.release()) instead of platform.release().replace("-generic","").

@ghost ghost assigned medigeek Nov 18, 2013
@medigeek
Copy link
Owner

Will have a look into it, thanks for the bug report!

@medigeek
Copy link
Owner

Can you ask your friend to send me the kernel release text string?
Using this command: uname -r

medigeek pushed a commit that referenced this issue Nov 18, 2013
@medigeek
Copy link
Owner

I've added a fix based on your recommendation, can you and your friends try it out?

@StefanescuCristian
Copy link
Contributor Author

uname -r:
3.12.0-031200-generic

On Mon, Nov 18, 2013 at 9:43 AM, Savvas Radevic notifications@github.comwrote:

I've added a fix based on your recommendation, can you and your friends
try it out?


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-28679892
.

Cu stimă,
Cristian Ștefănescu

medigeek pushed a commit that referenced this issue Nov 18, 2013
@medigeek
Copy link
Owner

OK, it's fixed now, I wasn't using str.replace() properly, I have to use re.sub() for regular expressions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants