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 82 83 84 85 86 87
|
#!/bin/sh -e
#
# base-config postinst
#
# This takes the answers to the questions the config script asked, and acts on
# them.
# We don't trap "" so that our children (i.e. dselect etc) don't ignore
# these signals.
trap : 1 2 3 15
#DEBHELPER#
# Make dpkg not background itself to get a shell.
export DPKG_NO_TSTP="yes"
# Make sure this isn't the initial install onto boot-floppies
/usr/share/base-config/stage1 || exit 0
# TODO: Why is this done here? I'd like to move it elsewhere.
if [ -f /etc/inittab.real ]; then
mv -f /etc/inittab.real /etc/inittab
sync
kill -HUP 1
fi
# Now a large block of code that deals with installing packages.
# If dpkg is currently running (say this package is being installed,
# vs. reconfigured), don't run this block; dpkg is not re-entrant.
if /usr/lib/base-config/checklock /var/lib/dpkg/lock; then
# Remove pcmcia if it is not needed.
/usr/share/base-config/stage2
# Update available file along with all else; tasksel needs it.
# The echo is there just in case it prompts for a keypress, which
# should never happen.
clear
echo | dselect update || true
# This returns 0 if tasksel should be run; 1 if dselect should be run
# (and if dselect should be run, displays a dselect help message).
if /usr/share/base-config/stage3; then
clear
PERL_BADLANG=0 tasksel -riq || true
clear
# Try to auto-detect X server iff the packages they selected
# resulted in some x server already being selected. (In
# parctice, this means task-x-window-system-core was
# selected or pulled in by a dependency.)
if [ -x /usr/bin/anXious ]; then
(apt-get -sy dselect-upgrade 2>&1) | grep ^Inst | grep -q xserver- && \
anXious || true
# anXious for some reason leaves the console in raw mode.
reset
fi
# Install selected packages. If necessary, prompt user to
# retry.
while ! PERL_BADLANG=0 /usr/lib/dpkg/methods/apt/install &&
/usr/share/base-config/stage6; do
clear
done
else
clear
# Turn off i18n since perl doesn't like it. -Joey
#
# XXXXX FIXME: actually perl is right, but overly picky:
# LANG=ll is *not* correct. LANG=ll_CC is. Try:
# LANG=fr perl -e 'print "test\n";'
# LANG=fr_FR perl -e 'print "test\n";'
# PERL_BADLANG=0 LANG=fr perl -e 'print "test\n";'
# and boot-floppies should probably handle locales as a ll_CC
# type variable since es_ES is notably different of es_MX
# (or fr_FR and fr_CA, etc...)
#
# -Vincent
PERL_BADLANG=0 dselect || true
fi
# Ask if ppp should be turned off.
/usr/share/base-config/stage4
fi
# Display any final messages.
/usr/share/base-config/stage5
# Delete dboostrap_settings file now that we're done with it
rm -f /root/dbootstrap_settings
|