Skip to content

Commit

Permalink
- add "-M path" option to allow specifying a distfiles directory to h…
Browse files Browse the repository at this point in the history
…andle cases

  where PKGSRC/distfiles isn't the correct location (like on ftp.netbsd.org).

- document the option.

- bump minor version number.
  • Loading branch information
dmcmahill committed May 29, 2000
1 parent 065b712 commit 4397a68
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
4 changes: 2 additions & 2 deletions pkgtools/pkglint/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# $NetBSD: Makefile,v 1.48 2000/05/16 11:41:07 abs Exp $
# $NetBSD: Makefile,v 1.49 2000/05/29 19:44:27 dmcmahill Exp $
#

DISTNAME= pkglint-2.07
DISTNAME= pkglint-2.08
CATEGORIES= pkgtools devel
MASTER_SITES= # empty
DISTFILES= # empty
Expand Down
4 changes: 3 additions & 1 deletion pkgtools/pkglint/files/lintpkgsrc.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.\" $NetBSD: lintpkgsrc.1,v 1.9 2000/01/19 13:59:22 abs Exp $
.\" $NetBSD: lintpkgsrc.1,v 1.10 2000/05/29 19:44:28 dmcmahill Exp $
.\"
.\" Copyright (c) 1999 by David Brownlee ([email protected])
.\" Absolutely no warranty.
Expand Down Expand Up @@ -30,6 +30,8 @@ Parse Makefiles and output contents (Useful for debugging).
Set basedir for binary packages, otherwise PKGSRCDIR/packages is used.
.It Fl L
List the filenames of Makefiles as they are parsed (for debugging).
.It Fl M Ar distdir
Set basedir for distfiles, otherwise PKGSRCDIR/distfiles is used.
.It Fl P Ar pkgsrcdir
Set pkgsrcdir - otherwise
.Pa /etc/mk.conf
Expand Down
20 changes: 14 additions & 6 deletions pkgtools/pkglint/files/lintpkgsrc.pl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env perl

# $NetBSD: lintpkgsrc.pl,v 1.24 2000/05/16 11:41:08 abs Exp $
# $NetBSD: lintpkgsrc.pl,v 1.25 2000/05/29 19:44:28 dmcmahill Exp $

# Written by David Brownlee <[email protected]>.
#
Expand All @@ -18,6 +18,7 @@
use Getopt::Std;
use File::Find;
my( $pkgsrcdir, # Base of pkgsrc tree
$pkgdistdir, # Distfiles directory
%pkgver2dir, # Map package-version to category/pkgname
%pkg2ver, # Map pkgname to version
%pkgrestricted, # RESTRICTED/LICENCE packages, by pkgname
Expand All @@ -29,7 +30,7 @@

$ENV{PATH} .= ':/usr/sbin';

if (! &getopts('DK:LP:Rdhilmopru', \%opt) || $opt{'h'} ||
if (! &getopts('DK:LM:P:Rdhilmopru', \%opt) || $opt{'h'} ||
! ( defined($opt{'d'}) || defined($opt{'i'}) || defined($opt{'l'}) ||
defined($opt{'m'}) || defined($opt{'o'}) || defined($opt{'p'}) ||
defined($opt{'r'}) || defined($opt{'u'}) || defined($opt{'D'}) ||
Expand Down Expand Up @@ -63,6 +64,12 @@
else
{ $pkgsrcdir = &set_pkgsrcdir; } # Check /etc/mk.conf for PKGSRCDIR

if ($opt{'M'})
{ $pkgdistdir = $opt{'M'}; } # override distfile dir
else
{ $pkgdistdir = "$pkgsrcdir/distfiles"; } # default


if ($opt{'r'} && !$opt{'o'} && !$opt{'m'} && !$opt{'p'})
{ $opt{'o'} = $opt{'m'} = $opt{'p'} = 1; }
if ($opt{'o'} || $opt{'m'})
Expand All @@ -73,7 +80,7 @@
$opt{'m'});
if ($opt{'r'})
{
&safe_chdir("$pkgsrcdir/distfiles");
&safe_chdir("$pkgdistdir");
&verbose("Unlinking 'bad' distfiles\n");
foreach (@baddist)
{ unlink($_); }
Expand Down Expand Up @@ -763,7 +770,7 @@ sub scan_pkgsrc_distfiles_vs_md5
}
&verbose(" ($numpkg packages)\n");

foreach $file (&listdir("$pkgsrcdir/distfiles"))
foreach $file (&listdir("$pkgdistdir"))
{
if (!defined($distfiles{$file}))
{ push(@bad_distfiles, $file); }
Expand All @@ -773,7 +780,7 @@ sub scan_pkgsrc_distfiles_vs_md5
if ($check_unref && @bad_distfiles)
{
&verbose(scalar(@bad_distfiles),
" unreferenced file(s) in '$pkgsrcdir/distfiles':\n");
" unreferenced file(s) in '$pkgdistdir':\n");
print join("\n", sort @bad_distfiles), "\n";
}
if ($check_md5)
Expand All @@ -782,7 +789,7 @@ sub scan_pkgsrc_distfiles_vs_md5
{ &verbose(@distwarn); }
&verbose("md5 mismatches\n");
@distfiles = sort @distfiles;
&safe_chdir("$pkgsrcdir/distfiles");
&safe_chdir("$pkgdistdir");
open(MD5, "md5 @distfiles|") || &fail("Unable to run md5: $!");
while (<MD5>)
{
Expand Down Expand Up @@ -836,6 +843,7 @@ sub usage_and_exit
-L : List each Makefile when scanned
-P path : Set PKGSRCDIR
-K path : Set basedir for prebuild packages (default PKGSRCDIR/packages)
-M path : Set basedir for distfiles (default PKGSRCDIR/distfiles)
-D [paths] : Parse Makefiles and output contents (For debugging)
If pkgsrc is not in /usr/pkgsrc, set PKGSRCDIR in /etc/mk.conf
Expand Down

0 comments on commit 4397a68

Please sign in to comment.