pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkgdepgraph Teach pkgdepgraph now to understa...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a6a524dbb94c
branches:  trunk
changeset: 478660:a6a524dbb94c
user:      atatat <atatat%pkgsrc.org@localhost>
date:      Wed Jul 28 01:42:43 2004 +0000

description:
Teach pkgdepgraph now to understand the output of lintpkgsrc -g.  This
particular data set has the current directories under ${pkgsrc} for
all known packages, unlike the location of where the package lived
when you built it.  It may have moved, you see.  This makes it
possible for pkgdepgraph to rebuild (so to speak) packages that have
moved.

And now there are 2.7.

diffstat:

 pkgtools/pkgdepgraph/Makefile             |   4 ++--
 pkgtools/pkgdepgraph/files/pkgdepgraph.0  |  12 +++++++-----
 pkgtools/pkgdepgraph/files/pkgdepgraph.1  |  15 ++++++++++++---
 pkgtools/pkgdepgraph/files/pkgdepgraph.pl |  18 +++++++++++++++---
 4 files changed, 36 insertions(+), 13 deletions(-)

diffs (126 lines):

diff -r e4f5d1b6b34f -r a6a524dbb94c pkgtools/pkgdepgraph/Makefile
--- a/pkgtools/pkgdepgraph/Makefile     Wed Jul 28 01:02:08 2004 +0000
+++ b/pkgtools/pkgdepgraph/Makefile     Wed Jul 28 01:42:43 2004 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.16 2004/06/05 06:17:37 atatat Exp $
+# $NetBSD: Makefile,v 1.17 2004/07/28 01:42:43 atatat Exp $
 #
 
-DISTNAME=      pkgdepgraph-2.6
+DISTNAME=      pkgdepgraph-2.7
 CATEGORIES=    pkgtools devel
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r e4f5d1b6b34f -r a6a524dbb94c pkgtools/pkgdepgraph/files/pkgdepgraph.0
--- a/pkgtools/pkgdepgraph/files/pkgdepgraph.0  Wed Jul 28 01:02:08 2004 +0000
+++ b/pkgtools/pkgdepgraph/files/pkgdepgraph.0  Wed Jul 28 01:42:43 2004 +0000
@@ -16,8 +16,8 @@
 
      ppkkggddeeppggrraapphh will also read any files passed to it as arguments (or stdin
      if it is not connected to a tty), in search of output that resembles that
-     of either lintpkgsrc(1) --ii, audit-packages(8), or the output from a pre-
-     vious incantation of this program.
+     of either lintpkgsrc(1) --ii, lintpkgsrc(1) --gg, audit-packages(8), or the
+     output from a previous incantation of this program.
 
      In the latter case, ppkkggddeeppggrraapphh will recolor the graph passed as input
      based, as usual, on information about currently installed pkgs.  Packages
@@ -337,7 +337,9 @@
 
      The ``rebuild'' output, ``fetch'' output, and the generic ``make target''
      output (see the --RR, --FF, and --mm options) do not deal very well with pack-
-     ages that have moved within the pkgsrc tree.  It is necessary that you
-     edit the rebuild script by hand to work around this.
+     ages that have moved within the pkgsrc tree.  Feeding the output of
+     lintpkgsrc(1) --gg to ppkkggddeeppggrraapphh can offset this (it contains the current
+     paths to all packages under _P_K_G_S_R_C_D_I_R) but sometimes is necessary that
+     you edit the generated scripts by hand to work around this.
 
-NetBSD 2.0_BETA                  June 5, 2004                  NetBSD 2.0_BETA
+NetBSD 2.0                       June 5, 2004                       NetBSD 2.0
diff -r e4f5d1b6b34f -r a6a524dbb94c pkgtools/pkgdepgraph/files/pkgdepgraph.1
--- a/pkgtools/pkgdepgraph/files/pkgdepgraph.1  Wed Jul 28 01:02:08 2004 +0000
+++ b/pkgtools/pkgdepgraph/files/pkgdepgraph.1  Wed Jul 28 01:42:43 2004 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: pkgdepgraph.1,v 1.10 2004/06/06 04:08:18 wiz Exp $
+.\"    $NetBSD: pkgdepgraph.1,v 1.11 2004/07/28 01:42:43 atatat Exp $
 .\"
 .\" Copyright (c) 2002, 2003, 2004 by Andrew Brown <atatat%netbsd.org@localhost>
 .\" Absolutely no warranty.
@@ -41,6 +41,8 @@
 of either
 .Xr lintpkgsrc 1
 .Fl i ,
+.Xr lintpkgsrc 1
+.Fl g ,
 .Xr audit-packages 8 ,
 or the output from a previous incantation of this program.
 .Pp
@@ -529,5 +531,12 @@
 .Fl m
 options) do not deal very well with packages that have moved within
 the pkgsrc tree.
-It is necessary that you edit the rebuild script by hand to work
-around this.
+Feeding the output of
+.Xr lintpkgsrc 1
+.Fl g
+to
+.Nm
+can offset this (it contains the current paths to all packages under
+.Pa PKGSRCDIR )
+but sometimes is necessary that you edit the generated scripts by hand
+to work around this.
diff -r e4f5d1b6b34f -r a6a524dbb94c pkgtools/pkgdepgraph/files/pkgdepgraph.pl
--- a/pkgtools/pkgdepgraph/files/pkgdepgraph.pl Wed Jul 28 01:02:08 2004 +0000
+++ b/pkgtools/pkgdepgraph/files/pkgdepgraph.pl Wed Jul 28 01:42:43 2004 +0000
@@ -3,7 +3,7 @@
 # Copyright (c) 2002, 2003, 2004 by Andrew Brown <atatat%netbsd.org@localhost>
 # Absolutely no warranty.
 
-# $NetBSD: pkgdepgraph.pl,v 1.9 2004/06/05 06:17:37 atatat Exp $
+# $NetBSD: pkgdepgraph.pl,v 1.10 2004/07/28 01:42:43 atatat Exp $
 # pkgdepgraph: @DISTVER@
 
 use strict;
@@ -115,6 +115,9 @@
            $recolor-- if (/^\}/);
            $recolor -= ($recolor == 0);
        }
+       elsif (m:^([^/\s]+)\t([^/\s]+/[^/\s]+)\t(\d+[^/\s]*)$:) {
+           $where{"$1-$3"} = $2;
+       }
        elsif (/^Version mismatch: '(\S+)' (\S+) vs (\S+)/) {
            $color{"$1-$2"} = "red";
            $need{"$1-$2"} = "$1-$3";
@@ -142,12 +145,12 @@
 ## where are they needed
 ##
 foreach $pkg (@pkgs) {
-    $where{$pkg} = $pkg;
+    $where{$pkg} ||= $pkg;
     open(R, "<$pkg_dbdir/$pkg/+BUILD_INFO") ||
        die("$pkg: +BUILD_INFO: $!\n");
     while (<R>) {
        if (/^PKGPATH\s*=\s*(\S+)/) {
-           $where{$pkg} = $1;
+           $where{$pkg} = $1 if ($where{$pkg} eq $pkg);
            last;
        }
     }
@@ -162,6 +165,15 @@
 }
 
 ##
+## reset %where based on "better" information, if we have it
+##
+foreach $pkg (@pkgs) {
+    if ($need{$pkg} && $where{$need{$pkg}}) {
+       $where{$pkg} = $where{$need{$pkg}};
+    }
+}
+
+##
 ## if we're recoloring an existing graph, recolor it now and finish
 ##
 if ($recolor) {



Home | Main Index | Thread Index | Old Index