summaryrefslogtreecommitdiff
path: root/mk/plist
diff options
context:
space:
mode:
authorjperkin <jperkin>2015-10-07 09:56:14 +0000
committerjperkin <jperkin>2015-10-07 09:56:14 +0000
commitd7b887cc64cbc3465c9a6d93dff595dcd8470a11 (patch)
treee9d4c71d07d86f8fa3d01038feb0de5e82936b76 /mk/plist
parent0b96729855b6294efbac4d2820565c9ef9fe40d7 (diff)
downloadpkgsrc-d7b887cc64cbc3465c9a6d93dff595dcd8470a11.tar.gz
Support .3am (lang/gawk) and .3f (math/udunits) cat/man page suffixes, fixing
builds with PKGMANDIR=share/man for those packages. Put the regexes into variables to make it easier to add more in the future.
Diffstat (limited to 'mk/plist')
-rw-r--r--mk/plist/plist-man.awk29
1 files changed, 12 insertions, 17 deletions
diff --git a/mk/plist/plist-man.awk b/mk/plist/plist-man.awk
index 46d338cd7b7..ccd61fd7c5a 100644
--- a/mk/plist/plist-man.awk
+++ b/mk/plist/plist-man.awk
@@ -1,4 +1,4 @@
-# $NetBSD: plist-man.awk,v 1.9 2013/09/12 11:01:47 jperkin Exp $
+# $NetBSD: plist-man.awk,v 1.10 2015/10/07 09:56:14 jperkin Exp $
#
# Copyright (c) 2006 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -76,13 +76,15 @@ BEGIN {
MANZ = getenv("MANZ", "no")
PKGMANDIR = getenv("PKGMANDIR", "man")
CATMAN_SECTION_SUFFIX = getenv("CATMAN_SECTION_SUFFIX", "no")
+ CATPAGE_REGEX = "cat[1-9ln](am|f)?/[^/]*\\.[0-9ln](am|f)?"
+ MANPAGE_REGEX = "man[1-9ln](am|f)?/[^/]*\\.[1-9ln](am|f)?"
+ CATORMAN_REGEX = "(" MANPAGE_REGEX "|" CATPAGE_REGEX ")"
}
###
### Canonicalize man page entries by stripping any ".gz" suffixes.
###
-/^[^@]/ && \
-/^([^\/]*\/)+(man[1-9ln]\/[^\/]*\.[1-9ln]|cat[1-9ln]\/[^\/]*\.[0-9])\.gz$/ {
+/^[^@]/ && $0 ~ "^([^/]*/)+" CATORMAN_REGEX "\\.gz$" {
sub("\\.gz$", "")
}
@@ -90,8 +92,7 @@ BEGIN {
### Rewrite "imake-installed" catman pages as man pages if imake only
### supports man pages.
###
-(IMAKE_MANINSTALL == "maninstall") && /^[^@]/ && \
-/^([^\/]*\/)+cat[1-9ln]\/[^\/]*\.[0-9ln]$/ {
+(IMAKE_MANINSTALL == "maninstall") && /^[^@]/ && $0 ~ "^([^/]*/)+" CATPAGE_REGEX "$" {
n = split($0, components, "/")
sub("cat", "man", components[n-1])
section = substr(components[n-1], 4, 1)
@@ -103,8 +104,7 @@ BEGIN {
### Rewrite "imake-installed" man pages as catman pages if imake only
### supports catman pages.
###
-(IMAKE_MANINSTALL == "catinstall") && /^[^@]/ && \
-/^([^\/]*\/)+man[1-9ln]\/[^\/]*\.[0-9ln]$/ {
+(IMAKE_MANINSTALL == "catinstall") && /^[^@]/ && $0 ~ "^([^/]*/)+" MANPAGE_REGEX "$" {
n = split($0, components, "/")
sub("man", "cat", components[n-1])
if (CATMAN_SECTION_SUFFIX ~ /[yY][eE][sS]/) {
@@ -121,12 +121,10 @@ BEGIN {
### entries from the PLIST, and similarly for "catinstall" and catman page
### entries.
###
-(MANINSTALL !~ /catinstall/) && /^[^@]/ && \
-/^([^\/]*\/)+cat[1-9ln]\/[^\/]*\.[0-9ln]$/ {
+(MANINSTALL !~ /catinstall/) && /^[^@]/ && $0 ~ "^([^/]*/)+" CATPAGE_REGEX "$" {
next
}
-(MANINSTALL !~ /maninstall/) && /^[^@]/ && \
-/^([^\/]*\/)+man[1-9ln]\/[^\/]*\.[0-9ln]$/ {
+(MANINSTALL !~ /maninstall/) && /^[^@]/ && $0 ~ "^([^/]*/)+" MANPAGE_REGEX "$" {
next
}
@@ -134,24 +132,21 @@ BEGIN {
### Append ".gz" to the end of man page entries if compressed pages are
### requested.
###
-(MANZ ~ /[yY][eE][sS]/) && /^[^@]/ && \
-/^([^\/]*\/)+(man[1-9ln]\/[^\/]*\.[1-9ln]|cat[1-9ln]\/[^\/]*\.[0-9])$/ {
+(MANZ ~ /[yY][eE][sS]/) && /^[^@]/ && $0 ~ "^([^/]*/)+" CATORMAN_REGEX "$" {
$0 = $0 ".gz"
}
###
### Convert man/ to ${PKGMANDIR}/ for all man and catman page entries.
###
-/^[^@]/ && \
-/^man\/([^\/]*\/)?(man[1-9ln]\/[^\/]*\.[1-9ln]|cat[1-9ln]\/[^\/]*\.[0-9])/ {
+/^[^@]/ && $0 ~ "^man/([^/]*/)?" CATORMAN_REGEX {
sub("^man/", PKGMANDIR "/")
}
###
### Fixup catman entries to use section suffixes if required.
###
-(CATMAN_SECTION_SUFFIX ~ /[yY][eE][sS]/)&& /^[^@]/ && \
-/^man\/([^\/]*\/)?(cat[1-9ln]\/[^\/]*\.[0-9])/ {
+(CATMAN_SECTION_SUFFIX ~ /[yY][eE][sS]/)&& /^[^@]/ && $0 ~ "^man/([^/]*/)?" CATPAGE_REGEX {
n = split($0, components, "/")
sub("^cat", "", components[n-1])
sub("0$", components[n-1], $0)