Import of pkgsrc-2013Q2

This commit is contained in:
2013-09-26 17:14:40 +02:00
commit 785076ae39
74991 changed files with 4380255 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
This package contains two tools for maintaining pkgsrc/doc/TODO.
add_todo adds lines for newly available updates for packages to
the TODO file.
obsolete_todo checks the contents of pkgsrc/doc/TODO against updates
noted in the CHANGES-* files and removes entries for packages which
were already updated to newer files.

View File

@@ -0,0 +1,56 @@
# $NetBSD: Makefile,v 1.6 2013/05/31 12:41:46 wiz Exp $
#
DISTNAME= pkgsrc-todo-1.2
PKGREVISION= 1
CATEGORIES= pkgtools
MASTER_SITES= # none
DISTFILES= # none
MAINTAINER= wiz@NetBSD.org
HOMEPAGE= http://www.NetBSD.org/docs/pkgsrc/
COMMENT= Tools for maintaing pkgsrc/doc/TODO
DEPENDS+= p5-pkgsrc-Dewey-[0-9]*:../../pkgtools/p5-pkgsrc-Dewey
WRKSRC= ${WRKDIR}
NO_BUILD= yes
USE_LANGUAGES= # none
USE_TOOLS+= perl:build
INSTALLATION_DIRS= bin ${PKGMANDIR}/man1
.include "../../mk/bsd.prefs.mk"
SUBST_CLASSES+= todo
SUBST_STAGE.todo= post-configure
SUBST_FILES.todo+= add_todo.pl
SUBST_FILES.todo+= add_todo.1
SUBST_FILES.todo+= list_todo.sh
SUBST_FILES.todo+= obsolete_todo.pl
SUBST_FILES.todo+= obsolete_todo.1
SUBST_SED.todo+= -e s\|pkgsrc/\|${PKGSRCDIR}/\|g
SUBST_SED.todo+= -e s\|@PKGSRCDIR@\|${PKGSRCDIR}\|g
SUBST_SED.todo+= -e s\|@PERL@\|${PERL5:Q}\|g
SUBST_SED.todo+= -e s\|@SED@\|${SED:Q}\|g
SUBST_SED.todo+= -e s\|@PKG_INFO@\|${PKG_INFO:Q}\|g
do-extract:
cd ${FILESDIR} && ${CP} add_todo.1 add_todo.pl list_todo.sh \
list_todo.1 obsolete_todo.1 obsolete_todo.pl ${WRKSRC}
do-install:
${INSTALL_SCRIPT} ${WRKSRC}/add_todo.pl \
${DESTDIR}${PREFIX}/bin/add_todo
${INSTALL_SCRIPT} ${WRKSRC}/list_todo.sh \
${DESTDIR}${PREFIX}/bin/list_todo
${INSTALL_SCRIPT} ${WRKSRC}/obsolete_todo.pl \
${DESTDIR}${PREFIX}/bin/obsolete_todo
${INSTALL_MAN} ${WRKSRC}/add_todo.1 \
${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
${INSTALL_MAN} ${WRKSRC}/list_todo.1 \
${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
${INSTALL_MAN} ${WRKSRC}/obsolete_todo.1 \
${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
.include "../../mk/bsd.pkg.mk"

View File

@@ -0,0 +1,7 @@
@comment $NetBSD: PLIST,v 1.2 2013/02/09 20:59:57 wiz Exp $
bin/add_todo
bin/list_todo
bin/obsolete_todo
man/man1/add_todo.1
man/man1/list_todo.1
man/man1/obsolete_todo.1

View File

@@ -0,0 +1,65 @@
.\" $NetBSD: add_todo.1,v 1.3 2012/03/14 14:34:39 wiz Exp $
.\"
.Dd March 8, 2012
.Dt ADD_TODO 1
.Sh NAME
.Nm add_todo
.Nd add entries to pkgsrc/doc/TODO
.Sh SYNOPSIS
.Nm
.Op Fl f
.Ar package
.Sh DESCRIPTION
.Nm
adds an entry for
.Ar package
to the
.Pa pkgsrc/doc/TODO
file.
The
.Ar package
argument needs to be of the form
.Dq PKGNAME-PKGVERSION ,
e.g.,
.Dq pkgsrc-todo-1.1 .
.Nm
checks if the package exists in pkgsrc by looking for an entry for it
in the
.Pa CHANGES-*
files (to catch typos).
It also checks if the update was already committed, i.e., if an entry for
it or a newer version exists in any
.Pa CHANGES-*
files.
This second check can be overridden by using the
.Fl f
flag.
.Pp
.Nm
assumes that the contents of
.Pa pkgsrc/doc
are up-to-date.
The
.Pa TODO
file needs to be committed manually afterwards.
.Sh FILES
.Bl -tag -width 20n
.It Pa pkgsrc/doc/TODO
.Nm
adds entries to this file.
.It Pa pkgsrc/doc/CHANGES-*
.Nm
checks these files before adding entries.
.El
.Sh AUTHORS
.An Thomas Klausner Aq wiz@NetBSD.org
.Sh BUGS
.Nm
currently can't add an entry at the end of the list.
.Pp
.Nm
should check if a package was removed before adding an entry for it.
.Pp
.Nm
should check if a package was downgraded; this information is
currently disregarded.

View File

@@ -0,0 +1,153 @@
#!@PERL@
# $NetBSD: add_todo.pl,v 1.1.1.1 2009/08/30 10:40:34 wiz Exp $
# TODO:
# fix adding entry after last one (currently broken)
# check if package was removed
# check if package was downgraded (e.g. oto)
# allow multiple command line arguments
use strict;
use Getopt::Std;
use pkgsrc::Dewey;
use constant regex_pkgname => qr"^(.*)-(\d[^-]*)$";
my ($comment, $entry, $grep_result, $newname, $newpkg, $newprinted,
$newversion, %opt, $verbose);
my $PKGSRCDIR = "@PKGSRCDIR@";
my $input = "$PKGSRCDIR/doc/TODO";
my $wipinput = "$PKGSRCDIR/wip/TODO";
my $output = "$input.new";
my $changes = "$PKGSRCDIR/doc/CHANGES*";
getopts('fp:', \%opt);
#usage() if $opt{h};
if ($opt{p}) {
$PKGSRCDIR = $opt{p};
}
$newpkg = shift(@ARGV);
$newpkg =~ regex_pkgname;
$newname = $1;
$newversion = $2;
# same code in obsolete_todo, keep in sync
sub update_done($$) {
my ($file, $found_at_all, @files);
my ($pkg, $ver) = @_;
$found_at_all = 0;
@files = glob($changes);
# XXX: better way of handling +?
$pkg =~ s/\+//g;
# look in newest files first
foreach $file (reverse(@files)) {
open IN, $file;
while (<IN>) {
if (m/[ \/]$pkg version ([^ ]*) / or
(m/[ \/]$pkg to ([^ ]*) / and not m/Moved/) or
m/[ \/]$pkg-([0-9][^ -]*) /) {
$found_at_all = 1;
if (dewey_cmp($ver, "<=", $1)) {
print STDERR "$pkg already at $1:\n";
print STDERR "$file: $_";
close(IN);
return 1;
}
}
}
close(IN);
# if found in latest CHANGES file, but no newer version,
# assume the version to add is newer and don't check
# older files
if ($found_at_all) {
last;
}
}
return 0;
}
$newprinted = 0;
$verbose = 1;
$grep_result = qx/grep -e "[ \/]"$newname"[ -]" $changes/;
if (not $grep_result) {
if (-d "$PKGSRCDIR/wip/$newname") {
$input = $wipinput;
}
else {
die "$newname not found in CHANGES* or wip\n";
}
}
if (update_done($newname, $newversion)) {
exit if not $opt{f};
print STDERR "Ignored old entry (forced)\n";
}
open IN, $input or die "can't open input file ``$input''";
open OUT, ">$output" or die "can't open output file ``$output''";
while (<IN>) {
if ($newprinted or not m/^ o /) {
print OUT $_;
next;
}
chomp();
s/^\to //;
if (m/([^ ]*)( .*)/) {
$entry = $1;
$comment = $2;
} else {
$entry = $_;
$comment = "";
}
$entry =~ regex_pkgname;
my ($entryname, $entryversion) = ($1, $2);
# different package, alphabetically before new entry
if ($newname gt $entryname) {
print OUT " o $entry$comment\n";
next;
}
# different package, alphabetically after new entry -> add entry
if ($newname lt $entryname) {
print OUT " o $newpkg\n";
print OUT " o $entry$comment\n";
$newprinted = 1;
next;
}
# $newname eq $entryname
if (dewey_cmp($newversion, "<=", $entryversion)) {
if ($opt{f}) {
print STDERR "Replaced $entry (forced)\n" if $verbose;
print OUT " o $newpkg\n";
} else {
print STDERR "Newer or same version $entry already in TODO\n" if $verbose;
print OUT " o $entry$comment\n";
}
}
else {
if ($comment) {
print STDERR "Keeping $entry because it has a comment:$comment\n";
print OUT " o $entry$comment\n";
next;
}
print STDERR "Replaced $entry\n" if $verbose;
print OUT " o $newpkg\n";
}
$newprinted = 1;
}
close IN;
close OUT;
rename($output, $input) or die "can't rename $output to $input";

View File

@@ -0,0 +1,20 @@
.\" $NetBSD: list_todo.1,v 1.1 2013/02/09 21:00:12 wiz Exp $
.\"
.Dd February 9, 2013
.Dt LIST_TODO 1
.Sh NAME
.Nm list_todo
.Nd list entries for installed packages in pkgsrc/doc/TODO
.Sh SYNOPSIS
.Nm
.Sh DESCRIPTION
.Nm
lists from the pkgsrc TODO file for installed packages.
.Sh FILES
.Bl -tag -width 20n
.It Pa pkgsrc/doc/TODO
.Nm
list entries from file.
.El
.Sh AUTHORS
.An Thomas Klausner Aq wiz@NetBSD.org

View File

@@ -0,0 +1,13 @@
#!/bin/sh
@PKG_INFO@ | \
@SED@ -e "s/[ ].*//" -e "s/-[^-]*$//" \
-e "s/py[0-9][0-9]-/py-/" | \
while read a
do
b=$(grep "o $a-[0-9]" @PKGSRCDIR@/doc/TODO | \
@SED@ -e "s/[ ]*o //")
if [ "$b" ]
then
echo $a: $b
fi
done

View File

@@ -0,0 +1,68 @@
.\" $NetBSD: obsolete_todo.1,v 1.3 2012/03/14 14:34:39 wiz Exp $
.\"
.Dd March 8, 2012
.Dt OBSOLETE_TODO 1
.Sh NAME
.Nm obsolete_todo
.Nd remove obsolete entries from pkgsrc/doc/TODO
.Sh SYNOPSIS
.Nm
.Sh DESCRIPTION
.Nm
removes obsoleted entries from
.Pa pkgsrc/doc/TODO ,
i.e., entries for packages that already exist
in pkgsrc in either the version from the entry or a higher one.
It does this by checking the entries in
.Pa pkgsrc/doc/TODO
against the entries in the various
.Pa pkgsrc/doc/CHANGES-*
files.
.Pp
.Nm
assumes that the contents of
.Pa pkgsrc/doc
are up-to-date.
The
.Pa TODO
file needs to be committed manually afterwards, but read
.Sx BUGS
first.
.Sh FILES
.Bl -tag -width 20n
.It Pa pkgsrc/doc/TODO
.Nm
removes entries to this file.
.It Pa pkgsrc/doc/CHANGES-*
.Nm
compares against these files for finding entries to remove.
.El
.Sh AUTHORS
.An Thomas Klausner Aq wiz@NetBSD.org
.Sh BUGS
.Nm
removes too many entries, so please don't directly commit the result
of
.Nm !
Currently, the following entries are removed even though they
shouldn't be:
.Bl -tag
.It lapack-3.4.0
.It ldapsdk-6.0.7
.It libixp-0.5
.It libssh-0.5.2
.It lmbench-2.5
.It oto-0.5
.It zenicb-1.31
.El
.Pp
There are three reasons:
.Bl -enum
.It
matching errors (bonnie vs. bonnie++)
.It
downgraded packages (libixp, oto)
.It
changes in versioning schemes (lapack, ldapsdk, libssh,
lmbench, zenicb)
.El

View File

@@ -0,0 +1,97 @@
#!@PERL@
# $NetBSD: obsolete_todo.pl,v 1.1.1.1 2009/08/30 10:40:34 wiz Exp $
# TODO:
# check if package was removed
use strict;
use pkgsrc::Dewey;
my ($comment, $entry, $import, $newfound, $oldfound, $enteredos,
$filever, $found, $name, @newlist, @oldlist, $pkg, $version, $verbose);
my $PKGSRCDIR = "@PKGSRCDIR@";
my $input = "$PKGSRCDIR/doc/TODO";
my $output = "$PKGSRCDIR/doc/TODO.new";
my $changes = "$PKGSRCDIR/doc/CHANGES*";
# same code in add_todo, keep in sync
sub update_done($$) {
my ($file, $found_at_all, @files);
my ($pkg, $ver) = @_;
$found_at_all = 0;
@files = glob($changes);
# XXX: better way of handling +?
$pkg =~ s/\+//g;
# look in newest files first
foreach $file (reverse(@files)) {
open SUBIN, $file;
while (<SUBIN>) {
if (m/[ \/]$pkg version ([^ ]*) / or
(m/[ \/]$pkg to ([^ ]*) / and not m/Moved/) or
m/[ \/]$pkg-([0-9][^ -]*) /) {
$found_at_all = 1;
if (dewey_cmp($ver, "<=", $1)) {
print STDERR "$pkg already at $1:\n";
print STDERR "$file: $_";
close(SUBIN);
return 1;
}
}
}
close(SUBIN);
# if found in latest CHANGES file, but no newer version,
# assume the version to add is newer and don't check
# older files
if ($found_at_all) {
last;
}
}
return 0;
}
open IN, $input or die "can't open TODO file";
open OUT, ">$output" or die "can't open TODO output file";
$verbose = 1;
$enteredos = 0;
MAIN: while (<IN>) {
if ($enteredos == 2 or not m/^ o /) {
if ($enteredos == 1) {
$enteredos = 2;
}
print OUT $_;
next;
}
$enteredos = 1;
chomp();
s/^ o //;
if (m/(\S*)(\s.*)/) {
$pkg = $1;
$comment = $2;
} else {
$pkg = $_;
$comment = "";
}
$pkg =~ m/(.*)-([^-]*)$/;
$name = $1;
$version = $2;
if (update_done($name, $version)) {
print STDERR "Removing entry for $name-$version\n";
next MAIN;
}
print OUT "\to $pkg$comment\n";
}
close IN;
close OUT;
rename($output, $input) or die "can't rename $output to $input";