Since bdist_rpm implies RPM-only, how about using the default architecture from the rpmrc file?
Mark Alexander firstname.lastname@example.org
On Tue, 25 Apr 2000, Greg Ward wrote:
Date: Tue, 25 Apr 2000 21:00:56 -0400 From: Greg Ward email@example.com To: firstname.lastname@example.org Subject: Re: [Distutils] bdist_rpm
On 25 April 2000, Fred L. Drake, Jr. said:
There should be a "--arch" ("--plat"?) option to "build_rpm" to let people specify the RPM architecture string; it should default to the result of 'util.get_platform()' (eg. "linux2-i586", "sunos5-sun4u").
Because the convention, at least in Red Hat-land, is that RPMs for Linux on the Intel x86 platform are named like "foo-1.23-1.i386.rpm" or "bar-3.21-3.noarch.rpm". IOW, the architecture string is not easily deducible from 'os.uname()' or 'distutils.util.get_platform()'. No matter how many hacks and heuristics we have to do the "right" thing, especially since there's more to RPM-based Linux distributions than Red Hat. (F'r example, SuSE would call the above to "foo.rpm" and "bar.rpm". Never mind the dubious wisdom of this convention, that's how they do it.)
It seems that for each util.get_platform() there will be a single value; these can simply be cataloged and a dictionary containing the mapping stored in the sources (it's not a large dictionary!).
I don't want 'get_platform()' to get out of hand -- at some point, I might as well just steal MAL's platform.py, which strikes me as overkill. (At least for now it does...).
Anyways, any time you start adding hacks 'n heuristics, you need an escape hatch: that's what the "--arch" option to "bdist_rpm" is for.
-- Greg Ward - Unix nerd email@example.com http://starship.python.net/%7Egward/ Just because you're paranoid doesn't mean they *aren't* out to get you.
Distutils-SIG maillist - Distutils-SIG@python.org http://www.python.org/mailman/listinfo/distutils-sig