pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc
Module Name: pkgsrc
Committed By: nia
Date: Mon Feb 22 09:32:55 UTC 2021
Modified Files:
pkgsrc/mk/scripts: genreadme.awk
pkgsrc/templates: README.category README.top
Log Message:
genreadme: Improve generated HTML markup
Don't use tables for everything, it's not 1999 any more.
Remove another hack for Solaris 9.
To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 pkgsrc/mk/scripts/genreadme.awk
cvs rdiff -u -r1.12 -r1.13 pkgsrc/templates/README.category
cvs rdiff -u -r1.20 -r1.21 pkgsrc/templates/README.top
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/mk/scripts/genreadme.awk
diff -u pkgsrc/mk/scripts/genreadme.awk:1.45 pkgsrc/mk/scripts/genreadme.awk:1.46
--- pkgsrc/mk/scripts/genreadme.awk:1.45 Mon Feb 22 05:32:02 2021
+++ pkgsrc/mk/scripts/genreadme.awk Mon Feb 22 09:32:55 2021
@@ -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 );
Index: pkgsrc/templates/README.category
diff -u pkgsrc/templates/README.category:1.12 pkgsrc/templates/README.category:1.13
--- pkgsrc/templates/README.category:1.12 Mon Feb 22 05:10:18 2021
+++ pkgsrc/templates/README.category Mon Feb 22 09:32:55 2021
@@ -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>
[
Index: pkgsrc/templates/README.top
diff -u pkgsrc/templates/README.top:1.20 pkgsrc/templates/README.top:1.21
--- pkgsrc/templates/README.top:1.20 Sun Feb 21 10:19:53 2021
+++ pkgsrc/templates/README.top Mon Feb 22 09:32:55 2021
@@ -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
Home |
Main Index |
Thread Index |
Old Index