[pacman-dev] [PATCH] Use "--mime" instead of file's "-i" parameter, to increase portability
Sebastian Nowicki
sebnow at gmail.com
Tue May 27 05:20:33 EDT 2008
On 26/05/2008, at 7:04 PM, Xavier wrote:
> Well maybe I would prefer this solution, adding this somewhere in
> makepkg :
> export COMMAND_MODE=legacy
> Can you confirm it works that way too?
>
> I think it would also be safer. For instance, you forgot the second
> file call.
> But also in the future if these file commands are modified or new ones
> are added, it would be better to just have the above export. Though I
> suppose this env var is only used by macos and would have no influence
> on other systems, right?
> So as always, some testing would be appreciated before we put this
> in makepkg :)
I'm currently testing makepkg with exported COMMAND_MODE=legacy, and
it seems to be working fine, but I'll test it a bit more and send a
patch later in the day. I was looking into COMMAND_MODE a bit more,
and found something that is a bit bazaar. It appears that OSX's
current utilities conform to the UNIX 03 specification. So OSX is more
UNIX compliant than BSD and Linux… that's a bit surprising.
From http://developer.apple.com/documentation/Darwin/Reference/ManPages/man5/compat.5.html
> Setting the environment variable COMMAND_MODE to the value legacy
> causes utility programs to behave as closely to Mac OS X 10.3's
> utility programs as possible. When in this mode all of 10.3's flags
> are accepted, and in some cases extra flags are accepted, but no
> flags that were used in 10.3 will have been removed or changed in
> meaning. Any behavioral changes in this mode are documented in the
> LEGACY sections of the individual utilities.
>
> Setting the environment variable COMMAND_MODE to the value unix03
> causes utility programs to obey the Version 3 of the Single UNIX
> Specification (``SUSv3'') standards even if doing so would alter the
> behavior of flags used in 10.3.
>
> The value of COMMAND_MODE is case insensitive and if it is unset or
> set to something other than legacy or unix03 it behaves as if it
> were set to unix03.
The change to file and other utilities are probably new to Leopard,
since that's when OSX got UNIX certification.
--
Sebastian Nowicki
More information about the pacman-dev
mailing list