On 6 Jan 1999, Ilja Pavkovic writes:

>> How can I get Linuxconf to 'see' that I am now running RH 5.1 - I'm
>> itching to move to 5.2 but will wait till I can fix this.
 
> reading some lines in linuxconf/modules/redhat/filter.cc I found:
> static CONFIG_FILE f_release("/etc/redhat-release",help_nil
> ,CONFIGF_PROBED|CONFIGF_NOARCH);

> So I think there ("/etc/redhat-release") is the place where you have
> to change the version number. Search for the line starting with
> "release".

Right, but this file is updated when you upgrade, or at least it was
from 5.1 to 5.2, I have not done a 5.0 to 5.1 upgrade.

The 5.2 /etc/redhat-release file has just a single line that says:

Red Hat Linux release 5.2 (Apollo)

The 5.1 version says:

release 5.1 (Manhattan)

The 5.0 version says (I had to go find an old CD to check this one!):

release 5.0 (Hurricane)

Looking for a line *beginning* with release would be a bad idea, since
in 5.2 the line does not start that way any more.  Fortunately, that's
not how the redhat_release function in that Linuxconf filter.cc file
you mentioned really works.  It just looks for the string release,
then for an integer after that, then a period, then another integer;
the code in 1.13r7 reads

    const char *pt = strstr (line,"release");
    if (pt != NULL){
        const char *ver = str_skip (pt+7);
        int num1 = atoi(ver);
        int num2 = 0;
        const char *pt = strchr(ver,'.');
        if (pt != NULL) num2 = atoi(pt+1);
        ret = num1*100 + num2;
        break;
    }

However, if the upgrade from 5.0 to 5.1 did *not* already replace the
/etc/redhat-release file, something bad happened, and I'd be asking
what *other* files were also not upgraded that should have been!

Jonathan
--
Jonathan Marsden   | Internet: [EMAIL PROTECTED]  | Making electronic 
1849 N. Wabash Ave.| Phone: +1 (909) 794 1151   | communications work 
Redlands, CA 92374 | FAX:   +1 (909) 794 3016   | reliably for Christian 
USA                | http://www.xc.org/jonathan | missions worldwide 

---
You are currently subscribed to linuxconf as: [[email protected]]
To unsubscribe, forward this message to [EMAIL PROTECTED]

Reply via email to