lkml.org 
[lkml]   [2011]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: Linux 3.0-rc3
On Wed, Jun 15, 2011 at 12:29 PM, Andy Lutomirski <luto@mit.edu> wrote:
>
> Well, the man page says that the version parameter is used to find
> /lib/modules/version.  So why not check if /lib/modules/version exists and,
> if not, try the filename?

Yeah, that's the only sane way to see if something is a filename: look
up the file. If you can find it, it's a filename.

It's what 'git' uses to decide between the ambiguity of a filename vs
a commit name, for example. It works really well. And sometimes, when
the ambiguity is not resolvable (ie you really meant a filename, but
there's a version that has the exact same format), then you are
fundamentally screwed - you need some other way to tell the difference
(which could be a simple priority decision - "filename overrides
version" - or it can be a command line thing).

So stop trying to parse the version number, and just see if
'/lib/modules/%s' exists for that (unparsed) version string. Or, if
you want to prioritize it the other way, just check for existence of
the file of the (again, unparsed) version string with a simple
"access(%s, F_OK)" or something.

I really don't see why you should ever parse a version number.

Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-06-15 21:47    [W:0.273 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site