|
List Info
Thread: Adding dependency syntax for a per-package tag probe
|
|
| Adding dependency syntax for a
per-package tag probe |
  United States |
2007-04-11 06:24:52 |
(Note: N == name, A == arch, V == version, R == release, E
== epoch
shorthand in what follows).
OK, I've been asked to implement
Requires: N.A
one time too often.
So its time for a pre-emptive implementation so that I don't
have to
waste
any more time explaining why a cross-arch dependency is
never going to
work.
aside: consider the aliasing problems with
x86_64/amd64/ia32e.
So I'm going to do an implementation and let packagers
discover all by
themsleves why cross-arch dependency are as silly and
useless as
%{?disttag} and Disttag: are.
Rather than creating a compound dependency string as in
Requires: N.A
which will force all applications that use rpmlib to start
parsing the
data returned from header queries, I'm going to implement a
header
metadata probe.
Basically, the compound "N.A" is equivalent to
Requires: N
Requires: A
because all dependencies in rpm except triggers are
implicitly AND,
as in
the logical statement
condition1 AND condition2
The next part of the implementation (and fundamental reason
why
packagers
are asking for the N.A compound) is that no package atm has
the matching
Provides: A
Nor is anyone willing to add additional arch-qualified
strings to
existing
packages even though the current rpm dependency mechanism
permits
everyone to add strings like (literally) N.A freely.
Rebuilding (and
re-releasing
packages) is plain and simply too costly.
Since RPMTAG_ARCH is included in every existing package, I'm
going
to add a probe dependency on the header to synthesize
Provides: A
by using headerGetEntry() to turn the value of RPMTAG_ARCH
into a
Provides:
The syntax to accomplish this will be done by adding
existing
RPMTAG_* names
as a class of probes.
An example using RPMTAG_ARCH probably clarifies the
gobbeldygook above:
Let's say you want to add a requirement on N.A of another
package. So
you would add (as always)
Requires: N
In order to express the dependency on the value of
RPMTAG_ARCH from the
other package, one would write a probe dependency as
Requires: Arch(N) = i386
(I'm leaving out E:V-R qualifiers for simplicity)
The Arch(...) wrapper is a hint to extract RPMTAG_ARCH from
package N
using
headerGetEntry(), thereby augmenting the existing Provides:
in
package N.
That syntax should generalize beyond RPMTAG_ARCH, and
further extensions
to handle package versioning, tag arrays and patterns seem
likely to
be able to
be accomodated within the Foo(...) syntax.
The harder implementation problem is that a probe assumes
that an added
header is present when needed for probing. That is not true
atm,
added header
references are not persistent in rpmlib to reduce memory
footprint,
but -- at least
for RPMTAG_ARCH -- can be dealt with by synthesizing
Provides: Arch(N) = i386
on the fly. Probing is always possible against rpmdb
headers. And
implementing
a per-transaction backing store of added package headers is
not
impossibly
hard down the road.
Opinions?
73 de Jeff
_______________________________________________
Rpm-devel mailing list
Rpm-devel lists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
a>
|
|
| Re: Adding dependency syntax for a
per-package tag probe |
  Germany |
2007-04-11 08:24:11 |
On Wed, Apr 11, 2007 at 07:24:52AM -0400, Jeff Johnson
wrote:
> The harder implementation problem is that a probe
assumes that an added
> header is present when needed for probing. That is not
true atm,
> added header
> references are not persistent in rpmlib to reduce
memory footprint,
> but -- at least
> for RPMTAG_ARCH -- can be dealt with by synthesizing
> Provides: Arch(N) = i386
> on the fly. Probing is always possible against rpmdb
headers. And
> implementing
> a per-transaction backing store of added package
headers is not
> impossibly
> hard down the road.
Hmm, how would one specify something like:
Requires: perl.i586 > 5.8.1
If it requires is split into:
Requires: perl > 5.8.1
Requires: Arch(perl) = i386
installed perl.i586 = 5.6.0 and perl.x86_64 = 5.8.1 would
satisfy
the dependencies, but wouldn't be correct.
Cheers,
Michael.
--
Michael Schroeder mls suse.de
SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG
Nuernberg
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13
);}
_______________________________________________
Rpm-devel mailing list
Rpm-devel lists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
a>
|
|
| Re: Adding dependency syntax for a
per-package tag probe |

|
2007-04-11 12:10:46 |
On 4/11/07, Michael Schroeder <mls suse.de> wrote:
> On Wed, Apr 11, 2007 at 07:24:52AM -0400, Jeff Johnson
wrote:
> > The harder implementation problem is that a probe
assumes that an added
> > header is present when needed for probing. That is
not true atm,
> > added header
> > references are not persistent in rpmlib to reduce
memory footprint,
> > but -- at least
> > for RPMTAG_ARCH -- can be dealt with by
synthesizing
> > Provides: Arch(N) = i386
> > on the fly. Probing is always possible against
rpmdb headers. And
> > implementing
> > a per-transaction backing store of added package
headers is not
> > impossibly
> > hard down the road.
>
> Hmm, how would one specify something like:
>
> Requires: perl.i586 > 5.8.1
>
> If it requires is split into:
>
> Requires: perl > 5.8.1
> Requires: Arch(perl) = i386
>
> installed perl.i586 = 5.6.0 and perl.x86_64 = 5.8.1
would satisfy
> the dependencies, but wouldn't be correct.
>
Requires: Arch(2:perl-5.8.1-RELEASEHERE) = i386
Using RPMDBI_LABEL iterator.
73 de Jeff
_______________________________________________
Rpm-devel mailing list
Rpm-devel lists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
a>
|
|
| Re: Adding dependency syntax for a
per-package tag probe |
  Germany |
2007-04-11 14:06:51 |
On Wed, Apr 11, 2007 at 01:10:46PM -0400, Jeff Johnson
wrote:
> >Hmm, how would one specify something like:
> >
> > Requires: perl.i586 > 5.8.1
> >
> >If it requires is split into:
> >
> > Requires: perl > 5.8.1
> > Requires: Arch(perl) = i386
> >
> >installed perl.i586 = 5.6.0 and perl.x86_64 = 5.8.1
would satisfy
> >the dependencies, but wouldn't be correct.
> >
>
> Requires: Arch(2:perl-5.8.1-RELEASEHERE) = i386
But that's not correct, it should also allow 5.8.2...
What I'm saying that rpm has no means to say "I want
this
requirement fulfilled and also that requirement *by the
same
package*".
Cheers,
Michael.
--
Michael Schroeder mls suse.de
SUSE LINUX Products GmbH, GF Markus Rex, HRB 16746 AG
Nuernberg
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13
);}
_______________________________________________
Rpm-devel mailing list
Rpm-devel lists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
a>
|
|
| Re: Adding dependency syntax for a
per-package tag probe |
  United States |
2007-04-11 14:26:00 |
On Apr 11, 2007, at 3:06 PM, Michael Schroeder wrote:
> On Wed, Apr 11, 2007 at 01:10:46PM -0400, Jeff Johnson
wrote:
>>> Hmm, how would one specify something like:
>>>
>>> Requires: perl.i586 > 5.8.1
>>>
>>> If it requires is split into:
>>>
>>> Requires: perl > 5.8.1
>>> Requires: Arch(perl) = i386
>>>
>>> installed perl.i586 = 5.6.0 and perl.x86_64 =
5.8.1 would satisfy
>>> the dependencies, but wouldn't be correct.
>>>
>>
>> Requires: Arch(2:perl-5.8.1-RELEASEHERE) = i386
>
> But that's not correct, it should also allow 5.8.2...
Correct, like syntax, is in the eye of the beholder.
> What I'm saying that rpm has no means to say "I
want this
> requirement fulfilled and also that requirement *by the
same
> package*".
>
Yep.
And there are flaws with
Requires: foo.i586
Consider for starters
Name: foo.i586
The major benefit of a class of Tagname(...) probes is that
the
syntax appears
to generalize and is unambiguously (unlike foo.i586)
parseable.
I have already considered a
Requires: E:N-V-R(tagname)
name space. The problem there is collisions with existing
conventions. E.g.
what is meant by
Requires: perl(arch) = i386
is it the good old stuff or is it a N(A) probe? I.e. the
risk of name
space pollution
is high, unlike Tagname(...).
Alternative syntax suggestions are welcomed, I really don't
care
what syntax
is used if it generalizes to
1) all tags as probes
2) patterns as values and/or qualifiers (i.e. the
"bar" in "foo
(bar)") across existing tag data types.
3) is unambiguously parseable (unlike "foo.i586,
which confuses
N and N.A)
So any ideas? Arch(...) is just my proof-of-concept test
case so that
I don't have to discuss
why cross-arch dependencies are wrong.
73 de Jeff
_______________________________________________
Rpm-devel mailing list
Rpm-devel lists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
a>
|
|
| Re: Adding dependency syntax for a
per-package tag probe |

|
2007-04-11 17:29:58 |
On 4/11/07, Michael Schroeder <mls suse.de> wrote:
>
> What I'm saying that rpm has no means to say "I
want this
> requirement fulfilled and also that requirement *by the
same
> package*".
>
OK, so let's pursue generalizations of the compound N.A
forms,
sometimes using the concrete example "perl.i586 >=
5.8.1" in order
to ornament existing syntax
N >= E:V-R
with secondary qualifiers applied *to the same package*.
So the character '.' somehow implies 'same package'. Not
bad.
Hmmm, the implementation somehow has to know that i586 means
look
at RPMTAG_ARCH. In order to parse unambigously, a table of
allowed
values needs to be found somewhere. Doable.
But then the aliases start: i[3456]86, pentium[34] to
enumerate the
obvious players. Sure we can define some way of checking for
equality
(hint: it won't be rpmrc archScore()) or set membership or
attribute
qualification.
So let's look at pattern matching, that makes sense for set
membership.
Here's the ultimate DWIM dependency:
Requires: perl.*
Totally unlear what '*' means.
Perhaps hinting at where the pattern should be applied
helps:
Requires: perl.Arch(*)
At least that way its clear the pattern should be applied to
RPMTAG_ARCH.
OK, now there's a generalization onto string valued tags:
Requires:
perl.Arch(i[3456]86|pentium[34]).Os([Ll]inux).Vendor(*RedHat
*|*SuSE*).Disttag(fc[23456]|rhel[345]|mdv|suse*).Repotag(epe
l|rf|fr)
>= 5.8.1
Perfectly parseable because tagnames (following a '.'
preceding a '(')
are explicitly known, generalizes to patterns between
matching
parentheses, no legacy issues if no whitespace and/or commas
are
included (older rpm will just use the mess as a single
string), and I
can apply the patterns to arrays of the usual data types if
I'm
careful about converting to ASCII (or utf8 first.
I can live with that. Is that acceptable? Syntax and
representation is
easy, I really only care about the underlying implementation
in rpm.
73 de Jeff
_______________________________________________
Rpm-devel mailing list
Rpm-devel lists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
a>
|
|
| Re: Adding dependency syntax for a
per-package tag probe |

|
2007-04-12 11:32:01 |
On 4/12/07, Mark Hatle <mark.hatle windriver.com> wrote:
> Just to throw in my 2 cents. I like the format listed
below much
> better. (I'm not sure I'll ever use it.. but format
wise it makes a lot
> more sense to me.)
>
So the current tally is
Sucks: -1
OK: +1
What I'm likely to do (rather than discuss) is implement
Requires: foo.i586
exactl;y as requested because my private goal is to make a
pre-emptive impleentation exist.
I'm so-so-so tired of explaining everything multiple times,
cross-arch
dependencies are a spruce goose.
73 de Jeff
_______________________________________________
Rpm-devel mailing list
Rpm-devel lists.dulug.duke.edu
https://lists.dulug.duke.edu/mailman/listinfo/rpm-devel
a>
|
|
[1-7]
|
|