bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] gnu-web-doc-update: add --mirror to remove stale files


From: Pádraig Brady
Subject: [PATCH] gnu-web-doc-update: add --mirror to remove stale files
Date: Tue, 16 Jun 2015 06:47:32 +0100

* build-aux/gnu-web-doc-update: Add a --mirror option to remove
out of date files from the CVS server.  Since this is usually
appropriate, a prompt is given when the option is not specified,
along with the `cvs remove` command that would be run.
---
 ChangeLog                    |  8 ++++++++
 build-aux/gnu-web-doc-update | 17 ++++++++++++++++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 64b9de1..53fc032 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2015-06-16  Pádraig Brady  <address@hidden>
+
+       gnu-web-doc-update: add --mirror to remove stale files
+       * build-aux/gnu-web-doc-update: Add a --mirror option to remove
+       out of date files from the CVS server.  Since this is usually
+       appropriate, a prompt is given when the option is not specified,
+       along with the `cvs remove` command that would be run.
+
 2015-06-06  Paul Eggert  <address@hidden>
 
        acl-permissions: pacify -Wsuggest-attribute=const
diff --git a/build-aux/gnu-web-doc-update b/build-aux/gnu-web-doc-update
index aaea7eb..c8fc7e5 100755
--- a/build-aux/gnu-web-doc-update
+++ b/build-aux/gnu-web-doc-update
@@ -2,7 +2,7 @@
 # Run this after each non-alpha release, to update the web documentation at
 # http://www.gnu.org/software/$pkg/manual/
 
-VERSION=2012-12-16.14; # UTC
+VERSION=2015-06-16.06; # UTC
 
 # Copyright (C) 2009-2015 Free Software Foundation, Inc.
 
@@ -40,6 +40,7 @@ assumes all documentation is in the doc/ sub-directory.
 Options:
   -C, --builddir=DIR  location of (configured) Makefile (default: .)
   -n, --dry-run       don't actually commit anything
+  -m, --mirror        remove out of date files from document server
   --help              print this help, then exit
   --version           print version number, then exit
 
@@ -107,6 +108,7 @@ find_tool XARGS gxargs xargs
 
 builddir=.
 dryrun=
+rm_stale='echo'
 while test $# != 0
 do
   # Handle --option=value by splitting apart and putting back on argv.
@@ -123,6 +125,7 @@ do
     --help|--version) ${1#--};;
     -C|--builddir) shift; builddir=$1; shift ;;
     -n|--dry-run) dryrun=echo; shift;;
+    -m|--mirror) rm_stale=''; shift;;
     --*) die "unrecognized option: $1";;
     *) break;;
   esac
@@ -159,6 +162,7 @@ $GIT submodule update --recursive
 ./bootstrap
 srcdir=$(pwd)
 cd "$builddir"
+builddir=$(pwd)
   ./config.status --recheck
   ./config.status
   make
@@ -182,6 +186,17 @@ $RSYNC -avP "$builddir"/doc/manual/ $tmp/$pkg/manual
   find . -name CVS -prune -o -print             \
     | $XARGS --no-run-if-empty -- $dryrun $CVS add -ko
 
+  # Report/Remove stale files
+  #   excluding doc server specific files like CVS/* and .symlinks
+  if test -n "$rm_stale"; then
+    echo 'Consider the --mirror option if all of the manual is generated,' >&2
+    echo 'which will run `cvs remove` to remove stale files.' >&2
+  fi
+  { find . \( -name CVS -o -type f -name '.*' \) -prune -o -type f -print
+    (cd "$builddir"/doc/manual/ && find . -type f -print | sed p)
+  } | sort | uniq -u \
+    | $XARGS --no-run-if-empty -- ${rm_stale:-$dryrun} $CVS remove -f
+
   $dryrun $CVS ci -m $version
 )
 
-- 
2.4.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]