File: 01setup

package info (click to toggle)
apt-setup 1%3A0.127
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 2,524 kB
  • ctags: 21
  • sloc: sh: 1,152; makefile: 12
file content (32 lines) | stat: -rwxr-xr-x 644 bytes parent folder | download | duplicates (4)
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
#!/bin/sh
set -e

. /usr/share/debconf/confmodule

file="$1"

# add old file as comments
sed 's/^/# /' < $ROOT/etc/apt/sources.list | sed 's/^# # */# /' > $file

# start out with old configuration, if any
if [ -e $ROOT/etc/apt/apt.conf ]; then
	cp -a $ROOT/etc/apt/apt.conf $ROOT/etc/apt/apt.conf.new
else
	>$ROOT/etc/apt/apt.conf.new
fi

chroot=
if [ "$ROOT" ]; then
	chroot=chroot
fi

db_get apt-setup/multiarch
if [ "$RET" ]; then
	for arch in $RET; do
		$chroot $ROOT dpkg --add-architecture "$arch"
	done
else
	for arch in $($chroot $ROOT dpkg --print-foreign-architectures); do
		$chroot $ROOT dpkg --remove-architecture "$arch"
	done
fi