pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/revbump Update to 1.2:



details:   https://anonhg.NetBSD.org/pkgsrc/rev/4ce75f1575d4
branches:  trunk
changeset: 509200:4ce75f1575d4
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Sun Mar 05 23:35:49 2006 +0000

description:
Update to 1.2:
New script "finddepends" that finds all packages that need bumping.
No need for an index, and not as many false positives too.

Update recursive PKGREVISION instructions in revbump(1).

diffstat:

 pkgtools/revbump/Makefile            |   14 ++-
 pkgtools/revbump/PLIST               |    4 +-
 pkgtools/revbump/files/blbump.1      |    5 +-
 pkgtools/revbump/files/finddepends   |  120 +++++++++++++++++++++++++++++++++++
 pkgtools/revbump/files/finddepends.1 |   69 ++++++++++++++++++++
 pkgtools/revbump/files/revbump.1     |   38 ++++++----
 6 files changed, 225 insertions(+), 25 deletions(-)

diffs (truncated from 341 to 300 lines):

diff -r 8bf197bf52d7 -r 4ce75f1575d4 pkgtools/revbump/Makefile
--- a/pkgtools/revbump/Makefile Sun Mar 05 22:36:29 2006 +0000
+++ b/pkgtools/revbump/Makefile Sun Mar 05 23:35:49 2006 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.4 2005/11/24 18:49:07 wiz Exp $
+# $NetBSD: Makefile,v 1.5 2006/03/05 23:35:49 wiz Exp $
 #
 
-DISTNAME=              revbump-1.1
+DISTNAME=              revbump-1.2
 CATEGORIES=            pkgtools
 MASTER_SITES=          # empty
 DISTFILES=             # empty
@@ -18,17 +18,21 @@
 USE_TOOLS+=    perl:run
 USE_LANGUAGES= # empty
 
-INSTALLATION_DIRS=     bin man/man8
+INSTALLATION_DIRS=     bin man/man1
 
 do-build:
+       ${SED} -e "s!@PERL@!${PERL5}!g" ${FILESDIR}/blbump \
+               > ${WRKDIR}/blbump
+       ${SED} -e "s!@PERL@!${PERL5}!g" ${FILESDIR}/finddepends \
+               > ${WRKDIR}/finddepends
        ${SED} -e "s!@PERL@!${PERL5}!g" ${FILESDIR}/revbump \
                > ${WRKDIR}/revbump
-       ${SED} -e "s!@PERL@!${PERL5}!g" ${FILESDIR}/blbump \
-               > ${WRKDIR}/blbump
 
 do-install:
        ${INSTALL_SCRIPT} ${WRKDIR}/blbump ${PREFIX}/bin
        ${INSTALL_MAN} ${FILESDIR}/blbump.1 ${PREFIX}/man/man1
+       ${INSTALL_SCRIPT} ${WRKDIR}/finddepends ${PREFIX}/bin
+       ${INSTALL_MAN} ${FILESDIR}/finddepends.1 ${PREFIX}/man/man1
        ${INSTALL_SCRIPT} ${WRKDIR}/revbump ${PREFIX}/bin
        ${INSTALL_MAN} ${FILESDIR}/revbump.1 ${PREFIX}/man/man1
 
diff -r 8bf197bf52d7 -r 4ce75f1575d4 pkgtools/revbump/PLIST
--- a/pkgtools/revbump/PLIST    Sun Mar 05 22:36:29 2006 +0000
+++ b/pkgtools/revbump/PLIST    Sun Mar 05 23:35:49 2006 +0000
@@ -1,5 +1,7 @@
-@comment $NetBSD: PLIST,v 1.2 2005/11/24 18:49:07 wiz Exp $
+@comment $NetBSD: PLIST,v 1.3 2006/03/05 23:35:49 wiz Exp $
 bin/blbump
+bin/finddepends
 bin/revbump
 man/man1/blbump.1
+man/man1/finddepends.1
 man/man1/revbump.1
diff -r 8bf197bf52d7 -r 4ce75f1575d4 pkgtools/revbump/files/blbump.1
--- a/pkgtools/revbump/files/blbump.1   Sun Mar 05 22:36:29 2006 +0000
+++ b/pkgtools/revbump/files/blbump.1   Sun Mar 05 23:35:49 2006 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: blbump.1,v 1.1.1.1 2005/01/05 00:31:39 wiz Exp $
+.\"    $NetBSD: blbump.1,v 1.2 2006/03/05 23:35:49 wiz Exp $
 .\"
 .\" Copyright (c) 2003, 2004, 2005 The NetBSD Foundation, Inc.
 .\"
@@ -31,7 +31,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 4, 2005
+.Dd March 6, 2006
 .Dt BLBUMP 1
 .Os
 .Sh NAME
@@ -62,4 +62,5 @@
 .Ar category/package
 form) on stdout for each package where it failed.
 .Sh SEE ALSO
+.Xr finddepends 1 ,
 .Xr revbump 1
diff -r 8bf197bf52d7 -r 4ce75f1575d4 pkgtools/revbump/files/finddepends
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/revbump/files/finddepends        Sun Mar 05 23:35:49 2006 +0000
@@ -0,0 +1,120 @@
+#!@PERL@ -w
+#
+# $NetBSD: finddepends,v 1.1 2006/03/05 23:35:49 wiz Exp $
+#
+# Copyright (c) 2006 The NetBSD Foundation, Inc.
+#
+# This code was originally contributed to the NetBSD Foundation, Inc.
+# by Thomas Klausner <wiz%NetBSD.org@localhost>.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+#    notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+#    notice, this list of conditions and the following disclaimer in
+#    the documentation and/or other materials provided with the
+#    distribution.
+# 3. Neither the name of author nor the names of its contributors may
+#    be used to endorse or promote products derived from this software
+#    without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
+# CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+# INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+
+$PKGSRCDIR = $ENV{PKGSRCDIR};
+if (! $PKGSRCDIR) {
+    $PKGSRCDIR = "/usr/pkgsrc";
+}
+
+sub usage {
+    print STDERR "usage: finddepends package\n\n";
+    print STDERR "Find all packages that depend on the argument package.\n";
+    exit 0;
+}
+
+usage if (1 ne @ARGV);
+
+$arg = shift;
+
+@searchlist = ();
+push @searchlist, $arg;
+
+if (! -d $PKGSRCDIR || ! -d "$PKGSRCDIR/doc" || ! -d "$PKGSRCDIR/mk") {
+    print STDERR "Invalid pkgsrc directory $PKGSRCDIR\n";
+    exit 1;
+}
+
+@bl3files = <$PKGSRCDIR/*/*/buildlink3.mk>;
+%bl3content = ();
+foreach $bl3 (@bl3files) {
+    open OUT, $bl3 or die "can't open $bl3";
+    $content = "";
+    while (<OUT>) {
+       chomp($_);
+       $content .= $_;
+    }
+    close OUT;
+    $bl3content{$bl3} = $content;
+}
+
+@bl3result = ();
+while ($pattern = pop @searchlist) {
+#    print "* Looking for $pattern\n";
+    for $key (keys %bl3content) {
+#      print "searching $key ($bl3content{$key})\n\n";
+       if ($bl3content{$key} =~ m/$pattern/) {
+#          print "\n\n ******** MATCH $key \n\n";
+#          print "** $pattern found in $key\n";
+#          print "** BUMP $key\n";
+           delete($bl3content{$key});
+#          print "\n\n **** ADDING $key \n\n";
+           $key =~ s,$PKGSRCDIR/,,;
+#          print "** Adding $key\n";
+           print "$key\n";
+           push @searchlist, $key;
+           push @bl3result, $key;
+       }
+    }
+}
+
+print "\n";
+
+@makefiles = <$PKGSRCDIR/*/*/Makefile*>;
+
+for $makefile (@makefiles) {
+#    print "* reading $makefile\n";
+    open OUT, $makefile or die "can't open $bl3";
+    $content = "";
+    while (<OUT>) {
+       chomp($_);
+       $content .= $_;
+    }
+    close OUT;
+    $found = 0;
+    for $pattern (@bl3result) {
+       if ($content =~ m/$pattern/) {
+           $found = 1;
+           last;
+       }
+    }
+#    print "** BUMP $makefile\n" if ($found);
+    if ($found) {
+       $makefile =~ s,$PKGSRCDIR/,,;
+       print "$makefile\n";
+    }
+}
+
+exit 0;
diff -r 8bf197bf52d7 -r 4ce75f1575d4 pkgtools/revbump/files/finddepends.1
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/pkgtools/revbump/files/finddepends.1      Sun Mar 05 23:35:49 2006 +0000
@@ -0,0 +1,69 @@
+.\"    $NetBSD: finddepends.1,v 1.1 2006/03/05 23:35:49 wiz Exp $
+.\"
+.\" Copyright (c) 2006 The NetBSD Foundation, Inc.
+.\"
+.\" This code was originally contributed to the NetBSD Foundation, Inc.
+.\" by Thomas Klausner <wiz%NetBSD.org@localhost>.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"    notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"    notice, this list of conditions and the following disclaimer in
+.\"    the documentation and/or other materials provided with the
+.\"    distribution.
+.\" 3. Neither the name of author nor the names of its contributors may
+.\"    be used to endorse or promote products derived from this software
+.\"    without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
+.\" CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+.\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+.\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd March 6, 2006
+.Dt FINDDEPENDS 1
+.Os
+.Sh NAME
+.Nm finddepends
+.Nd tool for finding packages including a particular file
+.Sh SYNOPSIS
+.Nm
+.Ar pattern
+.Sh DESCRIPTION
+.Nm
+is a perl script for pkgsrc developers that helps finding packages
+affected by a recursive PKGREVISION bump.
+Given a
+.Ar pattern
+on the command line, it will recursively find all buildlink3.mk files
+that include it, and then find all Makefiles that include any of the
+buildlink3.mk files.
+.Pp
+See
+.Xr revbump 1
+for an example of a complete recursive PKGREVISION bump.
+.Sh ENVIRONMENT
+.Ev PKGSRCDIR
+pkgsrc root directory.
+Defaults to
+.Pa /usr/pkgsrc .
+.Sh EXAMPLES
+.Dl finddepends security/libtasn1
+.Pp
+would first output all buildlink3.mk files that include
+security/libtasn1, and then all Makefiles that include any of the
+found buildlink3.mk files.
+.Sh SEE ALSO
+.Xr blbump 1 ,
+.Xr revbump 1
diff -r 8bf197bf52d7 -r 4ce75f1575d4 pkgtools/revbump/files/revbump.1
--- a/pkgtools/revbump/files/revbump.1  Sun Mar 05 22:36:29 2006 +0000
+++ b/pkgtools/revbump/files/revbump.1  Sun Mar 05 23:35:49 2006 +0000
@@ -1,6 +1,6 @@
-.\"    $NetBSD: revbump.1,v 1.1.1.1 2005/01/05 00:31:38 wiz Exp $
+.\"    $NetBSD: revbump.1,v 1.2 2006/03/05 23:35:49 wiz Exp $
 .\"
-.\" Copyright (c) 2003, 2004, 2005 The NetBSD Foundation, Inc.
+.\" Copyright (c) 2003, 2004, 2005, 2006 The NetBSD Foundation, Inc.
 .\"
 .\" This code was originally contributed to the NetBSD Foundation, Inc.
 .\" by Julio Merino <jmmv%NetBSD.org@localhost> and Thomas Klausner <wiz%NetBSD.org@localhost>.
@@ -31,7 +31,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 4, 2005
+.Dd March 6, 2006
 .Dt REVBUMP 1
 .Os
 .Sh NAME
@@ -65,7 +65,7 @@
 .Pp
 would bump the PKGREVISIONs of gmake and glib2, as would
 .Bd -literal -offset indent
-revbump << EOF
+revbump \*[Lt]\*[Lt] EOF
 devel/gmake
 x11/glib2



Home | Main Index | Thread Index | Old Index