From 73e1fa4347d6c81c6e64054957ab436fa358ced1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 6 May 2024 03:48:40 +0200 Subject: Adding upstream version 200+deb10u5. Signed-off-by: Daniel Baumann --- pgdg/apt.postgresql.org.sh | 177 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 177 insertions(+) create mode 100755 pgdg/apt.postgresql.org.sh (limited to 'pgdg/apt.postgresql.org.sh') diff --git a/pgdg/apt.postgresql.org.sh b/pgdg/apt.postgresql.org.sh new file mode 100755 index 0000000..bf7f263 --- /dev/null +++ b/pgdg/apt.postgresql.org.sh @@ -0,0 +1,177 @@ +#!/bin/sh + +# script to add apt.postgresql.org to sources.list + +# from command line +CODENAME="$1" +# lsb_release is the best interface, but not always available +if [ -z "$CODENAME" ]; then + CODENAME=$(lsb_release -cs 2>/dev/null) +fi +# parse os-release (unreliable, does not work on Ubuntu) +if [ -z "$CODENAME" -a -f /etc/os-release ]; then + . /etc/os-release + # Debian: VERSION="7.0 (wheezy)" + # Ubuntu: VERSION="13.04, Raring Ringtail" + CODENAME=$(echo $VERSION | sed -ne 's/.*(\(.*\)).*/\1/') +fi +# guess from sources.list +if [ -z "$CODENAME" ]; then + CODENAME=$(grep '^deb ' /etc/apt/sources.list | head -n1 | awk '{ print $3 }') +fi +# complain if no result yet +if [ -z "$CODENAME" ]; then + cat < /etc/apt/sources.list.d/pgdg.list <