LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 02-26-2007, 10:44 AM   #1
tlagren
LQ Newbie
 
Registered: Jun 2004
Distribution: RHEL
Posts: 11

Rep: Reputation: 0
Compare kernel version with rvc failed for kernel 2.6.9-42.0.8.EL


Hi, i'm using the rvc (RPM Version Compare) tool from here.

I use this with my scripts to compare versions of installed rpms and it works great if the version numbers
are of the same type.

If i compare kernel version A=2.6.9-42.0.8.EL with B=2.6.9-40.0.8.EL the program returns
that A is newer than B which is correct.

But when i compare kernel version A=2.6.9-42.0.8.EL with B=2.6.9-42.EL the program returns
that B is newer than A which is incorrect.

Does anyone have tips or solution how to handle this.
Is there another tool to use when comparing version numbers?

/Tomas
 
Old 02-27-2007, 11:58 PM   #2
PhillipHuang
Member
 
Registered: Aug 2006
Location: Shen Zhen
Distribution: Ubuntu 22.04
Posts: 199

Rep: Reputation: 33
>>But when i compare kernel version A=2.6.9-42.0.8.EL with B=2.6.9-42.EL the program returns that B is newer than A which is incorrect.

The program compares the characters in order to judge which one is newer. In your case, compare the first different character "0" in A=2.6.9-42.0.8.EL and "E" in B=2.6.9-42.EL. While character "0"(48) in ASCII table is higher than "E"(69), you get the above result that B is newer than A. I think you would modify your code to void it.

Good luck.
Phillip
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Kernel Panic after HTB init, kernel part version 3.17 conjoinix Linux - Kernel 0 02-06-2007 12:53 AM
how to load kernel module based on kernel version? linetnew Linux - Newbie 3 05-10-2005 11:45 AM
rpm -qa | grep kernel gives wrong kernel version markelo Red Hat 3 07-18-2004 09:35 AM
Unable to build NVIDIA kernel module / determin kernel version Night Ink Fedora 2 05-31-2004 04:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 12:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration