From b2666d326a53dd24e2fc832e0c85b351d25fd0ee Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Tue, 14 May 2024 23:21:00 -0700 Subject: [PATCH] gnulib-tool.sh: Don't continue creating testdirs when destdir exists. * gnulib-tool.sh (create-testdir, create-megatestdir): Fail if the destination directory exists instead of creating files and failing to patch test driver. --- ChangeLog | 7 +++++++ gnulib-tool.sh | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 23b489054d..e0c6141e88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2024-05-14 Collin Funk + + gnulib-tool.sh: Don't continue creating testdirs when destdir exists. + * gnulib-tool.sh (create-testdir, create-megatestdir): Fail if the + destination directory exists instead of creating files and failing to + patch test driver. + 2024-05-14 Paul Eggert stdbit: fix dependency diff --git a/gnulib-tool.sh b/gnulib-tool.sh index b5aadcaeaa..12f0b82461 100755 --- a/gnulib-tool.sh +++ b/gnulib-tool.sh @@ -7454,6 +7454,9 @@ s/\([.*$]\)/[\1]/g' if test -z "$destdir"; then func_fatal_error "please specify --dir option" fi + if test -d "$destdir"; then + func_fatal_error "not overwriting destination directory: $destdir" + fi mkdir "$destdir" test -d "$destdir" \ || func_fatal_error "could not create destination directory" @@ -7465,6 +7468,9 @@ s/\([.*$]\)/[\1]/g' if test -z "$destdir"; then func_fatal_error "please specify --dir option" fi + if test -d "$destdir"; then + func_fatal_error "not overwriting destination directory: $destdir" + fi mkdir "$destdir" || func_fatal_error "could not create destination directory" test -n "$auxdir" || auxdir="build-aux" func_create_megatestdir "$destdir" "$*" -- 2.39.5