Skip to content

Commit

Permalink
msys2-dbadd: limit packages with embedded signatures to those require…
Browse files Browse the repository at this point in the history
…d for updating

This allows us to remove all embedded signatures while allowing 3 year old
installations using pacman v5 to still update.
  • Loading branch information
lazka committed May 11, 2024
1 parent 1a3f9fc commit 5531410
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions msys2-dbadd
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,27 @@ update_packages() {
local srcpath="${1}"
shift

# Skip embedded signatures for everything but msys
# https://github.com/msys2/msys2-devtools/issues/5
local repo_options=()
if [ "${repo}" = "msys" ]; then
repo_options=(--include-sigs)
fi

local files=( $(find "${staging}/${path}" -name "*.pkg.tar.*" -not -name "*.sig") )
if [ "${#files[@]}" -gt 0 ]
then
echo "==> ${path}"

# Add embedded signatures for all core/runtime packages and msys2-keyring, so that pacman v5 users have a transition path
# https://github.com/msys2/msys2-devtools/issues/5
local include_sigs=(
"bash" "filesystem" "mintty" "msys2-runtime" "msys2-runtime-devel"
"pacman" "pacman-mirrors" "msys2-keyring" "msys2-runtime-3.4"
"msys2-runtime-3.3" "msys2-runtime-3.4-devel" "msys2-runtime-3.3-devel")
local package_basename="${path##*/}"
local package_name="$(echo "${package_basename}" | rev | cut -d"-" -f4- | rev)"
local repo_options=()
for sig_pkg in "${include_sigs[@]}"; do
if [[ "$package_name" == "$sig_pkg" ]]; then
repo_options=(--include-sigs)
break
fi
done

cp "${pub}/${path}/${repo}".{db,files}{,.tar.zst}{,.sig} "${staging}/${path}/"
repo-add "${repo_options[@]}" -n -p -s -v "${staging}/${path}/${repo}.db.tar.zst" "${files[@]}"
zstd --quiet --test "${staging}/${path}/${repo}.db.tar.zst"
Expand Down

0 comments on commit 5531410

Please sign in to comment.