tech-pkg archive

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

Re: pkgsrc-dewey combining or sorting?



On Sun, Jun 12, 2011 at 06:21:04PM +0000, David Holland wrote:
> On Sun, Jun 12, 2011 at 11:19:59AM +0200, Joerg Sonnenberger wrote:
>  > On Sun, Jun 12, 2011 at 12:55:16AM +0000, David Holland wrote:
>  > > Is there an off-the-shelf way to take a list of depend rules, like
>  > > these:
>  > > 
>  > >    inputproto>=2.0:../../x11/inputproto
>  > >    inputproto>=1.4:../../x11/inputproto
>  > >    kbproto>=1.0.2:../../x11/kbproto
>  > >    libX11>=0.99:../../x11/libX11
>  > >    libX11>=1.3:../../x11/libX11
>  > >    libX11>=1.1:../../x11/libX11
>  > >    libXext>=0.99.0:../../x11/libXext
>  > >    libXext>=1.1:../../x11/libXext
>  > > 
>  > > and either combine, filter, or sort so as to be able to get the real
>  > > minimum version number for each package?
>  > 
>  > Not exactly. You can try mk/flavor/pkg/reduce-depends.awk though.
> 
> That seems to be exactly what's wanted.
> 
> Anyone object to the following?
> 
> Index: Makefile
> ===================================================================
> RCS file: /cvsroot/pkgsrc/pkgtools/verifypc/Makefile,v
> retrieving revision 1.9
> diff -u -p -r1.9 Makefile
> --- Makefile  9 Apr 2009 00:48:14 -0000       1.9
> +++ Makefile  12 Jun 2011 18:19:54 -0000
> @@ -1,7 +1,7 @@
>  # $NetBSD: Makefile,v 1.9 2009/04/09 00:48:14 joerg Exp $
>  #
>  
> -DISTNAME=    verifypc-1.4
> +DISTNAME=    verifypc-1.5
>  CATEGORIES=  pkgtools
>  MASTER_SITES=        # empty
>  DISTFILES=   # empty
> Index: files/verifypc.sh
> ===================================================================
> RCS file: /cvsroot/pkgsrc/pkgtools/verifypc/files/verifypc.sh,v
> retrieving revision 1.5
> diff -u -p -r1.5 verifypc.sh
> --- files/verifypc.sh 14 Sep 2006 15:35:46 -0000      1.5
> +++ files/verifypc.sh 12 Jun 2011 18:19:54 -0000
> @@ -123,13 +123,13 @@ main() {
>          err "pkg-config log not found; must run '${MAKE} configure' first"
>  
>      # Construct a list of dependency specifications for the current package.
> -    SORTED_DEPS=$(${MAKE} show-vars VARNAMES="BUILD_DEPENDS DEPENDS" | tr ' 
> ' '
> -' | sed 's,\([.<>=]\)\([0-9][.:n]\),\10\2,g' | \
> -    sed 's,\([.<>=]\)\([0-9][.:n]\),\10\2,g' | \
> -    sort -r | \
> -    sed 's,\([.<>=]\)0\([0-9][.:n]\),\1\2,g' | \
> -    sed 's,\([.<>=]\)0\([0-9][.:n]\),\1\2,g' | \
> -    uniq)
> +    #
> +    # (The list is no longer actually sorted -- the important part is that
> +    # the loop in search_file_in_depends finds the most restrictive spec
> +    # first, which used to be done by sorting but is now done with 
> +    # reduce-depends.)
> +    SORTED_DEPS=$(awk -f ../../mk/flavor/pkg/reduce-depends.awk \
> +     "$(${MAKE} show-vars VARNAMES='BUILD_DEPENDS DEPENDS')")
>  
>      error=0
>      lines=$(cat ${log} | sort | uniq | tr ' ' '¬')

looks fine to me, i suspect that basic regexps in sed are a source of wackiness.

please commit.

thanks,
alistair


Home | Main Index | Thread Index | Old Index