[Distutils] bdist_rpm

Greg Ward gward@ase.com
Tue, 25 Apr 2000 21:00:56 -0400


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").
> 
>   Why?

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
-- 
Greg Ward - Unix nerd                                   gward@python.net
http://starship.python.net/~gward/
Just because you're paranoid doesn't mean they *aren't* out to get you.