Skip to content

Commit 766c792

Browse files
Merge pull request #80 from richardkoehler/fix/linux-raw-tar-and-install
Fix linux release
2 parents b3a52da + 31d30ef commit 766c792

4 files changed

Lines changed: 21 additions & 16 deletions

File tree

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Shell installers must be LF: piping to sh on Linux breaks on CRLF.
2+
scripts/*.sh text eol=lf

.github/workflows/release.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -458,22 +458,19 @@ jobs:
458458
find build -maxdepth 3 -type d 2>/dev/null | head -40 >&2 || true
459459
exit 1
460460
fi
461-
app_dir=$(find "${root}" -type d \( -path "*/dbs_annotator/app" -o -path "*/dbs-annotator/app" \) 2>/dev/null | head -1) || true
462-
if [ -z "${app_dir}" ]; then
463-
stub=$(find "${root}" -type f \( -name dbs-annotator -o -name dbs_annotator \) 2>/dev/null | head -1) || true
464-
if [ -n "${stub}" ]; then
465-
d=$(dirname "${stub}")
466-
while [ "$(basename "${d}")" != "app" ] && [ "${d}" != "/" ] && [ -n "${d}" ]; do
467-
d=$(dirname "${d}")
468-
done
469-
if [ "$(basename "${d}")" = "app" ] && [ -d "${d}/src" ]; then
470-
app_dir=${d}
471-
fi
472-
fi
461+
# There may be multiple */app trees (e.g. shallow copy vs full system package with bin/).
462+
# Pick the *largest* by disk — sources-only is tiny; real Briefcase tree includes bin/, lib/, support.
463+
app_dir=""
464+
if largest=$(find "${root}" -type d -name app 2>/dev/null | while read -r d; do du -sk "$d" 2>/dev/null; done | sort -n | tail -1); then
465+
app_dir=${largest#*[[:space:]]}
473466
fi
474-
if [ -z "${app_dir}" ]; then
475-
echo "::error::Could not find Briefcase 'app' tree under ${root}" >&2
476-
find "${root}" -type d 2>/dev/null | head -80 >&2 || true
467+
if [ -z "${app_dir}" ] || [ ! -d "${app_dir}/bin" ] || [ -z "$(find "${app_dir}/bin" -mindepth 1 -maxdepth 1 2>/dev/null | head -n 1)" ]; then
468+
echo "::error::No Briefcase Linux app/ with a non-empty bin/ under ${root} (raw tar would lack the launcher). Listing app candidates:" >&2
469+
find "${root}" -type d -name app 2>/dev/null | while read -r d; do
470+
echo "--- $d" >&2
471+
du -sh "$d" 2>/dev/null || true
472+
find "${d}/bin" -mindepth 1 -maxdepth 1 2>/dev/null | head -20 >&2 || true
473+
done
477474
exit 1
478475
fi
479476
parent=$(dirname "${app_dir}")

newsfragments/80.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix `scripts/install.sh` for POSIX `sh`, LF line endings, Linux launcher discovery (`bin/`, `dbs_annotator`), and clearer errors when a release raw `.tar.gz` lacks the Briefcase stub. Linux release workflow now selects the full `app/` tree (largest tree with `bin/`) for the raw archive.

scripts/install.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,12 @@ install_linux_tar() {
213213
mkdir -p "$bin_dir"
214214
exe=$(linux_pick_exe "$prefix")
215215
if [ -z "$exe" ] || [ ! -x "$exe" ]; then
216-
echo "Could not find executable under $prefix" >&2; exit 1
216+
if [ -f "$prefix/dbs_annotator/__main__.py" ] && [ ! -d "$prefix/bin" ]; then
217+
echo "Could not find Briefcase launcher under $prefix (missing bin/ stub). Raw .tar.gz for this version is source-only; use the .deb from the same release, or a release built after the raw-tar workflow fix." >&2
218+
else
219+
echo "Could not find executable under $prefix" >&2
220+
fi
221+
exit 1
217222
fi
218223
ln -sf "$exe" "$bin_dir/dbs-annotator"
219224
echo "Installed tree: $prefix"

0 commit comments

Comments
 (0)