-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add "-M path" option to allow specifying a distfiles directory to h…
…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
Showing
3 changed files
with
19 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]>. | ||
# | ||
|
@@ -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 | ||
|
@@ -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'}) || | ||
|
@@ -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'}) | ||
|
@@ -73,7 +80,7 @@ | |
$opt{'m'}); | ||
if ($opt{'r'}) | ||
{ | ||
&safe_chdir("$pkgsrcdir/distfiles"); | ||
&safe_chdir("$pkgdistdir"); | ||
&verbose("Unlinking 'bad' distfiles\n"); | ||
foreach (@baddist) | ||
{ unlink($_); } | ||
|
@@ -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); } | ||
|
@@ -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) | ||
|
@@ -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>) | ||
{ | ||
|
@@ -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 | ||
|