tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: compound depends

On Mon, 24 Oct 2011 23:40:19 +0900, Alistair Crooks <> 

On Mon, Oct 24, 2011 at 10:24:25PM +0900, OBATA Akio wrote:
On Mon, 24 Oct 2011 19:37:55 +0900, David Holland
<> wrote:

>1) is that depends entry supposed to work the way it is, or should it
>be split up, as per the following patch?

It should not be split out.

I'm not sure I agree here - I've always thought the compound way is
difficult to parse (from a human pov) - we are used to seeing single
a single in equality, not two. And I'd prefer to keep the individual
inequalities as simple as possible, in general.

In my opinion of this case, "should not" means that it will not works
as expected with current codes.

Currently, with following dependency:

As first dependency, xulrunner192-2.0 may be installed,
and it will mismatch with second dependency, so it will be failed to install.

With current codes, multiple ">=" dependencies will be merged into one 
(most upper dependency), but I think all dependency patterns should be merged
into one dependency pattern smartly.

>2) is there a canonical reference for the syntax of depends entries?

PACKAGE WILDCARDS in pkg_info(1).

That describes the basic functionality of the way pkg_info(1) matches
elements of the inequality; it does not really describe the compound
inequality itself.

DEPENDS patterns are defined for pkg_* tools, isn't it?

How about following?

Index: mk/pkgformat/pkg/reduce-depends.awk
RCS file: /cvsroot/pkgsrc/mk/pkgformat/pkg/reduce-depends.awk,v
retrieving revision 1.1
diff -u -r1.1 reduce-depends.awk
--- mk/pkgformat/pkg/reduce-depends.awk 15 Oct 2011 00:23:09 -0000      1.1
+++ mk/pkgformat/pkg/reduce-depends.awk 24 Oct 2011 13:22:26 -0000
@@ -116,7 +116,7 @@
                for (d = 1; d <= D; d++) {
                        dep = depends[pkgpath, d]
                        if (dep ~ /[{]/ || \
-                           dep ~ />=[0-9][0-9\.]*<[0-9]+/ || \
+                           dep ~ />=[0-9][0-9\.]*(nb[0-9]+)?<[0-9]+/ || \
                            dep !~ />=[0-9]+/)
                                reduced[N++] = dep ":" pkgsrcdirs[pkgpath]

Looks great to me, but can we have an optional '=' in the second
inequality, please?  It costs little in such a complicated regexp, and
gives us the ability to match up to and including.  I doubt it will be
used much, but it sure would be nice not to be bitten by this at a
later date.

Yes, it is better that ALL dependency patterns are handled.

OBATA Akio /

Home | Main Index | Thread Index | Old Index