Decrufting RPM

From time to time, there are complaints when command line options (which are largely parsed by the popt subcomponent) from early versions of RPM produce unexpected results. This is noticed most when combined with the macro expansion re-organizations at about rpm-3.0.2, and popt simplifications.

popt is an interesting and deceptively easy-to-overlook part of RPM. It is concisely sumamrized as A C library for parsing command line parameters.. It is not pronounced 'pop-tee', but rather as 'pee-opt' -- as in "parse options". It is in a class along with getopt.{ch} C code fragments often seen; but much more in the sophistication of its expansion rules; it is more analogous to m4, byacc, the C/C++ macro pre-processor, and make.

Given the power of the popt tool, and the simplification in option parsing which it provides, it was easy, in the early days of RPM, to overburden the parent in which it was first extensively used, rpm in the pre-JBJ maintainership days. 'When one has a hammer in one's hand, lots of problems start looking like nails.'

The piece below pretty concisely summarizes a statement of the unhappy state of where RPM had drifted, as to option processing in late 1999. Thinking about "giving a sh*t", the roadmap for the future of RPM is clearer.

RPM is changing from a package manager which 'just grew' organically, into a more rational suite of package management tools (from cradle -- rpmbuild -ba; in life -- rpm -i, rpm -F, rpm -U, and rpm -V; and to grave -- rpm -e; with trips to the doctor in between -- rpm --rebuilddb).

-- Russ Herrold


Date: Fri, 12 Apr 2002 15:31:25 -0400
From: Jeff Johnson <jbj@redhat.com>
Reply-To: rpm-list@redhat.com
To: rpm-list@redhat.com
Subject: Re: Is the --dbpath option gone forever?

On Fri, Apr 12, 2002 at 12:09:15PM -0700, Harry Putnam wrote:
> Jeff Johnson <jbj@redhat.com> writes:
>
> > On Fri, Apr 12, 2002 at 10:35:20AM -0700, Harry Putnam wrote:
> >> Jeff Johnson <jbj@redhat.com> writes:
> >>
> >> > Yup, --help and --usage have so many optuions that I trimaccording
> >> > to what I expect a "typical" user to need. If you disagree with what
> >> > popt aliases I choose to annotate, then configure your own popt alias
> >> > in /etc/popt. From /usr/lib/rpm/popt-4.0.4:
> >>
> >> Please reconsider.. isn't that flag necessary for using the redhat
> >> supplied full distro database?
> >
> > No, --dbpath is not needed, --redhatprovides is (and is documented with
> > --help).
>
> These answers seem a bit flip. How does --redhatprovides allow an -f,
> -i, -l, or querformat (probably many others) query of full distro
> database?
>

Flip? Nah ...

Look the command line is not the place to document this arcana. A man page, which allows (gasp) punctuation and paragraphs *is*. Even better is a book which has (heaven help us) chapters and pictures.

FWIW attached is a critique of the rpm CLI from ~2 years ago. Let's just say that I'm humbled to have code I'm responsible for critiqued by John Gilmore and Henry Spencer.

My answer is to split rpm into pieces that have fewer options, pieces that are simpler to use in a narrower context.

Fewer, not more, options is the answer. And ootions that are easier and more intuitive to use.

Been at simplifying the rpm CLI for 2 years now, I'll get there yet because, yes, I do giva a sh*t.

73 de Jeff



------- Forwarded Message

Date: Wed, 31 May 2000 18:36:42 -0700
From: John Gilmore <gnu at toad dot com>
To: djb at donniebarnes dot com, gnu at toad dot com
Subject: Installing RPMs after you exit the installation

See the msg from Henry Spencer below. He's a very, very competent computer scientist. His was one of the first 10 sites on the Usenet, he's been at it for a while. Yet he has trouble installing RPMs after the initial installation of the system.

I too have found this a complete pain. After learning to use the install program, there's no way to re-invoke it later to add more packages. Instead there is some obscure command somewhere to do new package installs, with a completely different user interface, which I've never mastered even if I found it once.

(Trying to do it by hand is also really painful. The "rpm" command is almost useless by hand, since it has forty or fifty options and obvious things don't seem to be provided or perhaps just aren't easy to find.)

My stopgap has been to always do "install every RPM" in initial installs, but that doesn't help me when I want to install a patch or something.

Can you forward this to someone at Red Hat who gives a shit?

John

- ------- Forwarded Message

Date: Tue, 30 May 2000 14:30:22 -0400 (EDT)
From: Henry Spencer <henry@spsystems.net>
To: Clint Byrum <cbyrum@erp.com>
cc: Linux IPsec <linux-ipsec@clinet.fi>
Subject: RE: linux-ipsec: libgmp
In-Reply-To: <NDBBICLCCLEKJPKJGKJKEEJICEAA.cbyrum@erp.com>
Message-ID: <Pine.BSI.3.91.1000530141847.29234I-100000@spsystems.net>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: owner-linux-ipsec@clinet.fi
Precedence: bulk

On Thu, 25 May 2000, Clint Byrum wrote:
> What distributions are people using where it is that hard to add GMP? If
> somebody is moronic enough to not be able to install an rpm, use 'apt-get',
> or even compile from a tarball... Can they handle the FreeS/WAN installation
> anyways?

It *is* considerably harder than an initial install, if only because the usual documentation is eager to tell you how to do the initial install, and clams up completely when it comes to updating it later. Oh, true, the mechanics are easy enough, *once you figure them out*. But figuring them out can be difficult for the non-expert -- too much is left undocumented, there are too many gaps you have to fill in yourself.

There is a big difference between the totally clueless, who shouldn't be doing this stuff at all, and the incompletely clued, who can cope but need a few pointers to get them headed in the right direction. Existing Linux distributions serve the latter category of people rather poorly.

> I just checked, and Debian 2.2 has libgmp2-dev. Looking at
> http://rpmfind.net, Connectiva, Yellow Dog, RedHat, Mandrake, UltraPenguin,
> RawHide, and Linux/PPC all include gmp-devel.

Again, the issue is not whether the stuff is there on the CDROM, but whether you can figure out how to get it off CDROM and into your existing already-set-up system in five minutes, as opposed to five hours. For example, Red Hat really should have an "add some packages" command with the same sort of interface as the initial setup stuff -- if such a thing is there, I've missed it, and it's not mentioned in the docs.

Henry Spencer
henry@spsystems.net


- ------- End of Forwarded Message



------- End of Forwarded Message



--
Donnie Barnes http://www.donniebarnes.com djb at redhat dot com "Bah."
Challenge Diversity. Ignore People. Live Life. Use Linux. 879. V.
"I love the smell of napalm in the morning."



--
Jeff Johnson ARS N3NPQ
jbj@redhat.com (jbj@jbj.org)
Chapel Hill, NC



_______________________________________________
Rpm-list mailing list
Rpm-list@redhat.com
https://listman.redhat.com/mailman/listinfo/rpm-list