From a3f1b476c71154478fe844ea293adc399ccd9271 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Mon, 3 Jun 2024 07:28:26 +0100 Subject: [PATCH] setup-hooks/set-source-date-epoch-to-latest.sh: handle $path that starts with dash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without the change `updateSourceDateEpoch` fails on tarballs like `diffoscope-269` that contain single top-level `-269` root as: diffoscope> source root is -269 diffoscope> find: unknown predicate `-269' diffoscope> chmod: invalid mode: ‘-269’ diffoscope> Try 'chmod --help' for more information. Currently `diffoscope-269` has a `sourceRoot = "./-269";` workaround to bypass the failure. Co-authored-by: Philip Taron --- .../setup-hooks/set-source-date-epoch-to-latest.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/build-support/setup-hooks/set-source-date-epoch-to-latest.sh b/pkgs/build-support/setup-hooks/set-source-date-epoch-to-latest.sh index ae34ffec4854..a9a0dc689086 100644 --- a/pkgs/build-support/setup-hooks/set-source-date-epoch-to-latest.sh +++ b/pkgs/build-support/setup-hooks/set-source-date-epoch-to-latest.sh @@ -1,5 +1,8 @@ updateSourceDateEpoch() { local path="$1" + # Avoid passing option-looking directory to find. The example is diffoscope-269: + # https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/378 + [[ $path == -* ]] && path="./$path" # Get the last modification time of all regular files, sort them, # and get the most recent. Maybe we should use