On Fri, Sep 12, 2003, Philippe Libat wrote:

> You will find a small patch to fix the platform script for Mandrake
> distribution.
>
> On Mandrake Distribution both file /etc/redhat-release and
> /etc/mandrake-release are present for historical and compatibility reasons.
> But platform script use redhat-release, the last in the /etc sort list
> instead of mandrake-release.
>
> I hope this patch will not break other platform recognition.
> [...]

> --- platform.orig     2003-09-12 01:24:10.000000000 +0200
> +++ platform  2003-09-12 01:24:41.000000000 +0200
> @@ -379,11 +379,12 @@
>                      debian   ) n="Debian[ GNU/Linux]" ;;
>                      redhat   ) n="RedHat[ Linux]"     ;;
>                      suse     ) n="SuSE[ Linux]"       ;;
> -                    mandrake ) n="Mandrake[ Linux}"   ;;
> +                    mandrake ) n="Mandrake[ Linux]"   ;;
>                      gentoo   ) n="Gentoo[ Linux]"     ;;
>                      *        ) n="$n [ GNU/Linux]"    ;;
>                  esac
>                  SP="$n $v"
> +             [ ".$SP" = . ] || break
>              done
>          fi
>          [ ".$SP" = . ] && SP="${ST}"

What you do is to stop processing on the first found file. That's fine,
although your `[ ".$SP" = . ]� check is always true because of the
previous assignment (so a unconditional "break" is sufficient here).

Nevertheless, if multiple files exists, you cannot know what the order
is, so that mandrake-release is found before redhat-release is just a
coincidence. So, the stopping on the first found file is not sufficient
to correctly detect Mandrake.

I've now tried to fix this in the latest OSSP platform snapshot
which is now included in openpkg-20030911-20030911 and higher (see
http://cvs.openpkg.org/chngview?cn=12153 for details). Can you try this
one and give feedback whether it fixes also your problem?

                                       Ralf S. Engelschall
                                       [EMAIL PROTECTED]
                                       www.engelschall.com

______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
Developer Communication List                   [EMAIL PROTECTED]

Reply via email to