On 15/12/12 20:41, Jim Meyering wrote:
> Akim Demaille wrote:
>> Le 13 déc. 2012 à 18:06, Jim Meyering <[email protected]> a écrit :
>>
>>>> cvsu does not report that there are directories and files inside the
>>>> 'D's.  Is it wrong to simply cvs add everything that is there?
>>>> Just skipping CVS, but adding all the rest using "find"?
>>>> Say "find . -name CVS -prune -o -print".
>>>
>>> That sounds like it will work.
>>> Thanks again.
>>
>> Here is my proposal.  I don't see anything ready to _remove_ bits
>> that are no longer generated.  This is a problem, since for instance
> 
> Hi Akim!
> Yes, it'd be good to fix that, someday.

FYI I fixed that a while ago with:
http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=commit;h=9a417cf

>> commit a1d1f4b7fc9b46fc37a8dc55b591768a80ead566
>> Author: Akim Demaille <[email protected]>
>> Date:   Fri Dec 14 12:58:35 2012 +0100
>>
>>     gnu-web-doc-update: add all the new files, even in new directories
>>
>>     See http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00057.html
>>
>>     * build-aux/gnu-web-doc-update (--dry-run, $dryrun): New.
>>     Use it.
>>     (main): Don't use cvsutils to get the list of unknown files,
>>     just add all the existing files and directories.

That change is causing an issue in coreutils wrt empty dirs,
which causes new files to be missed due to:
  cvs [add aborted]: there is a version in ./ps already
  ...

I've installed the attached change to add dirs separately and individually,
as cvs seems to have different treatment for files and dirs.

thanks,
Pádraig.
From 6465306025facca3881bcea411b757b0fe8e8df8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]>
Date: Wed, 20 Jan 2016 14:10:30 +0000
Subject: [PATCH] gnu-web-doc-update: fix addition of new files

If there were already added (emnpty) dirs,
then cvs aborts the add with the message:
  cvs [add aborted]: there is a version in <./dirname> already

* build-aux/gnu-web-doc-update: Add directories separately
to the addition of files, to avoid the above issue
impacting the addition of files.
---
 ChangeLog                    | 10 ++++++++++
 build-aux/gnu-web-doc-update | 11 ++++++-----
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9614d58..1bdf766 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2016-01-20  Pádraig Brady  <[email protected]>
+
+	gnu-web-doc-update: fix addition of new files
+	If there were already added (emnpty) dirs,
+	then cvs aborts the add with the message:
+	  cvs [add aborted]: there is a version in <./dirname> already
+	* build-aux/gnu-web-doc-update: Add directories separately
+	to the addition of files, to avoid the above issue
+	impacting the addition of files.
+
 2016-01-19  Daiki Ueno  <[email protected]>
 
 	utimens-tests: avoid pulling gettext .m4 files
diff --git a/build-aux/gnu-web-doc-update b/build-aux/gnu-web-doc-update
index ec21168..271e693 100755
--- a/build-aux/gnu-web-doc-update
+++ b/build-aux/gnu-web-doc-update
@@ -179,11 +179,12 @@ $RSYNC -avP "$builddir"/doc/manual/ $tmp/$pkg/manual
   cd $tmp/$pkg/manual
 
   # Add all the files.  This is simpler than trying to add only the
-  # new ones because of new directories: it would require iterating on
-  # adding the outer directories, and then their contents.
-  #
-  # find guarantees that we add outer directories first.
-  find . -name CVS -prune -o -print             \
+  # new ones because of new directories
+  # First add non empty dirs individually
+  find . -name CVS -prune -o -type d \! -empty -print             \
+    | $XARGS -n1 --no-run-if-empty -- $dryrun $CVS add -ko
+  # Now add all files
+  find . -name CVS -prune -o -type f -print             \
     | $XARGS --no-run-if-empty -- $dryrun $CVS add -ko
 
   # Report/Remove stale files
-- 
2.5.0

Reply via email to