Ralf S. Engelschall wrote:

 Currently it says e.g. "i386-any-darwin8.9.1",
 while the Apple tools use "i686-apple-darwin8"

You talk about <prefix>/etc/openpkg/platform, I guess. This is a
generated file just to make RPM happy. The "any" is inserted as
OpenPKG itself doesn't use the practically-useless vendor part in its
identifiers.

OK, so it doesn't really matter then. I was also
a bit confused here about what it reports and what
target it uses for cross-compiling, as this varies...

For instance: my Fedora box says "i686-pc-linux-gnu"
in configure, but uses "i386-redhat-linux" for GCC.
So if the Mac OS X box says "i386-any-darwin8.9.1" and
uses "i686-apple-darwin8" for GCC maybe it's similar ?

 So it is normally truncated after first period.

I think truncating to two digits is fine, but just one digit is a little
bit extreme, isn't it?

Depends on how close you want to track the OS,
and what significance the kernel version plays ?

But at least truncating the last digit of Darwin
Kernel should probably be done, in either case.

It _CAN_ be done. See the "openpkg" package and its file "shtool". There look for the block entitled with "Apple MacOS X Darwin". This is how the
information is determined. See e.g. the Linux part a few lines above on
how one can do more here, including truncating the version. I've now
at least added the truncation part. What would be cool is if you can
extend it to especially provide a Darwin to MacOS mapping. The system
technology (ST) should be "Apple Darwin 8.x" while the system product
(SP) should be the corresponding "Apple Mac OS X 10.4.x". I appended you
a snapshot of the latest GNU shtool where I tried to improve the Darwin
/ Mac OS X detection. Can you run this on as much different Mac OS X
boxes you have available and show me the output of "./shtool platform
--type=all-in-one" on all those boxes? If it looks reasonable I can take over this change into GNU shtool and then also into OpenPKG. In case the
script doesn't what it should, please see the Mac OS X related code at
line 2957 and following.

Ignoring OpenDarwin and any non-Mac OS X Darwin,
your shtool output for current releases seems OK:

concise architecture class:      PPC
regular architecture class:      PPC
verbose architecture class:      PPC
concise architecture product:    PPC
regular architecture product:    PPC
verbose architecture product:    PPC
concise architecture technology: PPC
regular architecture technology: PPC
verbose architecture technology: PPC
concise system class:            4.4BSD/Mach3
regular system class:            4.4BSD/Mach3
verbose system class:            4.4BSD/Mach3
concise system product:          10
regular system product:          Mac OS X 10.3
verbose system product:          Apple Mac OS X 10.3.9
concise system technology:       7
regular system technology:       Darwin 7.9
verbose system technology:       Apple Darwin 7.9.0

concise architecture class:      PPC
regular architecture class:      PPC
verbose architecture class:      PPC
concise architecture product:    PPC
regular architecture product:    PPC
verbose architecture product:    PPC
concise architecture technology: PPC
regular architecture technology: PPC
verbose architecture technology: PPC
concise system class:            4.4BSD/Mach3
regular system class:            4.4BSD/Mach3
verbose system class:            4.4BSD/Mach3
concise system product:          10
regular system product:          Mac OS X 10.4
verbose system product:          Apple Mac OS X 10.4.9
concise system technology:       8
regular system technology:       Darwin 8.9
verbose system technology:       Apple Darwin 8.9.0

concise architecture class:      iX86
regular architecture class:      iX86
verbose architecture class:      iX86
concise architecture product:    i386
regular architecture product:    i386
verbose architecture product:    i386
concise architecture technology: i386
regular architecture technology: i386
verbose architecture technology: i386
concise system class:            4.4BSD/Mach3
regular system class:            4.4BSD/Mach3
verbose system class:            4.4BSD/Mach3
concise system product:          10
regular system product:          Mac OS X 10.4
verbose system product:          Apple Mac OS X 10.4.9
concise system technology:       8
regular system technology:       Darwin 8.9
verbose system technology:       Apple Darwin 8.9.1

Not sure about if the "system class" mapping is 100%,
but it's in the right ballpark (BSD) so that's OK...


For ultimate correctness we might even want to consider
parse /System/Library/CoreServices/SystemVersion.plist:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
<dict>
        <key>ProductBuildVersion</key>
        <string>7W98</string>
        <key>ProductCopyright</key>
        <string>Apple Computer, Inc. 1983-2004</string>
        <key>ProductName</key>
        <string>Mac OS X</string>
        <key>ProductUserVisibleVersion</key>
        <string>10.3.9</string>
        <key>ProductVersion</key>
        <string>10.3.9</string>
</dict>
</plist>

--anders

______________________________________________________________________
OpenPKG                                             http://openpkg.org
Developer Communication List                   openpkg-dev@openpkg.org

Reply via email to