diff options
Diffstat (limited to 'mk/plist/plist-info.awk')
-rw-r--r-- | mk/plist/plist-info.awk | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/mk/plist/plist-info.awk b/mk/plist/plist-info.awk index f6c4c593b0c..bf298d62185 100644 --- a/mk/plist/plist-info.awk +++ b/mk/plist/plist-info.awk @@ -1,4 +1,4 @@ -# $NetBSD: plist-info.awk,v 1.9 2006/03/14 23:16:01 jlam Exp $ +# $NetBSD: plist-info.awk,v 1.10 2006/03/20 01:48:58 jlam Exp $ # # Copyright (c) 2006 The NetBSD Foundation, Inc. # All rights reserved. @@ -44,7 +44,7 @@ ### IGNORE_INFO_PATH is a colon-separated list of ${PREFIX}-relative paths ### that do *not* contain info files. ### -### INFO_DIR is the ${PREFIX}-relative path to the installed info pages. +### PKGINFODIR is the ${PREFIX}-relative path to the installed info pages. ### ### LS is the path to the "ls" binary. ### @@ -57,7 +57,7 @@ ### the path to a "test" binary. ### BEGIN { - INFO_DIR = ENVIRON["INFO_DIR"] ? ENVIRON["INFO_DIR"] : "info" + PKGINFODIR = ENVIRON["PKGINFODIR"] ? ENVIRON["PKGINFODIR"] : "info" LS = ENVIRON["LS"] ? ENVIRON["LS"] : "ls" MANZ = ENVIRON["MANZ"] ? ENVIRON["MANZ"] : "no" PREFIX = ENVIRON["PREFIX"] ? ENVIRON["PREFIX"] : "/usr/pkg" @@ -69,46 +69,41 @@ BEGIN { } ### -### Canonicalize info page entries by stripping any ".gz" suffixes. +### Canonicalize info page entries by converting ${PKGINFODIR}/ to info/. ### /^[^@]/ && ($0 !~ "^" IGNORE_INFO_REGEXP "/") && \ -/^([^\/]*\/)*info\/[^\/]*(\.info)?-[0-9]+\.gz$/ { - sub("\\.gz$", "") +($0 ~ "^" PKGINFODIR "\/[^\/]+(\.info)?(-[0-9]+)?(\.gz)?$") { + sub("^" PKGINFODIR "/", "info/") +} +($0 !~ "^@dirrm " IGNORE_INFO_REGEXP "$") && \ +($0 ~ "^@dirrm " PKGINFODIR "$") { + sub(PKGINFODIR "$", "info") } ### -### Ignore *-1, *-2, etc. files in the PLIST as we get the list of -### installed split files below. +### Canonicalize info page entries by stripping any ".gz" suffixes. ### /^[^@]/ && ($0 !~ "^" IGNORE_INFO_REGEXP "/") && \ -/^([^\/]*\/)*info\/[^\/]*(\.info)?-[0-9]+$/ { - next +/^([^\/]*\/)*(info\/[^\/]+(\.info)?|[^\/]+\.info)(-[0-9]+)?\.gz$/ { + sub("\.gz$", "") } ### -### Convert info/ to ${INFO_DIR}/ for all info page entries. +### Ignore *-1, *-2, etc. files in the PLIST as we get the list of +### installed split files below. ### /^[^@]/ && ($0 !~ "^" IGNORE_INFO_REGEXP "/") && \ -($0 !~ "^([^\/]*\/)*" INFO_DIR "\/[^\/]*(\.info)?$") && \ -/^([^\/]*\/)*info\/[^\/]*(\.info)?$/ { - if ($0 ~ "^info/") { - sub("^info/", INFO_DIR "/") - } else { - sub("/info/", "/" INFO_DIR "/") - } -} -($0 !~ "^@dirrm " IGNORE_INFO_REGEXP "$") && \ -($0 !~ "^@dirrm " INFO_DIR "$") && \ -/^@dirrm ([^\/]*\/)*info$/ { - sub("info$", INFO_DIR) +/^([^\/]*\/)*(info\/[^\/]+(\.info)?|[^\/]+\.info)-[0-9]+$/ { + next } ### -### For each info page entry, print all of the installed info sub-pages -### associated with that entry. +### For each info page entry, convert any info/ to ${PKGINFODIR}/ and print +### all of the installed info sub-pages associated with that entry. ### /^[^@]/ && ($0 !~ "^" IGNORE_INFO_REGEXP "/") && \ -($0 ~ "^([^\/]*\/)*" INFO_DIR "\/[^\/]*(\.info)?$") { +/^([^\/]*\/)*(info\/[^\/]+(\.info)?|[^\/]+\.info)$/ { + sub("^info/", PKGINFODIR "/") cmd = TEST " -f " PREFIX "/" $0 " -o -f " PREFIX "/" $0 ".gz" if (system(cmd) == 0) { base = $0 @@ -129,3 +124,7 @@ BEGIN { } next } +($0 !~ "^@dirrm " IGNORE_INFO_REGEXP "$") && \ +($0 ~ "^@dirrm info$") { + sub("info$", PKGINFODIR) +} |