RPM building section of RHL's developer guide

Ville Skyttä ville.skytta at iki.fi
Mon Jul 28 20:21:20 UTC 2003


On Mon, 2003-07-28 at 21:41, Jeff Johnson wrote:
> On Sun, Jul 27, 2003 at 07:43:54PM +0300, Ville Skyttä wrote:
> > On Thu, 2003-07-24 at 17:00, Jeff Johnson wrote:
> > 
> > > Current behavior in rpm-4.2.1 (and all future versions of rpm) is
> > > 	A missing (i.e. unsepcified) Epoch: is exactly equivalent to Epoch: 0.
> > > 
> > > Whether you choose to make the Epoch: explicit is a matter of style, the
> > > version comparison in rpm is now deterministic, the same answer is returned
> > > every time.

Perhaps internally, when versioned dependencies are being resolved.  But
*not always*.  The base assumption I'm making here is that eg.
rpm-4.2.1-0.11 in Severn represents the "current behavior" as in the
above.

Believe me, I've followed the Epoch discussion closely enough, and have
read the history why it was made the way it is in 4.2.1.  IMO that's
good.

And yes, I'm nitpicking, very much so.  See below, and beware, this is
more verbose than I would like it to be.  Sorry.

> > Let's consider a specfile without an explicit Epoch that produces
> > packages foo and foo-devel.  Does this work in foo-devel with rpm-4.2.1?
> > 
> >    Requires: foo = %{epoch}:%{version}
> > 
> > IIRC it doesn't work in rpm-4.2 and earlier.  It'd be nice if it worked,
> 
> You do not recall correctly. Without "doesn't work" definition no further
> analysis is possible.

"Doesn't work" == "The package cannot be built".  And with this
definition, it turns out that I do remember correctly; it "doesn't work"
with 4.2.  Nor does it with 4.2.1.  See the attached specfile, here are
some test results with it:

rpm-4.2-1 on Shrike:

  $ rpmbuild -bb foo.spec
  error: line 8: Dependency tokens must begin with alpha-numeric, '_' or '/': Requires:       %{epoch}:1-1.0

rpm-4.2.1-0.11 on Severn:

  $ rpmbuild -bb foo.spec
  error: line 8: Dependency tokens must begin with alpha-numeric, '_' or '/': Requires:       %{epoch}:1-1.0

If "no Epoch" == "Epoch: 0" in 4.2.1, why the error?  It is *not* a
matter of style; if I add the explicit "Epoch: 0" in the attached
foo.spec, the rpmbuild completes with both versions.

> > Also, outputting the 0 in cases of a missing Epoch would be nice too, I
> > remember trying out rpm-4.2.1 on RHL 9, and trying to install glib and
> > glib-devel (Epoch: 1, but a buggy requires in -devel; fixed in Severn). 
> > The error message IIRC was:
> > 
> >    glib = x.x.x is required by glib-devel
> > 
> > ...whereas a less confusing one IMHO would have been:
> > 
> >    glib = 0:x.x.x is required by glib-devel
> > 
> > Ditto for "rpm -q --qf '%{epoch}:%{version}-%{release}' foo", does/could
> > 4.2.1 print out "0:x.y-z" instead of "(none):x.y-z" if foo doesn't have
> > an explicit Epoch?
> > 
> 
> Please apply the rule:
> 	A missing (unspecified) Epoch: is exactly equivalent to Epoch: 0.
> 
> *Please*.

I can apply that.  But why?  rpm has already applied the rule, why do I
have to remember to apply it?  Why not go all the way and make it
explicit and clear everywhere by always outputting "0" instead of
"(none)" (eg. in --qf %{epoch}) or leaving it out altogether as in the
example above?

Just for the record, here is the exact output of the case above, on a
Shrike box after upgrading to rpm-4.2.1-0.15.fdr.1:

  # rpm -q --qf "%{name}-%{epoch}:%{version}-%{release}\n" glib
  glib-1:1.2.10-10
  # rpm -Uvh glib-devel-1.2.10-10.i386.rpm
  error: Failed dependencies:
          glib = 1.2.10 is needed by glib-devel-1.2.10-10

Yes, *I know* there's a missing "1:" in this particular
glib-devel-to-glib-dependency but why isn't the error message the
following, IMO less confusing one?

  error: Failed dependencies:
          glib = 0:1.2.10 is needed by glib-devel-1.2.10-10

Will shut up now.  Hopefully I haven't annoyed anyone.

-- 
\/
-------------- next part --------------
Name:           foo
Version:        1
Release:        1.0
License:        foo
Summary:        foo
Group:          foo
%package        devel
Requires:       %{epoch}:%{version}-%{release}
%files
%files devel


More information about the fedora-devel-list mailing list