File: pkgsel

package info (click to toggle)
base-config 2.53.10.3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,072 kB
  • ctags: 36
  • sloc: sh: 1,755; makefile: 101; perl: 48
file content (81 lines) | stat: -rwxr-xr-x 2,452 bytes parent folder | download
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
73
74
75
76
77
78
79
80
81
#!/bin/sh
# Run various programs to select packages to install.
set -e

case "$1" in
''|new)
	# Make dpkg not background itself to get a shell.
	export DPKG_NO_TSTP="yes"

	# Set DEBIAN_FRONTEND, since some evil postinst scripts still
	# check it directly.
	if [ -z "$DEBIAN_FRONTEND" ] ; then
		DEBIAN_FRONTEND=$($0 get_frontend 4>&1 || true)
		if [ "$DEBIAN_FRONTEND" ] ; then
			export DEBIAN_FRONTEND
		else
			unset DEBIAN_FRONTEND || true
		fi
	fi

	# Make popularity-contest be selected for installation by default. It
	# lets the user choose whether or not to enable it. We need more
	# people using this so we can hope to get better data about who is
	# using what packages in debian.
	# (Doesn't work with new tasksel.)
	#echo popularity-contest install | dpkg --set-selections
	
	# X needs some packages installed before its debconf config is run
	# to make it do hardware autodetection. The only way to make sure these
	# are installed properly is to install them now, before packages are
	# selected. This way, even if the user picks xserver-xfree86 in
	# aptitude and installs using aptitude, they will be available.
	for pkg in mdetect read-edid ; do
		if ! dpkg --get-selections | grep "$pkg" | grep -q install; then
			if apt-get -y -f install "$pkg"; then
				extra="$pkg $extra"
			fi
		fi
	done

	if which tasksel >/dev/null 2>&1; then
		if [ "$1" = new ]; then
			tasksel_param="--new-install"
		fi
		if ! tasksel -ris $tasksel_param; then
			$0 failure
			exit 1
		fi
	fi

	if [ "$KEEP_BASE_DEBS" != yes ]; then
		apt-get -f clean || true
	fi
	
	# If X was not installed, remove the hardware detection
	# programs. Of course, this fails if the user manually choose
	# to install these, or wants them installed for some other reason.
	# But I cannot help that.
	if ! dpkg --get-selections | grep xserver-xfree86 | grep -q install; then
		if [ -n "$extra" ] ; then
			dpkg --purge $extra || true
		fi
	fi
	;;
failure)
	# This branch is reached if there was some problem installing.
	# It uses debconf (which the other branch cannot use) to explain
	# the failure to the user.
	. /usr/share/debconf/confmodule
	db_settitle base-config/title
	db_fset base-config/install-problem seen false
	db_input critical base-config/install-problem || true
	db_go || true
	;;
get_frontend)
	. /usr/share/debconf/confmodule
	db_get debconf/frontend
	# Convert to lower case to avoid warning from newer debconf
	echo $RET | tr A-Z a-z >&4
	;;
esac