Import of pkgsrc-2015Q1

This commit is contained in:
2015-04-22 14:34:26 +02:00
committed by Lionel Sambuc
parent 9a8c06dafb
commit 4af1cdf7a9
25114 changed files with 870550 additions and 795435 deletions

View File

@@ -1,7 +1,6 @@
# $NetBSD: Makefile,v 1.15 2014/03/03 03:30:53 obache Exp $
# $NetBSD: Makefile,v 1.19 2015/01/10 20:12:24 wiz Exp $
PKGNAME= lintpkgsrc-4.86
PKGREVISION= 1
PKGNAME= lintpkgsrc-4.88
CATEGORIES= pkgtools
MAINTAINER= pkgsrc-users@NetBSD.org
@@ -11,8 +10,6 @@ COMMENT= Sanity checks on the complete pkgsrc tree
DEPENDS+= digest>=20010101:../../pkgtools/digest
CONFLICTS+= pkglint<4.82
PKG_INSTALLATION_TYPES= overwrite pkgviews
USE_TOOLS+= perl:run
WRKSRC= ${WRKDIR}

View File

@@ -1,17 +1,17 @@
LINTPKGSRC(1) NetBSD General Commands Manual LINTPKGSRC(1)
LINTPKGSRC(1) General Commands Manual LINTPKGSRC(1)
NNAAMMEE
lliinnttppkkggssrrcc -- verifier for the pkgsrc tree
SSYYNNOOPPSSIISS
lliinnttppkkggssrrcc [--BBDDLLOORRSSVVddhhiillmmoopprruu] [--EE _f_i_l_e] [--gg _p_k_g_s_r_c_m_a_p] [--II _f_i_l_e]
lliinnttppkkggssrrcc [--BBDDddLLllmmOOooppRRrrSSuuVVyyzz] [--EE _f_i_l_e] [--gg _p_k_g_s_r_c_m_a_p] [--II _f_i_l_e]
[--KK _P_A_C_K_A_G_E_S] [--MM _D_I_S_T_D_I_R] [--PP _P_K_G_S_R_C_D_I_R] [_m_a_k_e_f_i_l_e _._._.]
DDEESSCCRRIIPPTTIIOONN
lliinnttppkkggssrrcc tries to verify the entire contents of the pkgsrc tree.
lliinnttppkkggssrrcc uses simple regular-expression matching for verifying files
that make up a pkgsrc directory. Note that it does NOT implement com-
plete Makefile parser.
that make up a pkgsrc directory. Note that it does NOT implement a
complete Makefile parser.
OOppttiioonnss
--BB List packages marked as BROKEN.
@@ -31,17 +31,17 @@ DDEESSCCRRIIPPTTIIOONN
a set of similarly configured machines (in the absence of
extra copies of the pkgsrc tree) both quick and possible.
--gg _p_k_g_s_r_c_m_a_p Generate pkgsrcmap file containing an entry for each pack-
age of `pkgname pkgdir pkgver'.
--gg _p_k_g_s_r_c_m_a_p Generate pkgsrcmap file containing an entry for each
package of `pkgname pkgdir pkgver'.
--hh Basic help and usage.
--II _f_i_l_e Imports the data to construct the internal database for
checking the installed versions of packages, among other
things, against the current version found in pkgsrc. This
database provides most or all of the data required for run-
ning lliinnttppkkggssrrcc with any combination of --BB, --OO, --RR, --SS, --VV,
--dd, --gg, --ii, --pp, or --uu.
database provides most or all of the data required for
running lliinnttppkkggssrrcc with any combination of --BB, --OO, --RR, --SS,
--VV, --dd, --gg, --ii, --pp, or --uu.
--ii Check the version of each installed package against the
current version in pkgsrc.
@@ -50,7 +50,7 @@ DDEESSCCRRIIPPTTIIOONN
_/_e_t_c_/_m_k_._c_o_n_f or defaulted to _$_{_P_K_G_S_R_C_D_I_R_}_/_p_a_c_k_a_g_e_s.
Note: lintpkgsrc treats _P_A_C_K_A_G_E_S slightly differently to
the pkgsrc build system. --pp, --RR and --VV check for binary
the pkgsrc build system. --pp, --RR, and --VV check for binary
packages in any depth of PACKAGES subdirs - this allows
packages for all architectures/OS versions to be checked
simultaneously with an _/_e_t_c_/_m_k_._c_o_n_f construct of the form:
@@ -70,7 +70,7 @@ DDEESSCCRRIIPPTTIIOONN
_$_{_P_K_G_S_R_C_D_I_R_}_/_d_i_s_t_f_i_l_e_s.
--mm For each current distfile, verify its checksum against the
appropriate package's distinfo file. Also report if any
appropriate package's distinfo file. Also report if any
package's distinfo file references the same distfile with a
different distinfo checksum.
@@ -92,11 +92,11 @@ DDEESSCCRRIIPPTTIIOONN
This is intended to help those making binary packages
available for ftp.
--rr Remove distfiles which are not referenced from any pack-
age's distinfo file, or have an incorrect checksum (usually
due to an interrupted download), and any old binary pack-
ages. To remove any given type, additionally specify the
--oo, --mm, or --pp flags respectively.
--rr Remove distfiles which are not referenced from any
package's distinfo file, or have an incorrect checksum
(usually due to an interrupted download), and any old
binary packages. To remove any given type, additionally
specify the --oo, --mm, or --pp flags respectively.
--SS List packages missing from category _S_U_B_D_I_R lists.
@@ -111,21 +111,27 @@ DDEESSCCRRIIPPTTIIOONN
known vulnerabilities, based on the data in
_$_{_P_K_G_S_R_C_D_I_R_}_/_d_i_s_t_f_i_l_e_s_/_p_k_g_-_v_u_l_n_e_r_a_b_i_l_i_t_i_e_s.
--yy Remove orphaned distfiles, i.e., those that do not belong
to any currently installed package.
--zz Remove distfiles for currently installed packages.
AAUUTTHHOORRSS
David Brownlee <abs@netbsd.org>
David Brownlee <_a_b_s_@_n_e_t_b_s_d_._o_r_g>
BBUUGGSS
The --RR, --VV, and --pp options default to using _P_A_C_K_A_G_E_S as the base direc-
tory from which to search for binary packages. If this includes OS or
architecture information then packages for other OS/architecture combina-
tions will be missed. In this case _P_A_C_K_A_G_E_S can be overridden with --KK or
set conditionally in _/_e_t_c_/_m_k_._c_o_n_f based on the value of _L_I_N_T_P_K_G_S_R_C.
The --RR, --VV, and --pp options default to using _P_A_C_K_A_G_E_S as the base
directory from which to search for binary packages. If this includes OS
or architecture information then packages for other OS/architecture
combinations will be missed. In this case _P_A_C_K_A_G_E_S can be overridden
with --KK or set conditionally in _/_e_t_c_/_m_k_._c_o_n_f based on the value of
_L_I_N_T_P_K_G_S_R_C.
The `Makefile parsing' algorithm used to obtain package versions and
DEPENDS information is geared towards speed rather than perfection,
though it has got somewhat better over time, it only parses the simplest
Makefile conditionals. (a == b, no && etc).
Makefile conditionals. (a == b, no && etc).
Potentially others, but non serious to date.
pkgsrc November 8, 2005 pkgsrc
LOCAL November 24, 2014 LOCAL

View File

@@ -1,16 +1,16 @@
.\" $NetBSD: lintpkgsrc.1,v 1.2 2013/07/20 21:50:53 wiz Exp $
.\" $NetBSD: lintpkgsrc.1,v 1.4 2014/11/24 09:50:34 wiz Exp $
.\"
.\" Copyright (c) 1999 by David Brownlee (abs@netbsd.org)
.\" Absolutely no warranty.
.\"
.Dd November 8, 2005
.Dd November 24, 2014
.Dt LINTPKGSRC 1
.Sh NAME
.Nm lintpkgsrc
.Nd verifier for the pkgsrc tree
.Sh SYNOPSIS
.Nm
.Op Fl BDLORSVdhilmopru
.Op Fl BDdLlmOopRrSuVyz
.Op Fl E Ar file
.Op Fl g Ar pkgsrcmap
.Op Fl I Ar file
@@ -24,7 +24,7 @@ tries to verify the entire contents of the pkgsrc tree.
.Nm
uses simple regular-expression matching for verifying
files that make up a pkgsrc directory.
Note that it does NOT implement complete Makefile parser.
Note that it does NOT implement a complete Makefile parser.
.Ss Options
.Bl -tag -width xxxxxxxxxxxx
.It Fl B
@@ -82,7 +82,7 @@ Note: lintpkgsrc treats
.Em PACKAGES
slightly differently to the pkgsrc build system.
.Fl p ,
.Fl R
.Fl R ,
and
.Fl V
check for
@@ -107,7 +107,8 @@ Set directory for distfiles, defaults to
.Pa ${PKGSRCDIR}/distfiles .
.It Fl m
For each current distfile, verify its checksum against the appropriate
package's distinfo file. Also report if any package's distinfo file references
package's distinfo file.
Also report if any package's distinfo file references
the same distfile with a different distinfo checksum.
.It Fl O
Report any binary packages in any subdirs of
@@ -136,8 +137,8 @@ This is intended to help those making binary packages available for ftp.
.It Fl r
Remove distfiles which are not referenced from any package's distinfo file,
or have an incorrect checksum (usually due to an interrupted download),
and any old binary packages. To remove any given type, additionally
specify the
and any old binary packages.
To remove any given type, additionally specify the
.Fl o ,
.Fl m ,
or
@@ -161,6 +162,11 @@ List any prebuilt packages in any subdirs of
.Em PACKAGES
with known vulnerabilities, based on the data in
.Pa ${PKGSRCDIR}/distfiles/pkg-vulnerabilities .
.It Fl y
Remove orphaned distfiles, i.e., those that do not belong to any
currently installed package.
.It Fl z
Remove distfiles for currently installed packages.
.El
.Sh AUTHORS
.An David Brownlee Aq Mt abs@netbsd.org
@@ -173,7 +179,8 @@ and
options default to using
.Em PACKAGES
as the base directory from which to
search for binary packages. If this includes OS or architecture information
search for binary packages.
If this includes OS or architecture information
then packages for other OS/architecture combinations will be missed.
In this case
.Em PACKAGES
@@ -189,6 +196,7 @@ The
algorithm used to obtain package versions
and DEPENDS information is geared towards speed rather than
perfection, though it has got somewhat better over time, it only
parses the simplest Makefile conditionals. (a == b, no \*[Am]\*[Am] etc).
parses the simplest Makefile conditionals.
(a == b, no \*[Am]\*[Am] etc).
.Pp
Potentially others, but non serious to date.

View File

@@ -1,6 +1,6 @@
#! @PERL@
# $NetBSD: lintpkgsrc.pl,v 1.3 2013/02/09 18:51:56 mspo Exp $
# $NetBSD: lintpkgsrc.pl,v 1.5 2015/01/10 20:12:24 wiz Exp $
# Written by David Brownlee <abs@netbsd.org>.
#
@@ -42,7 +42,7 @@ $ENV{PATH} .=
":/bin:/usr/bin:/sbin:/usr/sbin:${conf_prefix}/sbin:${conf_prefix}/bin";
if (
!getopts( 'BDE:I:K:LM:OP:RSVdg:himopru', \%opt )
!getopts( 'BDE:I:K:LM:OP:RSVdg:himopruyz', \%opt )
|| $opt{h}
|| !(
defined $opt{d}
@@ -60,6 +60,8 @@ if (
|| defined $opt{S}
|| defined $opt{V}
|| defined $opt{E}
|| defined $opt{y}
|| defined $opt{z}
)
)
{
@@ -119,6 +121,127 @@ sub main() {
}
}
# Remove all distfiles that are / are not part of an installed package
if ($opt{y} || $opt{z})
{
my(@pkgs, @installed, %distfiles, @pkgdistfiles, @dldistfiles);
my(@tmpdistfiles, @orphan, $found, @parent);
@pkgs = list_installed_packages();
scan_pkgsrc_makefiles($pkgsrcdir);
# list the installed packages and the directory they live in
foreach my $pkgname (sort @pkgs)
{
if ($pkgname =~ /^([^*?[]+)-([\d*?[].*)/)
{
foreach my $pkgver ($pkglist->pkgver($1))
{
$pkgver->var('dir') =~ /-current/ && next;
push(@installed, $pkgver);
last;
}
}
}
# distfiles belonging to the currently installed packages
foreach my $pkgver (sort @installed)
{
if (open(DISTINFO, "$pkgsrcdir/" .$pkgver->var('dir'). "/distinfo"))
{
while( <DISTINFO> )
{
if (m/^(\w+) ?\(([^\)]+)\) = (\S+)/)
{
my($dn);
if ($2 =~ /^patch-[a-z0-9]+$/)
{ next; }
$dn = $2;
# Strip leading ./ which sometimes gets added
# because of DISTSUBDIR=.
$dn =~ s/^(\.\/)*//;
if (!defined $distfiles{$dn})
{
$distfiles{$dn}{name} = $dn;
push (@pkgdistfiles, $dn);
}
}
}
close(DISTINFO);
}
}
# distfiles downloaded on the current system
@tmpdistfiles = listdir("$pkgdistdir");
foreach my $tmppkg (@tmpdistfiles)
{
if ($tmppkg ne "pkg-vulnerabilities")
{ push (@dldistfiles, $tmppkg); }
}
# sort the two arrays to make searching a bit faster
@dldistfiles = sort { $a cmp $b } @dldistfiles;
@pkgdistfiles = sort { $a cmp $b } @pkgdistfiles;
if ($opt{y})
{
# looking for files that are downloaded on the current system
# but do not belong to any currently installed package i.e. orphaned
$found = 0;
foreach my $dldf (@dldistfiles)
{
foreach my $pkgdf (@pkgdistfiles)
{
if ($dldf eq $pkgdf)
{ $found = 1; }
}
if ($found != 1)
{
push (@orphan, $dldf);
print "Orphaned file: $dldf\n";
}
$found = 0;
}
if ($opt{r})
{
safe_chdir("$pkgdistdir");
verbose("Unlinking 'orphaned' distfiles\n");
foreach my $distfile (@orphan)
{ unlink($distfile) }
}
}
if ($opt{z})
{
# looking for files that are downloaded on the current system
# but belong to a currently installed package i.e. parented
$found = 0;
foreach my $pkgdf (@pkgdistfiles)
{
foreach my $dldf (@dldistfiles)
{
if ($pkgdf eq $dldf)
{ $found = 1; }
}
if ($found == 1)
{
push (@parent, $pkgdf);
print "Parented file: $pkgdf\n";
}
$found = 0;
}
}
if ($opt{r})
{
safe_chdir("$pkgdistdir");
verbose("Unlinking 'parented' distfiles\n");
foreach my $distfile (@parent)
{ unlink($distfile) }
}
}
# List BROKEN packages
if ( $opt{B} ) {
scan_pkgsrc_makefiles($pkgsrcdir);
@@ -1067,6 +1190,7 @@ sub parse_makefile_vars($$) {
# fully expand
if ( $incfile =~ m#/mk/bsd#
|| $incfile =~ /$magic_undefined/
|| $incfile =~ /\${/
|| ( !$opt{d} && $incfile =~ m#/(buildlink[^/]*\.mk)# ) )
{
debug("$file: .include \"$incfile\" skipped\n");
@@ -1608,6 +1732,8 @@ opts:
Installed package options: Distfile options:
-i : Check version against pkgsrc -m : List distinfo mismatches
-u : As -i + fetch dist (may change) -o : List obsolete (no distinfo)
-y : Remove orphan distfiles
-z : Remove installed distfiles
Prebuilt package options: Makefile options:
-p : List old/obsolete -B : List packages marked as 'BROKEN'