summaryrefslogtreecommitdiff
path: root/mk/scripts
diff options
context:
space:
mode:
authordmcmahill <dmcmahill>2003-07-24 22:27:16 +0000
committerdmcmahill <dmcmahill>2003-07-24 22:27:16 +0000
commit88176039da0086a904805aaccdde4d81ba8cc5f7 (patch)
treec73047b8aaab37942e893601a338268fd336d24b /mk/scripts
parent6849c9d542745ce0ffd564bcedc8e2d4a573dc5a (diff)
downloadpkgsrc-88176039da0086a904805aaccdde4d81ba8cc5f7.tar.gz
- add HOMEPAGE as the last field in the INDEX file.
- make the paths be relative to PKGSRCDIR as opposed to absolute. - some cleanup/simplification of the awk code.
Diffstat (limited to 'mk/scripts')
-rwxr-xr-xmk/scripts/genindex.awk50
1 files changed, 20 insertions, 30 deletions
diff --git a/mk/scripts/genindex.awk b/mk/scripts/genindex.awk
index b21fcc2cf41..b7ae234fd25 100755
--- a/mk/scripts/genindex.awk
+++ b/mk/scripts/genindex.awk
@@ -1,5 +1,5 @@
#!/usr/bin/awk -f
-# $NetBSD: genindex.awk,v 1.1 2003/07/23 09:41:29 dmcmahill Exp $
+# $NetBSD: genindex.awk,v 1.2 2003/07/24 22:27:17 dmcmahill Exp $
#
# Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -124,25 +124,22 @@ BEGIN {
}
/^categories /{
- dir = $2;
- gsub(/^categories[ \t]*/, "");
- tmp = substr($0, length($1) + 1);
- gsub(/^[ \t]*/, "", tmp);
- categories[dir] = tmp;
+ categories[$2] = substr($0, index($0, $3));
next;
}
/^comment /{
- dir = $2;
- gsub(/^comment[ \t]*/, "");
- tmp = substr($0, length($1) + 1);
- gsub(/^[ \t]*/, "", tmp);
- comment[dir] = tmp;
+ comment[$2] = substr($0, index($0, $3));
next;
}
/^descr /{
- descr[$2] = $3;
+ descr[$2] = substr($0, index($0, $3));
+ next;
+}
+
+/^homepage /{
+ homepage[$2] = substr($0, index($0, $3));
next;
}
@@ -163,40 +160,33 @@ BEGIN {
}
/^license /{
- license[$2] = $3;
+ license[$2] = substr($0, index($0, $3));
next;
}
/^maintainer /{
- maintainer[$2] = $3;
+ maintainer[$2] = substr($0, index($0, $3));
next;
}
/^notfor /{
- dir = $2;
- gsub(/^notfor[ \t]*/, "");
- tmp = substr($0, length($1) + 1);
- gsub(/^[ \t]*/, "", tmp);
- notfor[dir] = tmp;
+ notfor[$2] = substr($0, index($0, $3));
next;
}
/^onlyfor /{
- dir = $2;
- gsub(/^onlyfor[ \t]*/, "");
- tmp = substr($0, length($1) + 1);
- gsub(/^[ \t]*/, "", tmp);
- onlyfor[dir] = tmp;
+ onlyfor[$2] = substr($0, index($0, $3));
next;
}
/^prefix /{
- prefix[$2] = $3;
+ prefix[$2] = substr($0, index($0, $3));
next;
}
/^wildcard /{
- wildcard[$2] = $3;
+ wildcard[$2] = substr($0, index($0, $3));
+ next;
}
#
@@ -243,14 +233,13 @@ END {
# Output format:
# package-name|package-path|installation-prefix|comment| \
# description-file|maintainer|categories|build deps|run deps|for arch| \
-# not for opsys
+# not for opsys|homepage
pkgcnt = 0;
for (toppkg in topdepends){
pkgcnt++;
- pkgdir = PKGSRCDIR "/" toppkg;
printf("%s|", pkgdir2name[toppkg]) | indexf;
- printf("%s|", pkgdir) | indexf;
+ printf("%s|", toppkg) | indexf;
printf("%s|", prefix[toppkg]) | indexf;
printf("%s|", comment[toppkg]) | indexf;
printf("%s|", descr[toppkg]) | indexf;
@@ -263,7 +252,8 @@ END {
gsub(/ $/, "", flatdepends[toppkg]);
printf("%s|", flatdepends[toppkg]) | indexf;
printf("%s|", onlyfor[toppkg]) | indexf;
- printf("%s", notfor[toppkg]) | indexf;
+ printf("%s|", notfor[toppkg]) | indexf;
+ printf("%s", homepage[toppkg]) | indexf;
printf("\n") | indexf;
}
close(indexf);