ports-mgmt/portlint: Update to 2.19.12
In a discussion with members of the port managers team (tcberner, rene) the issue of conflicting package base names came up.
I have offered to create portlint checks for 2 possible Makefile issues:
1) Conflicting use of ${PKGBASE} of an existing port.
2) Multiple flavors resulting in the same ${PKGBASE}.
The attached patch adds checks for both possible issues:
1) Check for the existence of the new PKGBASE in the INDEX file (if present) and warn if it is used for a different ORIGIN.
2) Generate PKGBASE for all FLAVORS and check for duplicates.
PR: 263807
This commit is contained in:
committed by
Joe Marcus Clarke
parent
b396608f52
commit
415d07a06f
@@ -1,7 +1,7 @@
|
||||
# Created by: Jun-ichiro itojun Hagino <itojun@itojun.org>
|
||||
|
||||
PORTNAME= portlint
|
||||
PORTVERSION= 2.19.11
|
||||
PORTVERSION= 2.19.12
|
||||
CATEGORIES= ports-mgmt
|
||||
MASTER_SITES= # none
|
||||
DISTFILES= # none
|
||||
|
||||
@@ -49,7 +49,7 @@ $portdir = '.';
|
||||
# version variables
|
||||
my $major = 2;
|
||||
my $minor = 19;
|
||||
my $micro = 11;
|
||||
my $micro = 12;
|
||||
|
||||
# default setting - for FreeBSD
|
||||
my $portsdir = '/usr/ports';
|
||||
@@ -1364,6 +1364,7 @@ sub checkmakefile {
|
||||
my $use_ant = 0;
|
||||
my($realwrksrc, $wrksrc, $nowrksubdir) = ('', '', '');
|
||||
my(@mman, @pman);
|
||||
my(@aopt, @mopt, @opt);
|
||||
my($pkg_version, $versiondir, $versionfile) = ('', '', '');
|
||||
my $indexfile = '';
|
||||
my $useindex = 0;
|
||||
@@ -3013,10 +3014,11 @@ DIST_SUBDIR EXTRACT_ONLY
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$versiondir = $ENV{VERSIONDIR} // '/var/db/chkversion';
|
||||
|
||||
$indexfile = "$portsdir/$makevar{INDEXFILE}";
|
||||
$versionfile = "$versiondir/VERSIONS";
|
||||
$versionfile = "$versiondir/VERSIONS";
|
||||
$useindex = !-r "$versionfile";
|
||||
|
||||
$versionfile = $indexfile
|
||||
@@ -3054,6 +3056,42 @@ DIST_SUBDIR EXTRACT_ONLY
|
||||
last;
|
||||
}
|
||||
}
|
||||
close VERSIONS;
|
||||
}
|
||||
|
||||
# use INDEX (if present) to check for PKGBASE collisions
|
||||
if (-r "$indexfile") {
|
||||
open INDEX, "<$portsdir/$makevar{INDEXFILE}";
|
||||
while (<INDEX>) {
|
||||
my($origin, $pkgbase) = ('', '');
|
||||
chomp;
|
||||
next if /^(#|$)/;
|
||||
($pkgbase, $origin) = split /\|/;
|
||||
$pkgbase =~ s,-[^-]+$,,;
|
||||
$origin =~ s,^.*/([^/]+/[^/]+)/?$,$1,;
|
||||
if ($pkgbase eq $makevar{PKGBASE} and $origin ne $makevar{PKGORIGIN}) {
|
||||
&perror("FATAL", $file, -1, "The package base name \"$makevar{PKGBASE}\" is already in use by the \"$origin\" port. ".
|
||||
"Choose another PORTNAME or use a PKGNAMEPREFIX or PKGNAMESUFFIX.");
|
||||
}
|
||||
}
|
||||
close INDEX;
|
||||
}
|
||||
|
||||
# verify that all flavors have distinct names
|
||||
if ($makevar{FLAVORS}) {
|
||||
my %PKGFLAVOR;
|
||||
my @FLAVORS = split(/ /, $makevar{FLAVORS});
|
||||
my $makeenv_save = $makeenv;
|
||||
for my $flavor (@FLAVORS) {
|
||||
$makeenv = $makeenv_save . " FLAVOR=$flavor";
|
||||
my $pkgbase = &get_makevar("PKGBASE");
|
||||
if ($PKGFLAVOR{$pkgbase}) {
|
||||
&perror("FATAL", $file, -1, "The flavors \"$PKGFLAVOR{$pkgbase}\" and \"$flavor\" both generate a package named \"$pkgbase\". ".
|
||||
"Make the package names unique, e.g., with different PKGNAMEPREFIX or PKGNAMESUFFIX values for each flavor.");
|
||||
} else {
|
||||
$PKGFLAVOR{$pkgbase} = $flavor;
|
||||
}
|
||||
}
|
||||
my $makeenv = $makeenv_save;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user