update
[shellsnippets/shellsnippets.git] / posix / pbuilder-hooks / D25backports
1 #!/bin/sh
2 # $MirOS: contrib/hosted/tg/deb/hookdir/D25backports,v 1.2 2016/10/08 20:44:33 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
11 unset LANGUAGE
12 LC_ALL=C; export LC_ALL
13
14 d=${DIST%/*}
15 d=${d%-backports*}
16 case $d in
17 (sarge|etch|lenny|squeeze)
18         echo deb http://archive.debian.org/debian-backports/ \
19             $d-backports main >>/etc/apt/sources.list
20         ;;
21 (wheezy|jessie)
22         echo deb http://httpredir.debian.org/debian/ \
23             $d-backports main >>/etc/apt/sources.list
24         ;;
25 (*)
26         echo >&2 W: D25backports: ignoring unknown DIST "'$DIST'"
27         exit 0
28         ;;
29 esac
30
31 apt-get update