-
Notifications
You must be signed in to change notification settings - Fork 6
/
chroot-sources
executable file
·72 lines (62 loc) · 2.47 KB
/
chroot-sources
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/bash
# Usage (e.g.): sbuild --chroot-sources=/path/to/chroot-sources
# Adjust /etc/apt/sources.list.d/debathena.list using the
# DEBATHENA_RELEASE environment variable (set to either "production",
# "-proposed", or "-development"),
#
# If DEBATHENA_RELEASE is unset, assume we're building out of -development.
# DEBATHENA_BUILD_DIST is the target build distribution. Note:
# SBUILD_BUILD_CONF_DISTRIBUTION is not set as of sbuild 0.60.6 or
# later. An environment_filter in ~/.sbuildrc must be configured to
# allow passing of this variable.
: ${DEBATHENA_RELEASE=-development}
: ${DEBATHENA_MIRROR:=http://debathena.mit.edu/apt}
: ${DEBATHENA_BUILD_DIST:="$SBUILD_BUILD_CONF_DISTRIBUTION"}
if [ -z "$DEBATHENA_BUILD_DIST" ]; then
echo "Warning: DEBATHENA_BUILD_DIST is unset or empty!" >&2
if [ -r /etc/lsb-release ]; then
echo "Attempting to guess dist from lsb-release..." >&2
. /etc/lsb-release
if [ -n "$DISTRIB_CODENAME" ]; then
DEBATHENA_BUILD_DIST="$DISTRIB_CODENAME"
fi
fi
if [ -z "$DEBATHENA_BUILD_DIST" ] && echo "$SCHROOT_CHROOT_NAME" | \
egrep -q "^[a-z]+-(amd64|i386)(-sbuild)?$"; then
echo "Attempting to guess dist from chroot name..." >&2
DEBATHENA_BUILD_DIST=$(echo "$SCHROOT_CHROOT_NAME" | cut -d\- -f 1)
fi
fi
if [ -z "$DEBATHENA_BUILD_DIST" ]; then
echo "*** ERROR: Cannot determine distribution to build. Stop." >&2
exit 1
fi
dist="$DEBATHENA_BUILD_DIST"
list=/etc/apt/sources.list.d/debathena.list
rm -f "$list"
cat >>"$list" <<EOF
deb $DEBATHENA_MIRROR $dist debathena debathena-config
deb-src $DEBATHENA_MIRROR $dist debathena debathena-config
EOF
if [ "$DEBATHENA_RELEASE" = "-staging" ]; then
cat >>"$list" <<EOF
deb $DEBATHENA_MIRROR ${dist}-staging debathena debathena-config
deb-src $DEBATHENA_MIRROR ${dist}-staging debathena debathena-config
EOF
DEBATHENA_RELEASE="-development"
fi
if [ "$DEBATHENA_RELEASE" = "-proposed" ] || [ "$DEBATHENA_RELEASE" = "-development" ]; then
cat >>"$list" <<EOF
deb $DEBATHENA_MIRROR ${dist}-proposed debathena debathena-config
deb-src $DEBATHENA_MIRROR ${dist}-proposed debathena debathena-config
EOF
fi
if [ "$DEBATHENA_RELEASE" = "-development" ]; then
cat >>"$list" <<EOF
deb $DEBATHENA_MIRROR ${dist}-development debathena debathena-config
deb-src $DEBATHENA_MIRROR ${dist}-development debathena debathena-config
EOF
fi
apt-key add /afs/sipb.mit.edu/project/debathena/apt/debathena-archive-keyring.asc
dpkg --remove pkg-create-dbgsym
DEBIAN_FRONTEND=noninteractive apt-get update