setup: Merge multiple setup-apt-repo scripts into one.

This moves the `.asc` files into subdirectories, and writes out the
according `.list` files into them.  It moves from templates to
written-out `.list` files for clarity and ease of
implementation (Debian and Ubuntu need different templates for
`zulip`), and as a way of making explicit which releases are supported
for each list.  For the special-case of the PGroonga signing key, we
source an additional file within the directory.

This simplifies the process for adding another class of `.list` file.
This commit is contained in:
Alex Vandiver
2021-05-21 16:23:43 -07:00
committed by Tim Abbott
parent 7d1db086c3
commit f3eea72c2a
22 changed files with 131 additions and 203 deletions

View File

@@ -0,0 +1,2 @@
deb http://www.ksplice.com/apt bionic ksplice
deb-src http://www.ksplice.com/apt bionic ksplice

View File

@@ -0,0 +1,2 @@
deb http://www.ksplice.com/apt focal ksplice
deb-src http://www.ksplice.com/apt focal ksplice

View File

@@ -0,0 +1,5 @@
deb http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main
deb-src http://apt.postgresql.org/pub/repos/apt/ bionic-pgdg main
deb http://ppa.launchpad.net/groonga/ppa/ubuntu bionic main
deb-src http://ppa.launchpad.net/groonga/ppa/ubuntu bionic main

View File

@@ -0,0 +1,2 @@
deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main
deb-src http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main

View File

@@ -0,0 +1,2 @@
deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main
deb-src http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main

View File

@@ -0,0 +1,5 @@
deb http://apt.postgresql.org/pub/repos/apt/ cosmic-pgdg main
deb-src http://apt.postgresql.org/pub/repos/apt/ cosmic-pgdg main
deb http://ppa.launchpad.net/groonga/ppa/ubuntu cosmic main
deb-src http://ppa.launchpad.net/groonga/ppa/ubuntu cosmic main

View File

@@ -0,0 +1,41 @@
#!/usr/bin/env bash
if [[ ! -e /usr/share/doc/groonga-apt-source/copyright ]]; then
remove_pgroonga_apt_tmp_dir() {
rm -rf "$pgroonga_apt_tmp_dir"
}
pgroonga_apt_tmp_dir=$(mktemp --directory)
trap remove_pgroonga_apt_tmp_dir EXIT
{
cd "$pgroonga_apt_tmp_dir" || exit 1
tmp_gpg_home=.gnupg
pgroonga_apt_sign_key="$LIST_PATH/pgroonga-packages.groonga.org.asc"
gpg --homedir="$tmp_gpg_home" --import "$pgroonga_apt_sign_key"
# Find fingerprint of the first key.
pgroonga_apt_sign_key_fingerprint=$(
gpg --homedir="$tmp_gpg_home" --with-colons --list-keys \
| grep '^fpr:' \
| cut --delimiter=: --fields=10 \
| head --lines=1
)
release=$(lsb_release -sc)
distribution=$(lsb_release -si | tr '[:upper:]' '[:lower:]')
groonga_apt_source_deb="groonga-apt-source-latest-$release.deb"
groonga_apt_source_deb_sign="$groonga_apt_source_deb.asc.$pgroonga_apt_sign_key_fingerprint"
wget "https://packages.groonga.org/$distribution/$groonga_apt_source_deb"
wget "https://packages.groonga.org/$distribution/$groonga_apt_source_deb_sign"
gpg \
--homedir="$tmp_gpg_home" \
--verify \
"$groonga_apt_source_deb_sign" \
"$groonga_apt_source_deb"
# To suppress the following warning by "apt-get install":
# N: Download is performed unsandboxed as root as file
# '.../groonga-apt-source-latest-$release.deb' couldn't be
# accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
chown _apt .
apt-get -y install "./$groonga_apt_source_deb"
}
touch "$STAMP_FILE"
fi

View File

@@ -0,0 +1,5 @@
deb http://apt.postgresql.org/pub/repos/apt/ disco-pgdg main
deb-src http://apt.postgresql.org/pub/repos/apt/ disco-pgdg main
deb http://ppa.launchpad.net/groonga/ppa/ubuntu disco main
deb-src http://ppa.launchpad.net/groonga/ppa/ubuntu disco main

View File

@@ -0,0 +1,5 @@
deb http://apt.postgresql.org/pub/repos/apt/ eoan-pgdg main
deb-src http://apt.postgresql.org/pub/repos/apt/ eoan-pgdg main
deb http://ppa.launchpad.net/groonga/ppa/ubuntu eoan main
deb-src http://ppa.launchpad.net/groonga/ppa/ubuntu eoan main

View File

@@ -0,0 +1,5 @@
deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main
deb-src http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main
deb http://ppa.launchpad.net/groonga/ppa/ubuntu focal main
deb-src http://ppa.launchpad.net/groonga/ppa/ubuntu focal main

View File

@@ -0,0 +1,5 @@
deb http://apt.postgresql.org/pub/repos/apt/ groovy-pgdg main
deb-src http://apt.postgresql.org/pub/repos/apt/ groovy-pgdg main
deb http://ppa.launchpad.net/groonga/ppa/ubuntu groovy main
deb-src http://ppa.launchpad.net/groonga/ppa/ubuntu groovy main

View File

@@ -0,0 +1,2 @@
deb http://debathena.mit.edu/apt bionic debathena debathena-config
deb-src http://debathena.mit.edu/apt bionic debathena debathena-config