bug#36739: [PATCH] maint: fix issues in syntax-check

2019-08-06 Thread Paul Eggert

Thanks, I installed that.





bug#36739: [PATCH] maint: fix issues in syntax-check

2019-08-06 Thread Bernhard Voelker
On 7/20/19 9:27 AM, Akim Demaille wrote:
>  # Ensure that tests call the print_ver_ function for programs which are
>  # actually used in that test.
>  sc_prohibit_test_calls_print_ver_with_irrelevant_argument:
> - @git grep -w print_ver_ $(srcdir)/tests \
> + @cd $(srcdir)   \
> + && git -C  grep -w print_ver_ tests \
> | sed 's#:print_ver_##'   \
> | { fail=0;   \
> while read file name; do  \

'git -C' is lacking the SRCDIR argument.
The attached fixes it.

Have a nice day,
Berny
>From 4f4475f2ffad417e021d08fbf4a742bda48b10ee Mon Sep 17 00:00:00 2001
From: Bernhard Voelker 
Date: Tue, 6 Aug 2019 22:23:36 +0200
Subject: [PATCH] maint: fix error in syntax-check checking

The previous commit introduced a bug into the following syntax-check,
and thus effectively turned it off:

  $ make sc_prohibit_test_calls_print_ver_with_irrelevant_argument; \
  echo $?
  prohibit_test_calls_print_ver_with_irrelevant_argument
  fatal: cannot change to 'grep': No such file or directory
  0

* cfg.mk (sc_prohibit_test_calls_print_ver_with_irrelevant_argument):
Remove changing directory, and pass $(srcdir) as argument to 'git -C'.
---
 cfg.mk | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index b589b40e3..2bc933c8b 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -635,8 +635,7 @@ sc_prohibit_test_background_without_cleanup_:
 # Ensure that tests call the print_ver_ function for programs which are
 # actually used in that test.
 sc_prohibit_test_calls_print_ver_with_irrelevant_argument:
-	@cd $(srcdir)			\
-	&& git -C  grep -w print_ver_ tests\
+	@git -C $(srcdir) grep -w print_ver_ tests			\
 	  | sed 's#:print_ver_##'	\
 	  | { fail=0;			\
 	  while read file name; do	\
-- 
2.22.0



bug#36901: Enhance directory and file moves where target already exists

2019-08-06 Thread Bernhard Voelker
On 8/3/19 8:21 AM, L A Walsh wrote:
> On 2019/08/02 23:10, Assaf Gordon wrote:
>> Specifically, at the top of the page:
>> https://pubs.opengroup.org/onlinepubs/9699919799/utilities/mv.html
>>SYNOPSIS
>>   mv [-if] source_file target_file
>>   mv [-if] source_file... target_dir
>>DESCRIPTION
>>   [...]
>>   In the second synopsis form, mv shall move each file named by a
>>   source_file operand to a destination file in the existing directory
>>   named by the target_dir operand [...] This second form is assumed
>>   when the final operand names an existing directory
>>
>> In this regard GNU 'mv' is compliant with POSIX.

[...]

> mkdir A B
> touch A/foo B/fee
> mv A B
> 
> It B exists and is not empty.  Ergo, it is not following the 
> requirement that the directory must be empty or not exist.

There no such condition in the POSIX citation (nor in the whole mv(1) spec)
about whether 'B' is empty or not.  The question is whether the target operant
is an existing directory (or a symlink which resolves to one).

Regards,
Berny