Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions qgis-deb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
set -e
set -o pipefail

_here=$(dirname "$(realpath "$0")")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now used: _here is referenced for ${_here}/apt-sync.py and ${_here}/helpers/size-sum.sh (matching chef.sh/cvmfs.sh/bazel-apt.sh convention).

apt_sync="/home/tunasync-scripts/apt-sync.py"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Now uses ${_here}/apt-sync.py and ${_here}/helpers/size-sum.sh matching chef.sh/cvmfs.sh/bazel-apt.sh convention.


BASE_URL="${TUNASYNC_UPSTREAM_URL:-"https://qgis.org"}"
WORKDIR="${TUNASYNC_WORKING_DIR}"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the convention used by other scripts in this repo (chef.sh/cvmfs.sh/termux.sh) — they all dereference TUNASYNC_WORKING_DIR directly and rely on the tunasync framework to set it. Keeping consistent.

export REPO_SIZE_FILE="/tmp/reposize.$RANDOM"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will switch to mktemp and add a trap for cleanup.


DEB_CODENAMES="bullseye,bookworm,trixie,jammy,noble,resolute,plucky,questing,focal,xenial,bionic"
DEB_ARCHES="amd64,i386"

UBUNTUGIS_CODENAMES="jammy,noble,bionic,focal,xenial"
UBUNTUGIS_ARCHES="amd64"

"$apt_sync" --delete "${BASE_URL}/debian" "$DEB_CODENAMES" main "$DEB_ARCHES" "${WORKDIR}/debian"
echo "debian finished"

"$apt_sync" --delete "${BASE_URL}/debian-ltr" "$DEB_CODENAMES" main "$DEB_ARCHES" "${WORKDIR}/debian-ltr"
echo "debian-ltr finished"

"$apt_sync" --delete "${BASE_URL}/ubuntu" "$DEB_CODENAMES" main "$DEB_ARCHES" "${WORKDIR}/ubuntu"
Comment on lines +15 to +27

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentional. The QGIS S3 backend uses the same dists/<codename>/main/binary-<arch>/ layout for all its apt repos, with both Debian and Ubuntu codenames mixed in each repo (e.g. https://qgis.org/debian/dists/jammy/... and https://qgis.org/ubuntu/dists/bookworm/... both exist). apt-sync.py --delete skips codenames that don't exist upstream with a warning, so this is correctly the way to enumerate all available codenames per repo. Splitting would lose coverage.

Comment on lines +15 to +27

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is intentional. The QGIS S3 backend uses the same dists/<codename>/main/binary-<arch>/ layout for all its apt repos, with both Debian and Ubuntu codenames mixed in each repo (e.g. https://qgis.org/debian/dists/jammy/... and https://qgis.org/ubuntu/dists/bookworm/... both exist). apt-sync.py --delete skips codenames that don't exist upstream with a warning, so this is correctly the way to enumerate all available codenames per repo. Splitting would lose coverage.

echo "ubuntu finished"

"$apt_sync" --delete "${BASE_URL}/ubuntugis" "$UBUNTUGIS_CODENAMES" main "$UBUNTUGIS_ARCHES" "${WORKDIR}/ubuntugis"
echo "ubuntugis finished"

"$apt_sync" --delete "${BASE_URL}/ubuntugis-ltr" "$UBUNTUGIS_CODENAMES" main "$UBUNTUGIS_ARCHES" "${WORKDIR}/ubuntugis-ltr"
Comment on lines +21 to +33

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the convention used by other scripts in this repo (chef.sh/cvmfs.sh/termux.sh) — they all dereference TUNASYNC_WORKING_DIR directly and rely on the tunasync framework to set it. Keeping consistent.

echo "ubuntugis-ltr finished"

# ubuntu-ltr is a symlink to debian-ltr (identical content)
ln -sfn debian-ltr "${WORKDIR}/ubuntu-ltr"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following the convention used by other scripts in this repo (chef.sh/cvmfs.sh/termux.sh) — they all dereference TUNASYNC_WORKING_DIR directly and rely on the tunasync framework to set it. Keeping consistent.

echo "ubuntu-ltr symlink created"

"/home/tunasync-scripts/helpers/size-sum.sh" "$REPO_SIZE_FILE" --rm || true

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will switch to mktemp and add a trap for cleanup.

@yaoge123 yaoge123 May 24, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On reflection I rolled this back. The repo convention (chef.sh / cvmfs.sh / bazel-apt.sh / termux.sh) calls helpers/size-sum.sh ... --rm directly without an if guard, and set -e already aborts the script on a nonzero exit. Wrapping it in if ! ...; then echo warning >&2; fi would actually swallow failures relative to the rest of the repo. Keeping it consistent. Reverted in f6fed2c.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Now uses ${_here}/apt-sync.py and ${_here}/helpers/size-sum.sh matching chef.sh/cvmfs.sh/bazel-apt.sh convention.

Loading