summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoratatat <atatat>2004-07-28 01:42:43 +0000
committeratatat <atatat>2004-07-28 01:42:43 +0000
commit4ff50005afb13fc19dc2ce9f8541798990547e9b (patch)
treea5c11619e540383fd8703722f118f2904a632ebe
parent69e61078511395276edeb4853cca20ada19ce5cc (diff)
downloadpkgsrc-4ff50005afb13fc19dc2ce9f8541798990547e9b.tar.gz
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.
-rw-r--r--pkgtools/pkgdepgraph/Makefile4
-rw-r--r--pkgtools/pkgdepgraph/files/pkgdepgraph.012
-rw-r--r--pkgtools/pkgdepgraph/files/pkgdepgraph.115
-rwxr-xr-xpkgtools/pkgdepgraph/files/pkgdepgraph.pl18
4 files changed, 36 insertions, 13 deletions
diff --git a/pkgtools/pkgdepgraph/Makefile b/pkgtools/pkgdepgraph/Makefile
index 23a76484eb6..5a3fe84a156 100644
--- a/pkgtools/pkgdepgraph/Makefile
+++ b/pkgtools/pkgdepgraph/Makefile
@@ -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 --git a/pkgtools/pkgdepgraph/files/pkgdepgraph.0 b/pkgtools/pkgdepgraph/files/pkgdepgraph.0
index 3e6677f91d3..733007dd6b2 100644
--- a/pkgtools/pkgdepgraph/files/pkgdepgraph.0
+++ b/pkgtools/pkgdepgraph/files/pkgdepgraph.0
@@ -16,8 +16,8 @@ DDEESSCCRRIIPPTTIIOONN
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 @@ BBUUGGSS
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 --git a/pkgtools/pkgdepgraph/files/pkgdepgraph.1 b/pkgtools/pkgdepgraph/files/pkgdepgraph.1
index a885b66aa05..165fdda11bd 100644
--- a/pkgtools/pkgdepgraph/files/pkgdepgraph.1
+++ b/pkgtools/pkgdepgraph/files/pkgdepgraph.1
@@ -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>
.\" Absolutely no warranty.
@@ -41,6 +41,8 @@ is not connected to a tty), in search of output that resembles that
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 @@ and
.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 --git a/pkgtools/pkgdepgraph/files/pkgdepgraph.pl b/pkgtools/pkgdepgraph/files/pkgdepgraph.pl
index ce6fa67e8c6..08d1f99f51c 100755
--- a/pkgtools/pkgdepgraph/files/pkgdepgraph.pl
+++ b/pkgtools/pkgdepgraph/files/pkgdepgraph.pl
@@ -3,7 +3,7 @@
# Copyright (c) 2002, 2003, 2004 by Andrew Brown <atatat@netbsd.org>
# 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 @@ if (@ARGV || ! -t) {
$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 @@ $pkgcnt = @pkgs;
## 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 @@ foreach $pkg (@pkgs) {
}
##
+## 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) {