Date: Sun, 24 Aug 2003 21:16:53 +1000 (EST) From: Edwin Groothuis <edwin@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/55921: [patch] add some pkg-plist checking to devel/portlint Message-ID: <20030824111653.F29926A7101@k7.mavetju> Resent-Message-ID: <200308241120.h7OBKEGF049131@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 55921 >Category: ports >Synopsis: [patch] add some pkg-plist checking to devel/portlint >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Aug 24 04:20:13 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Edwin Groothuis >Release: FreeBSD 4.8-RELEASE i386 >Organization: - >Environment: System: FreeBSD k7.mavetju 4.8-RELEASE FreeBSD 4.8-RELEASE #0: Sun Aug 17 16:04:25 EST 2003 edwin@k7.mavetju:/usr/src/sys/compile/k7 i386 >Description: Add some checking to portlint for the pkg-plist files: - "@unexec rm " should have a %D in it to specify the prefix - "@unexec rm " should have a redirection and or to true in it - "@unexec rmdir" should have a %D in it to specify the prefix >How-To-Repeat: [/usr/ports/net/dhcpdump] root@k7>cat pkg-plist @unexec rm lib/xmms/General/libinfopipe.so @unexec rm %D/lib/xmms/General/libinfopipe-1.3.so @unexec rm %D/lib/xmms/General/libinfopipe-1.3.so 2>&1 >/dev/null || true @unexec rmdir lib/xmms/General/libinfopipe.so @unexec rmdir %D/lib/xmms/General/libinfopipe.so [/usr/ports/net/dhcpdump] root@k7>portlint -a WARN: pkg-plist:1 use "%D" to specify prefix. WARN: pkg-plist:1 add "2>&1 >/dev/null || true" to "@unexec rm". WARN: pkg-plist:2 add "2>&1 >/dev/null || true" to "@unexec rm". WARN: pkg-plist:4 use "%D" to specify prefix. WARN: pkg-plist:5 use "@dirrm" instead of "@unexec rmdir". WARN: pkg-plist:5 use "@dirrm" instead of "@unexec rmdir". >Fix: --- /usr/local/bin/portlint.orig Sun Aug 24 21:11:11 2003 +++ /usr/local/bin/portlint Sun Aug 24 21:10:53 2003 @@ -444,9 +444,21 @@ if ($_ =~ /^\@/) { if ($_ =~ /^\@(cwd|cd)[ \t]+(\S+)/) { $curdir = $2; + } elsif ($_ =~ /^\@unexec[ \t]+rm[ \t]/) { + if ($_ !~ /%D/) { + &perror("WARN: pkg-plist:$. use \"%D\" to specify prefix."); + } + if ($_ !~ /true$/) { + &perror("WARN: pkg-plist:$. add \"2>&1 ". + ">/dev/null || true\" ". + "to \"\@unexec rm\"."); + } } elsif ($_ =~ /^\@unexec[ \t]+rmdir/) { + if ($_ !~ /%D/) { + &perror("WARN: pkg-plist:$. use \"%D\" to specify prefix."); + } if ($_ !~ /true$/) { - &perror("WARN: use \"\@dirrm\" ". + &perror("WARN: pkg-plist:$. use \"\@dirrm\" ". "instead of \"\@unexec rmdir\"."); } } elsif ($_ =~ /^\@exec[ \t]+scrollkeeper-install[ \t]+-q\s+(\S+)\s+.+$/) { >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030824111653.F29926A7101>