[Midnightbsd-cvs] mports: ports-mgmt/portlint: * Consolidate lines that end in a '\'

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sat Sep 13 16:42:04 EDT 2008


Log Message:
-----------
* Consolidate lines that end in a '\' followed by an empty line into one
  newline prior to splitting the Makefile into sections.  This will more
  properly catch section-related errors [1]
* Properly check pkg-config files when they contain an embedded '.' [2]
* Allow pkg-plist directive @cwd by itself which means to change the working
  directory back to the original PREFIX [3]
* Beef up the warnings around DOCSDIR, EXAMPLESDIR, and DATADIR so that
  users don't just use these macros without knowing if they are safe [3]
* Check for use of --mandir and --infodir [4]
* Allow the @stopdaemon plist directive. [1]
* Fix a typo when checking for proper use of DOCSDIR. [2]
* USE_JAVA is okay to use after including bsd.port.pre.mk. [3]
* Properly check for extra items in the PATCH_SITES section. [4]
* Replace all instances of "IFF" with "If and only if" to be clearer for
  non-English speaking, non-math geeks. [5]
* Allow comments to start with a '[' (e.g. [X]Emacs).

Modified Files:
--------------
    mports/ports-mgmt/portlint:
        Makefile (r1.6 -> r1.7)
    mports/ports-mgmt/portlint/src:
        portlint.pl (r1.5 -> r1.6)

-------------- next part --------------
Index: Makefile
===================================================================
RCS file: /home/cvs/mports/ports-mgmt/portlint/Makefile,v
retrieving revision 1.6
retrieving revision 1.7
diff -L ports-mgmt/portlint/Makefile -L ports-mgmt/portlint/Makefile -u -r1.6 -r1.7
--- ports-mgmt/portlint/Makefile
+++ ports-mgmt/portlint/Makefile
@@ -9,7 +9,7 @@
 #
 
 PORTNAME=	portlint
-PORTVERSION=	2.9.4
+PORTVERSION=	2.9.7
 CATEGORIES=	ports-mgmt
 MASTER_SITES=	# none
 DISTFILES=	# none
Index: portlint.pl
===================================================================
RCS file: /home/cvs/mports/ports-mgmt/portlint/src/portlint.pl,v
retrieving revision 1.5
retrieving revision 1.6
diff -L ports-mgmt/portlint/src/portlint.pl -L ports-mgmt/portlint/src/portlint.pl -u -r1.5 -r1.6
--- ports-mgmt/portlint/src/portlint.pl
+++ ports-mgmt/portlint/src/portlint.pl
@@ -47,7 +47,7 @@
 # version variables
 my $major = 2;
 my $minor = 9;
-my $micro = 4;
+my $micro = 7;
 
 sub l { '[{(]'; }
 sub r { '[)}]'; }
@@ -189,6 +189,7 @@
 	INDEXFILE PKGORIGIN CONFLICTS PKG_VERSION PKGINSTALLVER
 	PLIST_FILES OPTIONS INSTALLS_OMF USE_GETTEXT USE_RC_SUBR
 	DIST_SUBDIR ALLFILES IGNOREFILES CHECKSUM_ALGORITHMS INSTALLS_ICONS
+	GNU_CONFIGURE CONFIGURE_ARGS
 );
 
 my $cmd = join(' -V ', "make $makeenv MASTER_SITE_BACKUP=''", @varlist);
@@ -745,8 +746,11 @@
 				$rcsidseen++ if (/\$$rcsidstr[:\$]/);
 			} elsif ($_ =~ /^\@(owner|group|mode)\s/) {
 				&perror("WARN", $file, $., "\@$1 should not be needed");
-			} elsif ($_ =~ /^\@(dirrm|option)/) {
+			} elsif ($_ =~ /^\@(dirrm|option|stopdaemon)/) {
 				; # no check made
+			} elsif ($_ eq "\@cwd") {
+				; # @cwd by itself means change directory back to the original
+				  # PREFIX.
 			} else {
 				&perror("WARN", $file, $.,
 					"unknown pkg-plist directive \"$_\"");
@@ -775,7 +779,7 @@
 				"for more details.");
 		}
 
-		if ($_ =~ m|lib/pkgconfig/[^\.]+.pc$|) {
+		if ($_ =~ m|lib/pkgconfig/[^\/]+.pc$|) {
 			&perror("FATAL", $file, $., "installing pkg-config files into ".
 				"lib/pkgconfig.  All pkg-config files must be installed ".
 				"into libdata/pkgconfig for them to be found by pkg-config.");
@@ -831,20 +835,35 @@
 		}
 
 		if ($_ =~ /^(\%\%PORTDOCS\%\%)?share\/doc\//) {
-			&perror("WARN", $file, $., "consider using DOCSDIR macro");
+			&perror("WARN", $file, $., "If and only if your port is ".
+					"DOCSDIR-safe (that is, a user can override DOCSDIR ".
+					"when building this port and the port will still work ".
+					"correctly) consider using DOCSDIR macro; if you are ".
+					"unsure if this this port is DOCSDIR-safe, then ignore ".
+					"this warning");
 			$sharedocused++;
 		} elsif ($_ =~ /^(\%\%PORTDOCS\%\%)?\%\%DOCSDIR\%\%/) {
 			$sharedocused++;
 		}
 
 		if ($_ =~ /^share\/examples\//) {
-			&perror("WARN", $file, $., "consider using EXAMPLESDIR macro");
+			&perror("WARN", $file, $., "If and only if your port is ".
+				"EXAMPLESDIR-safe (that is, a user can override EXAMPLESDIR ".
+				"when building this port and the port will still work ".
+				"correctly) consider using EXAMPLESDIR macro; if you are ".
+				"unsure if this port is EXAMPLESDIR-safe, then ignore this ".
+				"warning");
 		}
 
 		{
 			my $tmpportname = quotemeta($makevar{PORTNAME});
 			if ($_ =~ /^share\/$tmpportname\//) {
-				&perror("WARN", $file, $., "consider using DATADIR macro");
+				&perror("WARN", $file, $., "If and only if your port is ".
+					"DATADIR-safe (that is, a user can override DATADIR when ".
+					"building this port and the port will still work ".
+					"correctly) consider using DATADIR macro; if you are ".
+					"unsure if this port is DATADIR-safe, then ignore this ".
+					"warning");
 			}
 		}
 
@@ -1183,7 +1202,6 @@
 			BZIP2
 			GNUSTEP
 			IMAKE
-			JAVA
 			KDE(?:BASE|LIBS)_VER
 			(?:LIB)?RUBY
 			LINUX_PREFIX
@@ -1665,6 +1683,15 @@
 	}
 
 	#
+	# whole file: check for --mandir and --infodir when GNU_CONFIGURE
+	#
+	if ($makevar{GNU_CONFIGURE} ne '' &&
+		$makevar{CONFIGURE_ARGS} =~ /(man|info)dir/) {
+		&perror("WARN", $file, -1, "--mandir and --infodir are not needed ".
+			"in CONFIGURE_ARGS as they are already set in bsd.port.mk");
+	}
+
+	#
 	# slave port check
 	#
 	my $masterdir = $makevar{MASTERDIR};
@@ -1710,6 +1737,7 @@
 	$tmp = $rawwhole;
 	# keep comment, blank line, comment in the same section
 	$tmp =~ s/(#.*\n)\n+(#.*)/$1$2/g;
+	$tmp =~ s/\\\n\n/\n/g;
 	@sections = split(/\n\n+/, $tmp);
 	for ($i = 0; $i <= $#sections; $i++) {
 		if ($sections[$i] !~ /\n$/) {
@@ -2192,21 +2220,21 @@
 	if ($tmp =~ /(PATCH_SITES|PATCH_SITE_SUBDIR|PATCHFILES|PATCH_DIST_STRIP)/) {
 		&checkearlier($file, $tmp, @varnames);
 
-		if ($tmp =~ /^PATCH_SITES=/) {
+		if ($tmp =~ /PATCH_SITES[?+]?=[^\n]+\n/) {
 			print "OK: seen PATCH_SITES.\n" if ($verbose);
-			$tmp =~ s/^[^\n]+\n//;
+			$tmp =~ s/PATCH_SITES[?+]?=[^\n]+\n//;
 		}
-		if ($tmp =~ /^PATCH_SITE_SUBDIR=/) {
+		if ($tmp =~ /PATCH_SITE_SUBDIR[?+]?=[^\n]+\n/) {
 			print "OK: seen PATCH_SITE_SUBDIR.\n" if ($verbose);
-			$tmp =~ s/^[^\n]+\n//;
+			$tmp =~ s/PATCH_SITE_SUBDIR[?+]?=[^\n]+\n//;
 		}
-		if ($tmp =~ /^PATCHFILES=/) {
+		if ($tmp =~ /PATCHFILES[?+]?=[^\n]+\n/) {
 			print "OK: seen PATCHFILES.\n" if ($verbose);
-			$tmp =~ s/^[^\n]+\n//;
+			$tmp =~ s/PATCHFILES[?+]?=[^\n]+\n//;
 		}
-		if ($tmp =~ /^PATCH_DIST_STRIP=/) {
+		if ($tmp =~ /PATCH_DIST_STRIP[?+]?=[^\n]+\n/) {
 			print "OK: seen PATCH_DIST_STRIP.\n" if ($verbose);
-			$tmp =~ s/^[^\n]+\n//;
+			$tmp =~ s/PATCH_DIST_STRIP[?+]?=[^\n]+\n//;
 		}
 
 		&checkextra($tmp, 'PATCH_SITES', $file);
@@ -2258,7 +2286,7 @@
 		&perror("WARN", $file, -1, "unless this is a master port, COMMENT has to be set by \"=\", ".
 			"not by \"$1=\".") unless ($masterport);
 	} else { # check for correctness
-		if (($makevar{COMMENT} !~ /^["0-9A-Z]/) || ($makevar{COMMENT} =~ m/\.$/)) { #"
+		if (($makevar{COMMENT} !~ /^["\[0-9A-Z]/) || ($makevar{COMMENT} =~ m/\.$/)) { #"
 			&perror("WARN", $file, -1, "COMMENT should begin with a capital, and end without a period");
 		} elsif (length($makevar{COMMENT}) > 70) {
 			&perror("WARN", $file, -1, "COMMENT exceeds 70 characters limit.");
@@ -2444,6 +2472,7 @@
 				}
 			}
 		}
+
 		foreach my $i (@linestocheck) {
 			$tmp =~ s/$i[?+]?=[^\n]+\n//g;
 		}


More information about the Midnightbsd-cvs mailing list