File: postinst

package info (click to toggle)
finish-install 2.22
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 404 kB
  • ctags: 5
  • sloc: sh: 212; makefile: 37
file content (44 lines) | stat: -rwxr-xr-x 917 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
#!/bin/sh

. /usr/share/debconf/confmodule

set -e

log() {
	logger -t finish-install "$@"
}

partsdir="/usr/lib/finish-install.d"
scriptcount=$(ls "$partsdir"/* | wc -l)

db_progress START 0 $scriptcount finish-install/progress/title

for script in "$partsdir"/*; do
	base=$(basename $script | sed 's/[0-9]*//')
	if ! db_progress INFO finish-install/progress/$base; then
		db_subst finish-install/progress/fallback SCRIPT "$base"
		db_progress INFO finish-install/progress/fallback
	fi

	if [ -x "$script" ] ; then
		log "info: Running $script"
		# Else needed so we don't loose the exit code
		if log-output -t finish-install "$script"; then
			:
		else
			code="$?"
			if [ "$code" = 10 ]; then
				log "$script backed up"
				db_progress STOP
				exit 10
			fi
			log "warning: $script returned error code $code"
		fi
	else
		log "error: Unable to execute $script"
	fi

	db_progress STEP 1
done

db_progress STOP