summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornia <nia@pkgsrc.org>2021-02-22 09:32:55 +0000
committernia <nia@pkgsrc.org>2021-02-22 09:32:55 +0000
commitc0f338cfea26b62d4353ba34b1312ee82a836a8c (patch)
tree8cec99a9a2c1660a811c31c168ef5cf6881d4919
parentfcb9f87dd4d4cbab7486a2685782b7279b12d172 (diff)
downloadpkgsrc-c0f338cfea26b62d4353ba34b1312ee82a836a8c.tar.gz
genreadme: Improve generated HTML markup
Don't use tables for everything, it's not 1999 any more. Remove another hack for Solaris 9.
-rwxr-xr-xmk/scripts/genreadme.awk58
-rw-r--r--templates/README.category17
-rw-r--r--templates/README.top6
3 files changed, 28 insertions, 53 deletions
diff --git a/mk/scripts/genreadme.awk b/mk/scripts/genreadme.awk
index fb8b4110603..df717caa145 100755
--- a/mk/scripts/genreadme.awk
+++ b/mk/scripts/genreadme.awk
@@ -1,5 +1,5 @@
#!/usr/bin/awk -f
-# $NetBSD: genreadme.awk,v 1.45 2021/02/22 05:32:02 nia Exp $
+# $NetBSD: genreadme.awk,v 1.46 2021/02/22 09:32:55 nia Exp $
#
# Copyright (c) 2002-2021 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -201,10 +201,6 @@ BEGIN {
wildcard[$2] = $3;
}
-#
-# Now recurse the tree to give a flattened depends list for each pkg
-#
-
END {
readme = TMPDIR "/" readme_name;
@@ -242,9 +238,9 @@ END {
# extract date for vulnerabilities file
if (SCAN_VULNERABILITIES == 0)
- vuldate="<TR><TD><I>(no vulnerabilities list, update pkg_install)</I>";
+ vuldate="<li><em>(no vulnerabilities list, update pkg_install)</em></li>";
else if (SCAN_VULNERABILITIES == 1)
- vuldate="<TR><TD><I>(no vulnerabilities list available)</I>";
+ vuldate="<li><em>(no vulnerabilities list available)</em></li>";
if (SINGLEPKG != "" ) {
printf("Only creating README for %s\n",SINGLEPKG);
@@ -292,13 +288,13 @@ END {
if (status == "fixed")
continue
status = "a " status;
- vul = sprintf("%s<LI>%s <a href=\"%s\">%s</a> vulnerability</LI>\n",
+ vul = sprintf("%s<li>%s <a href=\"%s\">%s</a> vulnerability</li>\n",
vul, status, entry[3], entry[2]);
}
close(cmd);
if ( vul == "" ) {
- vul="<I>(no vulnerabilities known)</I>";
+ vul="<em>(no vulnerabilities known)</em>";
}
}
@@ -400,8 +396,6 @@ END {
}
cat_make = catdir"/Makefile";
pkgs = "";
- pkgs_file = TMPDIR "/pkgs_file";
- printf("") > pkgs_file;
numpkg = 0;
print "" > readme;
while((getline < cat_make) > 0){
@@ -418,20 +412,12 @@ END {
pkgdir2name[dir],
comment[dir]);
}
-# pkgs = sprintf("%s<TR><TD VALIGN=TOP><a href=\"%s/%s\">%s</a>: %s<TD>\n",
-# pkgs, pkg, readme_name,
-# pkgdir2name[dir],
-# comment[dir]);
-# We use a temp file to hold the list of all packages because
-# this list can get very very large and
-# become larger than what some awk implementations can deal
-# with. The nawk shipped with solaris 9 is an example of
-# such a limited awk.
- printf("<TR><TD VALIGN=TOP><a href=\"%s/%s\">%s</a>: %s<TD>\n",
- pkg, readme_name,
- pkgdir2name[dir],
- comment[dir]) >> pkgs_file;
- allpkg[tot_numpkg] = sprintf("<!-- %s (for sorting) --><TR VALIGN=TOP><TD><a href=\"%s/%s/%s\">%s</a>: <TD>(<a href=\"%s/%s\">%s</a>) <td>%s\n",
+ pkgs = sprintf("%s<dt><a href=\"%s/%s\">%s</a></dt><dd>%s</dd>\n",
+ pkgs,
+ pkg, readme_name,
+ pkgdir2name[dir],
+ comment[dir]);
+ allpkg[tot_numpkg] = sprintf("<!-- %s (for sorting) --><tr><td><a href=\"%s/%s/%s\">%s</a></td><td><a href=\"%s/%s\">%s</a></td><td>%s</td>\n",
pkgdir2name[dir],
category, pkg,
readme_name,
@@ -453,26 +439,16 @@ END {
gsub(/%%CATEGORY%%/, category);
gsub(/%%NUMITEMS%%/, numpkg);
gsub(/%%DESCR%%/, descr);
+ gsub(/%%SUBDIR%%/, ""pkgs"");
- line = $0
-
- if( $0 ~/%%SUBDIR%%/ ) {
- gsub(/%%SUBDIR%%/, "", line);
- while((getline < pkgs_file) > 0) {
- gsub(/README.html/, readme_name);
- print >> readme;
- }
- close( pkgs_file );
- }
-
- print line >> readme;
+ print $0 >> readme;
}
close(readme);
close(templatefile);
copy_readme(readmenew, readme);
gsub(/href=\"/, "href=\""category"/", pkgs);
- allcat = sprintf("%s<TR><TD VALIGN=TOP><a href=\"%s/%s\">%s</a>: %s<TD>\n",
+ allcat = sprintf("%s<dt><a href=\"%s/%s\">%s</a></dt><dd>%s</dd>\n",
allcat, category, readme_name,
category, descr);
close(cat_make);
@@ -556,7 +532,7 @@ function create_htmldeps(dependslist){
i = i + 1;
}
if ( i == 1 ) {
- htmldeps = "<EM>none</EM>";
+ htmldeps = "<em>(none)</em>";
}
return htmldeps;
}
@@ -750,12 +726,12 @@ function lookup_cache( d, binpkgs) {
binpkgs_file = TMPDIR "/binpkgs";
spipe = SORT " > " binpkgs_file;
for(i=1 ; i<=pkg_count[d]; i=i+1) {
- printf("<TR><TD>%s:<TD><a href=\"%s/%s\">%s</a><TD>(%s %s)\n",
+ printf("<tr><td>%s:<td><a href=\"%s/%s\">%s</a><td>(%s %s)\n",
march_list[d, i], PKG_URL, pkgfile_list[d, i], pkgnm_list[d, i],
opsys_list[d, i], osver_list[d, i]) | spipe;
}
if( pkg_count[d] == 0 ) {
- printf("<TR><TD><EM>none</EM></TD></TR>\n") | spipe;
+ printf("<tr><td><em>(none)</em></td></tr>\n") | spipe;
}
close( spipe );
diff --git a/templates/README.category b/templates/README.category
index 73857c6cab2..8fca2f5ba31 100644
--- a/templates/README.category
+++ b/templates/README.category
@@ -1,31 +1,30 @@
-<!-- $NetBSD: README.category,v 1.12 2021/02/22 05:10:18 nia Exp $ -->
+<!-- $NetBSD: README.category,v 1.13 2021/02/22 09:32:55 nia Exp $ -->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<link href="../templates/main.css" rel="stylesheet">
-<title>The NetBSD Packages Collection: %%CATEGORY%%</title>
+<title>%%CATEGORY%% - The NetBSD Packages Collection</title>
</head>
<body>
<a href="http://www.mckusick.com/beastie/mainpage/copyright.html">
<img src="../templates/pkg-daemon.gif" alt="Daemon Power" id="logo">
</a>
-<h1>The NetBSD Packages Collection: <i>%%CATEGORY%%</i></h1>
-
-<p>You are now in the directory "%%CATEGORY%%".
+<h1><em>%%CATEGORY%%</em> - The NetBSD Packages Collection</h1>
<p>
%%DESCR%%
+</p>
<p>Here are the one-line descriptions for each of the
%%NUMITEMS%%
-items in this directory:
+items in this directory:</p>
-<p><hr noshade>
-<p><table>
+<hr noshade>
+<dl>
%%SUBDIR%%
-</table>
+</dl>
<hr noshade>
[
diff --git a/templates/README.top b/templates/README.top
index dc4afc01ea6..72d9d103ef5 100644
--- a/templates/README.top
+++ b/templates/README.top
@@ -1,4 +1,4 @@
-<!-- $NetBSD: README.top,v 1.20 2021/02/21 10:19:53 nia Exp $ -->
+<!-- $NetBSD: README.top,v 1.21 2021/02/22 09:32:55 nia Exp $ -->
<!doctype html>
<html lang="en">
<head>
@@ -24,9 +24,9 @@ is also available.
</p>
<hr noshade>
-<table>
+<dl>
%%SUBDIR%%
-</table>
+</dl>
<hr noshade>
Prebuilt binary packages can be installed using