| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | # $NetBSD: plist-man.awk,v 1.10 2015/10/07 09:56:14 jperkin Exp $ | | 1 | # $NetBSD: plist-man.awk,v 1.11 2016/04/11 12:29:53 jperkin Exp $ |
2 | # | | 2 | # |
3 | # Copyright (c) 2006 The NetBSD Foundation, Inc. | | 3 | # Copyright (c) 2006 The NetBSD Foundation, Inc. |
4 | # All rights reserved. | | 4 | # All rights reserved. |
5 | # | | 5 | # |
6 | # This code is derived from software contributed to The NetBSD Foundation | | 6 | # This code is derived from software contributed to The NetBSD Foundation |
7 | # by Johnny C. Lam. | | 7 | # by Johnny C. Lam. |
8 | # | | 8 | # |
9 | # Redistribution and use in source and binary forms, with or without | | 9 | # Redistribution and use in source and binary forms, with or without |
10 | # modification, are permitted provided that the following conditions | | 10 | # modification, are permitted provided that the following conditions |
11 | # are met: | | 11 | # are met: |
12 | # 1. Redistributions of source code must retain the above copyright | | 12 | # 1. Redistributions of source code must retain the above copyright |
13 | # notice, this list of conditions and the following disclaimer. | | 13 | # notice, this list of conditions and the following disclaimer. |
14 | # 2. Redistributions in binary form must reproduce the above copyright | | 14 | # 2. Redistributions in binary form must reproduce the above copyright |
| @@ -119,35 +119,35 @@ BEGIN { | | | @@ -119,35 +119,35 @@ BEGIN { |
119 | ### | | 119 | ### |
120 | ### If MANINSTALL doesn't contain "maninstall", then strip out man page | | 120 | ### If MANINSTALL doesn't contain "maninstall", then strip out man page |
121 | ### entries from the PLIST, and similarly for "catinstall" and catman page | | 121 | ### entries from the PLIST, and similarly for "catinstall" and catman page |
122 | ### entries. | | 122 | ### entries. |
123 | ### | | 123 | ### |
124 | (MANINSTALL !~ /catinstall/) && /^[^@]/ && $0 ~ "^([^/]*/)+" CATPAGE_REGEX "$" { | | 124 | (MANINSTALL !~ /catinstall/) && /^[^@]/ && $0 ~ "^([^/]*/)+" CATPAGE_REGEX "$" { |
125 | next | | 125 | next |
126 | } | | 126 | } |
127 | (MANINSTALL !~ /maninstall/) && /^[^@]/ && $0 ~ "^([^/]*/)+" MANPAGE_REGEX "$" { | | 127 | (MANINSTALL !~ /maninstall/) && /^[^@]/ && $0 ~ "^([^/]*/)+" MANPAGE_REGEX "$" { |
128 | next | | 128 | next |
129 | } | | 129 | } |
130 | | | 130 | |
131 | ### | | 131 | ### |
132 | ### Append ".gz" to the end of man page entries if compressed pages are | | 132 | ### Fixup catman entries to use section suffixes if required. |
133 | ### requested. | | | |
134 | ### | | 133 | ### |
135 | (MANZ ~ /[yY][eE][sS]/) && /^[^@]/ && $0 ~ "^([^/]*/)+" CATORMAN_REGEX "$" { | | 134 | (CATMAN_SECTION_SUFFIX ~ /[yY][eE][sS]/)&& /^[^@]/ && $0 ~ "^man/([^/]*/)?" CATPAGE_REGEX { |
136 | $0 = $0 ".gz" | | 135 | n = split($0, components, "/") |
| | | 136 | sub("^cat", "", components[n-1]) |
| | | 137 | sub("0$", components[n-1], $0) |
137 | } | | 138 | } |
138 | | | 139 | |
139 | ### | | 140 | ### |
140 | ### Convert man/ to ${PKGMANDIR}/ for all man and catman page entries. | | 141 | ### Convert man/ to ${PKGMANDIR}/ for all man and catman page entries. |
141 | ### | | 142 | ### |
142 | /^[^@]/ && $0 ~ "^man/([^/]*/)?" CATORMAN_REGEX { | | 143 | /^[^@]/ && $0 ~ "^man/([^/]*/)?" CATORMAN_REGEX { |
143 | sub("^man/", PKGMANDIR "/") | | 144 | sub("^man/", PKGMANDIR "/") |
144 | } | | 145 | } |
145 | | | 146 | |
146 | ### | | 147 | ### |
147 | ### Fixup catman entries to use section suffixes if required. | | 148 | ### Append ".gz" to the end of man page entries if compressed pages are |
| | | 149 | ### requested. |
148 | ### | | 150 | ### |
149 | (CATMAN_SECTION_SUFFIX ~ /[yY][eE][sS]/)&& /^[^@]/ && $0 ~ "^man/([^/]*/)?" CATPAGE_REGEX { | | 151 | (MANZ ~ /[yY][eE][sS]/) && /^[^@]/ && $0 ~ "^([^/]*/)+" CATORMAN_REGEX "$" { |
150 | n = split($0, components, "/") | | 152 | $0 = $0 ".gz" |
151 | sub("^cat", "", components[n-1]) | | | |
152 | sub("0$", components[n-1], $0) | | | |
153 | } | | 153 | } |