From b76d9d6067dc087cbfd81fbed561d49754ad9420 Mon Sep 17 00:00:00 2001 From: Rory Fewell Date: Sat, 15 Feb 2025 17:29:30 +0000 Subject: [PATCH] Bugfix: Fixes #428, chkdeps - failure when symlinks not followed after downloading project via GitHub ZIP --- packaging/chkdeps.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packaging/chkdeps.sh b/packaging/chkdeps.sh index cbf4262..be17265 100755 --- a/packaging/chkdeps.sh +++ b/packaging/chkdeps.sh @@ -79,6 +79,22 @@ check_deps() return 0 fi + # Unsure of the exact cause, but sometimes when users download the project + # via the 'Download ZIP' option on GitHub, symlinks become normal files + # + # Here we check if the first line of the deps file is valid - if it isn't, + # it's very likely to be a symlink, so resolve it and then continue as + # normal + # + local dep_firstline=$(cat "${full_deps_path}" | head --lines=1) + + if [[ ! "${dep_firstline}" =~ ^(bt|rt|bt,rt): ]] + then + full_deps_path=`realpath "${full_target_dir}/${dep_firstline}"` + fi + + # Ask depmap to map the dependencies to distro packages + # local required_deps required_deps=`python3 ${DEPMAP_PY} ${full_deps_path} ${DIST_ID}`