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 Apr  5 10:32:38 UTC 2021

Modified Files:
        pkgsrc/mk/scripts: genreadme.awk mkreadme
        pkgsrc/templates: README.all README.category README.pkg README.top

Log Message:
mkreadme: Rename generated files to index.html

This should make web servers happier, as discusesd on tech-pkg.


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 pkgsrc/mk/scripts/genreadme.awk
cvs rdiff -u -r1.32 -r1.33 pkgsrc/mk/scripts/mkreadme
cvs rdiff -u -r1.12 -r1.13 pkgsrc/templates/README.all
cvs rdiff -u -r1.18 -r1.19 pkgsrc/templates/README.category
cvs rdiff -u -r1.40 -r1.41 pkgsrc/templates/README.pkg
cvs rdiff -u -r1.25 -r1.26 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.48 pkgsrc/mk/scripts/genreadme.awk:1.49
--- pkgsrc/mk/scripts/genreadme.awk:1.48        Mon Mar  8 16:37:59 2021
+++ pkgsrc/mk/scripts/genreadme.awk     Mon Apr  5 10:32:38 2021
@@ -1,5 +1,5 @@
 #!/usr/bin/awk -f
-# $NetBSD: genreadme.awk,v 1.48 2021/03/08 16:37:59 nia Exp $
+# $NetBSD: genreadme.awk,v 1.49 2021/04/05 10:32:38 nia Exp $
 #
 # Copyright (c) 2002-2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -44,14 +44,6 @@
 #
 BEGIN {
        do_pkg_readme=1;
-# set to 1 to use "README-new.html" as the name
-       use_readme_new=0;
-       if (use_readme_new) {
-               readme_name = "README-new.html";
-       }
-       else {
-               readme_name = "README.html";
-       }
        printf("Reading database file\n");
 }
 
@@ -147,7 +139,7 @@ BEGIN {
 /^htmlname / {
 #
 # read lines like:
-# htmlname /usr/pkgsrc/archivers/arc <a href=../../archivers/arc/README.html>arc-5.21e</A>
+# htmlname /usr/pkgsrc/archivers/arc <a href=../../archivers/arc/index.html>arc-5.21e</A>
 #
 #    dir=fulldir2pkgdir($2);
        dir = $2;
@@ -155,10 +147,7 @@ BEGIN {
        for (i = 4; i <= NF; i++){
                htmlname = htmlname " " $i;
        }
-       # If we are using a name other than README.html, change it
-       # here.  This avoids having to process a huge line later which
-       # makes lesser awks puke.
-       gsub(/README.html/, readme_name, htmlname);
+       gsub(/README.html/, "index.html", htmlname);
        dir2htmlname[dir] = htmlname;
        if (debug) printf("added dir2htmlname[%s]=%s\n", dir, htmlname);
        next;
@@ -202,7 +191,7 @@ BEGIN {
 }
 
 END {
-       readme = TMPDIR "/" readme_name;
+       readme = TMPDIR "/index.html";
 
        printf("Making sure binary package cache file is up to date...\n");
        if ( quiet == "yes" ){
@@ -250,7 +239,7 @@ END {
                depends[SINGLEPKG] = "yes";
        }
 
-       printf("Generating README.html files\n");
+       printf("Generating index.html files\n");
        pkgcnt = 0;
        if (do_pkg_readme) {
                templatefile = PKGSRCDIR "/templates/README.pkg";
@@ -258,7 +247,7 @@ END {
                for (toppkg in depends){
                        pkgcnt++;
                        pkgdir = PKGSRCDIR "/" toppkg;
-                       readmenew=pkgdir  "/" readme_name;
+                       readmenew=pkgdir  "/index.html";
 
                        if (debug) printf("Creating %s for %s\n",
                                          readme, readmenew);
@@ -380,9 +369,9 @@ END {
        templatefile = PKGSRCDIR "/templates/README.category";
        fatal_check_file(templatefile);
 
-# string with URLs for all categories (used by the top README.html)
+# string with URLs for all categories (used by the top index.html)
        allcat = "";
-# string with URLs for all pkgs (used by the top README-all.html)
+# string with URLs for all pkgs (used by the top index-all.html)
        tot_numpkg = 0;
        top_make = PKGSRCDIR"/Makefile";
        while((getline < top_make) > 0){
@@ -390,7 +379,7 @@ END {
                        category = $0;
                        gsub(/^[ \t]*SUBDIR.*=[ \t]*/, "", category);
                        catdir = PKGSRCDIR"/"category;
-                       readmenew = catdir"/"readme_name;
+                       readmenew = catdir"/index.html";
                        if (quiet != "yes") {
                                printf("Category = %s\n", category);
                        }
@@ -412,16 +401,15 @@ END {
                                                 pkgdir2name[dir],
                                                 comment[dir]);
                                        }
-                                       pkgs = sprintf("%s<dt><a href=\"%s/%s\">%s</a></dt><dd>%s</dd>\n",
+                                       pkgs = sprintf("%s<dt><a href=\"%s/index.html\">%s</a></dt><dd>%s</dd>\n",
                                            pkgs,
-                                           pkg, readme_name,
+                                           pkg,
                                            pkgdir2name[dir],
                                            comment[dir]);
                                        # Prefix with the package name in a comment for sorting.
-                                       allpkg[tot_numpkg] = sprintf("<!-- %s --><dt><a href=\"%s/%s/%s\">%s</a></dt><dd>%s</dd>\n",
+                                       allpkg[tot_numpkg] = sprintf("<!-- %s --><dt><a href=\"%s/%s/index.html\">%s</a></dt><dd>%s</dd>\n",
                                                                      pkgdir2name[dir],
                                                                      category, pkg,
-                                                                     readme_name,
                                                                      pkgdir2name[dir],
                                                                      comment[dir]);
 # we need slightly fewer escapes here since we are not gsub()-ing
@@ -446,8 +434,8 @@ END {
                        copy_readme(readmenew, readme);
 
                        gsub(/href=\"/, "href=\""category"/", pkgs);
-                       allcat = sprintf("%s<dt><a href=\"%s/%s\">%s</a></dt><dd>%s</dd>\n",
-                                        allcat, category, readme_name,
+                       allcat = sprintf("%s<dt><a href=\"%s/index.html\">%s</a></dt><dd>%s</dd>\n",
+                                        allcat, category,
                                         category, descr);
                        close(cat_make);
                }
@@ -457,13 +445,12 @@ END {
        printf("Generating toplevel readmes:\n");
        templatefile = PKGSRCDIR "/templates/README.top";
        fatal_check_file(templatefile);
-       readmenew = PKGSRCDIR "/"readme_name;
+       readmenew = PKGSRCDIR "/index.html"
        printf("\t%s\n", readmenew);
        print "" > readme;
        while((getline < templatefile) > 0){
                gsub(/%%DESCR%%/, "");
                gsub(/%%SUBDIR%%/, allcat);
-               gsub(/README.html/, readme_name);
                print >> readme;
        }
        close(readme);
@@ -472,7 +459,7 @@ END {
 
        templatefile = PKGSRCDIR "/templates/README.all";
        fatal_check_file(templatefile);
-       readmenew = PKGSRCDIR "/README-all.html";
+       readmenew = PKGSRCDIR "/index-all.html";
        printf("\t%s\n", readmenew);
 # sort the pkgs
        sfile = TMPDIR"/unsorted";
@@ -496,7 +483,6 @@ END {
                } else {
                        gsub(/%%DESCR%%/, "", line);
                        gsub(/%%NPKGS%%/, tot_numpkg, line);
-                       gsub(/README.html/, readme_name, line);
                        print line >> readme;
                }
        }
@@ -522,10 +508,9 @@ function create_htmldeps(dependslist){
                         dpkgs[i],
                         pat2dir[dpkgs[i]]);
                }
-               htmldeps = sprintf("%s<a href=\"../../%s/%s\">%s</a>\n",
+               htmldeps = sprintf("%s<a href=\"../../%s/index.html\">%s</a>\n",
                                 htmldeps,
                                 pat2dir[dpkgs[i]],
-                                readme_name,
                                 pat2dir[dpkgs[i]]);
                i = i + 1;
        }
@@ -617,8 +602,8 @@ function fatal_check_file(file, cmd){
        }
 }
 
-# 'new' is the newly created README.html file
-# 'old' is the existing (possibly not present) README.html file
+# 'new' is the newly created index.html file
+# 'old' is the existing (possibly not present) index.html file
 #
 #  This function copies over the 'new' file if the 'old' one does
 #  not exist or if they are different.  In addition, the 'new' one
@@ -626,7 +611,7 @@ function fatal_check_file(file, cmd){
 
 function copy_readme(old, new, cmd, rc) {
 
-#      if the README.html file does not exist at all then copy over
+#      if the index.html file does not exist at all then copy over
 #      the one we created
 
        cmd = "if [ ! -f "old" ]; then cp " new " " old " ; fi";
@@ -638,7 +623,7 @@ function copy_readme(old, new, cmd, rc) 
                printf("**** ------- ****\n") > "/dev/stderr";
        }
 
-#      Compare the existing README.html file to the one we created.  If they are
+#      Compare the existing index.html file to the one we created.  If they are
 #      not the same, then copy over the one we created
 
        cmd = sprintf("%s -s %s %s ; if test $? -ne 0 ; then mv -f %s %s ; fi",

Index: pkgsrc/mk/scripts/mkreadme
diff -u pkgsrc/mk/scripts/mkreadme:1.32 pkgsrc/mk/scripts/mkreadme:1.33
--- pkgsrc/mk/scripts/mkreadme:1.32     Fri Feb 19 17:49:06 2021
+++ pkgsrc/mk/scripts/mkreadme  Mon Apr  5 10:32:38 2021
@@ -1,7 +1,7 @@
 #!/bin/sh
-# $NetBSD: mkreadme,v 1.32 2021/02/19 17:49:06 nia Exp $
+# $NetBSD: mkreadme,v 1.33 2021/04/05 10:32:38 nia Exp $
 #
-# Script for README.html generation
+# Script for index.html generation
 #
 # Copyright (c) 2002, 2005 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -50,7 +50,7 @@ esac
 BMAKE=${BMAKE:-${makeprog}}
 
 usage(){
-    echo "$prog - Generates README.html files for a pkgsrc tree"
+    echo "$prog - Generates index.html files for a pkgsrc tree"
     echo "Usage:      $prog [-c|--cdrom] [-C|--prune] [-d|--debug] [-f|--ftp] "
     echo "                  [-q|--quiet] "
     echo "                  [-p|--pkgsrc directory] "
@@ -64,14 +64,14 @@ usage(){
     echo " "
     echo "The options supported by $prog are: "
     echo " "
-    echo "  -C|--prune          Prune unused README.html files which may exist in"
+    echo "  -C|--prune          Prune unused index.html files which may exist in"
     echo "                      pkg directories which have been removed from CVS."
     echo " "
-    echo "  -c|--cdrom          Generates CD-ROM README.html files"
+    echo "  -c|--cdrom          Generates CD-ROM index.html files"
     echo " "
     echo "  -d|--debug          Enables (extremely verbose) debug output"
     echo " "
-    echo "  -f|--ftp            Generates FTP README.html files"
+    echo "  -f|--ftp            Generates FTP index.html files"
     echo " "
     echo "  -h|--help           Displays this help message"
     echo " "
@@ -136,13 +136,13 @@ do
     case "$1"
     in
 
-    # We're generating README.html's for a CD-ROM
+    # We're generating index.html's for a CD-ROM
     -c|--cdrom)
        ftp_readme=no
        shift
        ;;
 
-    # Prune old README.html files from pkgs which no longer exist
+    # Prune old index.html files from pkgs which no longer exist
     -C|--prune)
        prune=yes
        shift
@@ -154,7 +154,7 @@ do
        shift
        ;;
 
-    # We're generating README.html's for a CD-ROM
+    # We're generating index.html's for a CD-ROM
     -f|--ftp)
        ftp_readme=yes
        shift
@@ -249,7 +249,7 @@ DATABASEFILE=$TMPDIR/database
 export DATABASEFILE
 BINPKGFILE=$TMPDIR/binpkglist
 
-echo "Starting README.html generation: `date`"
+echo "Starting index.html generation: `date`"
 
 ######################################################################
 #
@@ -303,7 +303,7 @@ fi
 
 ######################################################################
 #
-#  Decide on FTP vs CDROM README.html files
+#  Decide on FTP vs CDROM index.html files
 #
 ######################################################################
 
@@ -409,12 +409,12 @@ fi
 
 ######################################################################
 #
-#  Generate the package and category README.html files
+#  Generate the package and category index.html files
 #
 ######################################################################
 
 echo " "
-echo "Generating package README.html files"
+echo "Generating package indexx.html files"
 echo " "
 if [ "x$DEBUG" = "xyes" ]; then
     debug=1;
@@ -449,26 +449,26 @@ ${AWK} -f ${PKGSRCDIR}/mk/scripts/genrea
        ${DATABASEFILE}
 
 if [ $? != 0 ]; then
-    echo "Error:  genreadme.awk failed to create README.html files"
+    echo "Error:  genreadme.awk failed to create index.html files"
     clean_and_exit
 fi
 
 ######################################################################
 #
-#  Prune README.html files which are no longer needed
+#  Prune index.html files which are no longer needed
 #
 ######################################################################
 if [ "x$prune" = "xyes" ]; then
     echo " "
-    echo "Pruning unused README.html files"
+    echo "Pruning unused index.html files"
     echo " "
     cd ${PKGSRCDIR}
     # cats=`${BMAKE} show-subdir-var VARNAME=SUBDIR` # already set above
     for c in ${cats} ; do
        for d in `ls -d ${c}/*` ; do
-           if [ -d $d -a ! -f ${d}/Makefile -a -f ${d}/README.html ]; then
-               echo "Pruning ${d}/README.html which is no longer used"
-               rm -f ${d}/README.html
+           if [ -d $d -a ! -f ${d}/Makefile -a -f ${d}/index.html ]; then
+               echo "Pruning ${d}/index.html which is no longer used"
+               rm -f ${d}/index.html
            fi
        done
     done
@@ -480,7 +480,7 @@ fi
 #
 ######################################################################
 echo " "
-echo "README.html generation finished:  `date`"
+echo "index.html generation finished:  `date`"
 echo " "
 if [ "x$DEBUG" = "xno" -a "x$restart" = "xno" -a "x$save" = "xno" ]; then
     rm -fr $TMPDIR

Index: pkgsrc/templates/README.all
diff -u pkgsrc/templates/README.all:1.12 pkgsrc/templates/README.all:1.13
--- pkgsrc/templates/README.all:1.12    Mon Apr  5 09:18:06 2021
+++ pkgsrc/templates/README.all Mon Apr  5 10:32:38 2021
@@ -1,4 +1,4 @@
-<!-- $NetBSD: README.all,v 1.12 2021/04/05 09:18:06 nia Exp $ -->
+<!-- $NetBSD: README.all,v 1.13 2021/04/05 10:32:38 nia Exp $ -->
 <!-- generated by pkgsrc/mk/scripts/mkreadme -->
 <!doctype html>
 <html lang="en">
@@ -15,7 +15,7 @@
 <nav>
 <p>
 [
-<a href="README.html"> Go to top of packages tree</a>
+<a href="index.html"> Go to top of packages tree</a>
 ]
 </p>
 <p></p> <!-- spacing hack for older browsers -->

Index: pkgsrc/templates/README.category
diff -u pkgsrc/templates/README.category:1.18 pkgsrc/templates/README.category:1.19
--- pkgsrc/templates/README.category:1.18       Mon Apr  5 09:37:27 2021
+++ pkgsrc/templates/README.category    Mon Apr  5 10:32:38 2021
@@ -1,4 +1,4 @@
-<!-- $NetBSD: README.category,v 1.18 2021/04/05 09:37:27 nia Exp $ -->
+<!-- $NetBSD: README.category,v 1.19 2021/04/05 10:32:38 nia Exp $ -->
 <!-- generated by pkgsrc/mk/scripts/mkreadme -->
 <!doctype html>
 <html lang="en">
@@ -15,9 +15,9 @@
 <nav>
 <p>
 [
-<a href="../README.html"> Back to list of categories</a>
+<a href="../index.html"> Back to list of categories</a>
 |
-<a href="../README-all.html"> List all packages</a>
+<a href="../index-all.html"> List all packages</a>
 ]
 </p>
 <p></p> <!-- spacing hack for older browsers -->

Index: pkgsrc/templates/README.pkg
diff -u pkgsrc/templates/README.pkg:1.40 pkgsrc/templates/README.pkg:1.41
--- pkgsrc/templates/README.pkg:1.40    Mon Apr  5 09:37:27 2021
+++ pkgsrc/templates/README.pkg Mon Apr  5 10:32:38 2021
@@ -1,4 +1,4 @@
-<!-- $NetBSD: README.pkg,v 1.40 2021/04/05 09:37:27 nia Exp $ -->
+<!-- $NetBSD: README.pkg,v 1.41 2021/04/05 10:32:38 nia Exp $ -->
 <!-- generated by pkgsrc/mk/scripts/mkreadme -->
 <!doctype html>
 <html lang="en">
@@ -17,11 +17,11 @@
 <nav>
 <p>
 [
-<a href="../README.html"> Back to category</a>
+<a href="../index.html"> Back to category</a>
 |
-<a href="../../README.html"> List of categories</a>
+<a href="../../index.html"> List of categories</a>
 |
-<a href="../../README-all.html"> List all packages</a>
+<a href="../../index-all.html"> List all packages</a>
 ]
 </p>
 <p></p> <!-- spacing hack for older browsers -->
@@ -71,10 +71,10 @@
 
 <p>
 Binary packages can be installed with the high-level tool
-<a href="../../pkgtools/pkgin/README.html">pkgin</a>
+<a href="../../pkgtools/pkgin/index.html">pkgin</a>
 (which can be installed with pkg_add)
 or
-<a href="//man.NetBSD.org/pkg_add.1">pkg_add(1)</a>
+<a href="https://man.NetBSD.org/pkg_add.1";>pkg_add(1)</a>
 (installed by default).
 
 The NetBSD packages collection is also designed to permit
@@ -95,7 +95,7 @@ The NetBSD packages collection is also d
 %%VULNERABILITIES%%
 </ul>
 <p>
-The <a href="../../pkgtools/pkg_install/README.html">pkg_admin audit</a>
+The <a href="../../pkgtools/pkg_install/index.html">pkg_admin audit</a>
 command locates any installed package which has been mentioned in
 security advisories as having vulnerabilities.
 </p>

Index: pkgsrc/templates/README.top
diff -u pkgsrc/templates/README.top:1.25 pkgsrc/templates/README.top:1.26
--- pkgsrc/templates/README.top:1.25    Mon Apr  5 09:18:06 2021
+++ pkgsrc/templates/README.top Mon Apr  5 10:32:38 2021
@@ -1,4 +1,4 @@
-<!-- $NetBSD: README.top,v 1.25 2021/04/05 09:18:06 nia Exp $ -->
+<!-- $NetBSD: README.top,v 1.26 2021/04/05 10:32:38 nia Exp $ -->
 <!-- generated by pkgsrc/mk/scripts/mkreadme -->
 <!doctype html>
 <html lang="en">
@@ -14,14 +14,14 @@
 
 <p>
 The packages collection is divided into categories of packages.
-A <a href="README-all.html">complete list of all packages</a>
+A <a href="index-all.html">complete list of all packages</a>
 is also available.
 </p>
 
 <p>
 Prebuilt binary packages can be installed using the high level tool
-<a href="pkgtools/pkgin/README.html">pkgin</a> or the default
-<a href="//man.NetBSD.org/pkg_add.1">pkg_add(1)</a>.
+<a href="pkgtools/pkgin/index.html">pkgin</a> or the default
+<a href="https://man.NetBSD.org/pkg_add.1";>pkg_add(1)</a>.
 </p>
 
 <p>



Home | Main Index | Thread Index | Old Index