]> git.ipfire.org Git - thirdparty/linux-firmware.git/commitdiff
copy-firmware.sh: Run check_whence.py only if in a git repo
authorJuerg Haefliger <juerg.haefliger@canonical.com>
Fri, 8 Nov 2024 15:30:28 +0000 (16:30 +0100)
committerJuerg Haefliger <juerg.haefliger@canonical.com>
Fri, 8 Nov 2024 15:42:31 +0000 (16:42 +0100)
check_whence.py requires the current tree to be a git repo so run it only
if that is indeed the case.

Signed-off-by: Juerg Haefliger <juerg.haefliger@canonical.com>
copy-firmware.sh

index dcb3b92c7229901886a79359e3c7024692a3f94b..1a1094ae7411126680363b3bc18a88f27faf0068 100755 (executable)
@@ -65,8 +65,10 @@ if test -d "$destdir"; then
     find "$destdir" -type d -empty >/dev/null || warn "destination folder is not empty."
 fi
 
-$verbose "Checking that WHENCE file is formatted properly"
-./check_whence.py || err "check_whence.py has detected errors."
+if test -e .git/config; then
+    $verbose "Checking that WHENCE file is formatted properly"
+    ./check_whence.py || err "check_whence.py has detected errors."
+fi
 
 # shellcheck disable=SC2162 # file/folder name can include escaped symbols
 grep -E '^(RawFile|File):' WHENCE | sed -E -e 's/^(RawFile|File): */\1 /;s/"//g' | while read k f; do