86d3591b7d23d02512ca09717dc215c8804c50e7
[shellsnippets/shellsnippets.git] / posix / pbuilder-hooks / D25backports
1 #!/bin/sh
2 # $MirOS: contrib/hosted/tg/deb/hookdir/D25backports,v 1.7 2019/12/04 07:32:25 tg Exp $
3 #-
4 # Not complicated enough for copyright.
5 #
6 # Note: Secure APT is a PITA, for old versions.
7 #
8 # Note: This will not work with pbuilder-satisfydepends-classic,
9 # and on sarge not with pbuilder-satisfydepends (aptitude) either.
10 # On stretch (new enough for pbuilder-satisfydepends-apt) it will
11 # not work with that, but with pbuilder-satisfydepends-aptitude‚Ķ
12
13 unset LANGUAGE
14 LC_ALL=C; export LC_ALL
15
16 d=${DIST%/*}
17 d=${d%-backports*}
18 case $d in
19 (sarge|etch|lenny|squeeze)
20         echo deb http://archive.debian.org/debian-backports/ \
21             $d-backports main >>/etc/apt/sources.list
22         ;;
23 (wheezy|jessie)
24         echo deb http://archive.debian.org/debian/ \
25             $d-backports main >>/etc/apt/sources.list
26         ;;
27 (stretch|buster|bullseye)
28         echo deb http://deb.debian.org/debian/ \
29             $d-backports main >>/etc/apt/sources.list
30         ;;
31 (dapper|hardy|jaunty|karmic|lucid|maverick|natty|oneiric|quantal|raring|saucy|utopic|vivid|wily|yakkety|zesty|artful)
32         echo deb http://old-releases.ubuntu.com/ubuntu/ \
33             $d-updates main universe >>/etc/apt/sources.list
34         echo deb http://old-releases.ubuntu.com/ubuntu/ \
35             $d-backports main universe >>/etc/apt/sources.list
36         ;;
37 (precise|trusty|xenial|bionic|cosmic|disco|eoan|focal)
38         echo deb http://archive.ubuntu.com/ubuntu/ \
39             $d-updates main universe >>/etc/apt/sources.list
40         echo deb http://archive.ubuntu.com/ubuntu/ \
41             $d-backports main universe >>/etc/apt/sources.list
42         ;;
43 (*)
44         echo >&2 W: D25backports: ignoring unknown DIST "'$DIST'"
45         exit 0
46         ;;
47 esac
48
49 apt-get update