[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTi=BDChiJfvj+b5iVamWHELDuWCT-A@mail.gmail.com>
Date: Wed, 15 Jun 2011 12:44:23 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Andy Lutomirski <luto@....edu>
Cc: Olivier Galibert <galibert@...ox.com>,
Denys Vlasenko <vda.linux@...glemail.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Linux 3.0-rc3
On Wed, Jun 15, 2011 at 12:29 PM, Andy Lutomirski <luto@....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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists