Received: by mail.netbsd.org (Postfix, from userid 605) id 8BF96850BA; Mon, 5 Apr 2021 10:32:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id C492784D81 for ; Mon, 5 Apr 2021 10:32:39 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id ZmV3zrI7VQwd for ; Mon, 5 Apr 2021 10:32:38 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.NetBSD.org [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id 772A484D0E for ; Mon, 5 Apr 2021 10:32:38 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id 70711FA95; Mon, 5 Apr 2021 10:32:38 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_161761875815320" MIME-Version: 1.0 Date: Mon, 5 Apr 2021 10:32:38 +0000 From: "Nia Alarie" Subject: CVS commit: pkgsrc To: pkgsrc-changes@NetBSD.org Reply-To: nia@netbsd.org X-Mailer: log_accum Message-Id: <20210405103238.70711FA95@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: Precedence: bulk List-Unsubscribe: This is a multi-part message in MIME format. --_----------=_161761875815320 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" 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. --_----------=_161761875815320 Content-Disposition: inline Content-Length: 15546 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii 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 arc-5.21e +# htmlname /usr/pkgsrc/archivers/arc arc-5.21e # # 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
%s
%s
\n", + pkgs = sprintf("%s
%s
%s
\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
%s
\n", + allpkg[tot_numpkg] = sprintf("
%s
%s
\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
%s
%s
\n", - allcat, category, readme_name, + allcat = sprintf("%s
%s
%s
\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%s\n", + htmldeps = sprintf("%s%s\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 @@ - + @@ -15,7 +15,7 @@