This file is indexed.

postinst is in console-setup 1.178ubuntu2.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

  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
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#!/bin/sh

set -e

# Source debconf library.
. /usr/share/debconf/confmodule

CONFIGDIR=/etc/console-setup
CONFIGFILE=/etc/default/console-setup

# turn around bug in dpkg (#17624)
# The following line should be uncommented before the next stable
# release of Debian.
#if dpkg --compare-versions "$2" lt-nl 1.82; then
    # Replace directory with symlink.
    if \
        [ ! -L /usr/share/doc/console-setup ] \
        && [ -d /usr/share/doc/console-setup ]
    then
	if rmdir /usr/share/doc/console-setup 2>/dev/null; then
	    ln -sf keyboard-configuration /usr/share/doc/console-setup
	fi
    fi
#fi

if [ "$1" = "configure" -a ! -L "$CONFIGFILE" ]; then
    
    db_get console-setup/codesetcode
    codeset="$RET"
    db_get console-setup/fontface47
    fontface="$RET"
    db_metaget console-setup/use_system_font description
    if [ "$fontface" = "$RET" ]; then
	fontface=''
    fi
    db_metaget console-setup/guess_font description
    if [ "$fontface" = "$RET" ]; then
	fontface=guess
    fi
    db_get console-setup/fontsize
    fontsize="$RET"
    if [ -z "$fontface" ]; then
	fontsize=''
    fi

    db_get console-setup/charmap47
    charmap="${RET:-UTF-8}"

    if [ ! -e $CONFIGFILE ]; then
        case `uname` in
            *Linux*) consoles='/dev/tty[1-6]' ;;
            *FreeBSD*) consoles='/dev/ttyv[0-5]' ;;
        esac
        sed "s|^ *ACTIVE_CONSOLES=.*|ACTIVE_CONSOLES=\"${consoles}\"|" \
            /usr/share/console-setup/console-setup >$CONFIGFILE || true
    fi

    . $CONFIGFILE || true

    CONSOLE_MAP=${CONSOLE_MAP:-$ACM}

# If $CONFFILE is produced by an old version of console-setup(-mini)
    if \
	grep "^ *XKBLAYOUT=" $CONFIGFILE >/dev/null || \
	! grep "^ *CHARMAP=" $CONFIGFILE >/dev/null
    then
	cp -a $CONFIGFILE $CONFIGFILE.tmp

	cat /usr/share/console-setup/console-setup >$CONFIGFILE.tmp

	cat >>$CONFIGFILE.tmp <<EOF

######################################################################
# You can remove the lines that follow.  They contain the contents of
# this file before version 1.47 of console-setup.
######################################################################
EOF
	sed 's/^/# /' <$CONFIGFILE >>$CONFIGFILE.tmp

	mv -f $CONFIGFILE.tmp $CONFIGFILE
    fi

    # Ensure we do not mess up the config file's ownership and permissions.
    cp -a -f $CONFIGFILE $CONFIGFILE.tmp

    # If the admin deleted or commented some variables but then set
    # them via debconf, (re-)add them to the conffile.
    for var in \
	ACTIVE_CONSOLES CHARMAP CODESET FONTFACE FONTSIZE
    do
        if ! grep "^ *${var}=" $CONFIGFILE >/dev/null; then
	    echo "${var}=" >>$CONFIGFILE
	fi
    done

    if [ "$FONT" ] && ! grep "^ *FONT=" $CONFIGFILE >/dev/null; then
	echo "FONT=" >>$CONFIGFILE
    fi
    if [ "$FONT_MAP" ] && ! grep "^ *FONT_MAP=" $CONFIGFILE >/dev/null; then
	echo "FONT_MAP=" >>$CONFIGFILE
    fi
    if \
	[ "$CONSOLE_MAP" ] \
	&& ! grep "^ *CONSOLE_MAP=" $CONFIGFILE >/dev/null \
	&& ! grep "^ *ACM=" $CONFIGFILE >/dev/null
    then
	echo "CONSOLE_MAP=" >>$CONFIGFILE
    fi
    
    sed \
	-e "s|^ *ACTIVE_CONSOLES=.*|ACTIVE_CONSOLES=\"${ACTIVE_CONSOLES:-guess}\"|" \
	-e "s|^ *FONT=.*|FONT=\"$FONT\"|" \
	-e "s|^ *FONT_MAP=.*|FONT_MAP=\"$FONT_MAP\"|" \
	-e "s|^ *CONSOLE_MAP=.*|CONSOLE_MAP=\"$CONSOLE_MAP\"|" \
	-e "s|^ *ACM=.*|CONSOLE_MAP=\"$CONSOLE_MAP\"|" \
	-e "s|^ *CHARMAP=.*|CHARMAP=\"$charmap\"|" \
	-e "s|^ *CODESET=.*|CODESET=\"$codeset\"|" \
	-e "s|^ *FONTFACE=.*|FONTFACE=\"$fontface\"|" \
	-e "s|^ *FONTSIZE=.*|FONTSIZE=\"$fontsize\"|" \
	<$CONFIGFILE >$CONFIGFILE.tmp
    
    mv -f $CONFIGFILE.tmp $CONFIGFILE

    db_set console-setup/store_defaults_in_debconf_db true
fi

# The second setupcon may start background processes inheriting file
# descriptors from debconf.
db_stop

# We redirect the output so that postinst does not block when ScrollLock is on
# This works even if we are not on the console
setupcon --save-only >/dev/null 2>/dev/null || true
if type plymouth >/dev/null && plymouth --ping; then
    # setting the keymap breaks with plymouth in raw mode, and setting the
    # font will currently also break if on vgacon
    :
elif [ -d /lib/debian-installer ]; then
    setupcon --force >/dev/null 2>/dev/null || true
else
    if ! setupcon >/dev/null 2>/dev/null; then
        cat >&2 <<EOF
Your console font configuration will be updated the next time your system
boots. If you want to update it now, run 'setupcon' from a virtual console.
EOF
    fi
fi

# Automatically added by dh_installdeb/11.1.6ubuntu1
dpkg-maintscript-helper rm_conffile /etc/init/console-font.conf 1.142ubuntu8~ console-setup -- "$@"
# End automatically added section


if type update-initramfs >/dev/null 2>&1; then
    update-initramfs -u
fi

exit 0