This file is indexed.

postinst is in localepurge 0.7.3.2.

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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
#!/bin/sh

set -e

# Do the debhelper stuff immediately



######################################################
# Only act when we are called to configure the package
if [ "$1" != "configure" ]; then
    /usr/share/localepurge/gen-dpkg-cfg.pl
    exit 0
fi

. /usr/share/debconf/confmodule

##############################################
# The debconf routine for creating $CONFIGFILE
generate_config() {
    
    cat <<EOF
####################################################
# This is the configuration file for localepurge(8).
EOF
    if [ "x$1" = "x1" ]; then
        # Include the old don't modify message
        cat <<EOF
#
#      DO NOT EDIT!
#
# localepurge(8) uses debconf for storing all its 
# configuration. Manual entries to this file will be 
# irreversibly lost after upgrade or reinstallation 
# of localepurge. Configuration should only be done
# using the command
#
#       dpkg-reconfigure localepurge
#
EOF
    fi

    cat <<EOF
####################################################

####################################################
# Uncommenting this string enables the use of dpkg's
# --path-exclude feature.  In this mode, localepurge
# will configure dpkg to exclude the desired locales
# at unpack time.
#
# If enabled, the following 3 options will be
# disabled:
#
#  QUICKNDIRTYCALC
#  SHOWFREEDSPACE
#  VERBOSE
#
# And the following option will be enabled and cannot
# be disabled (unless USE_DPKG is disabled):
#
#  DONTBOTHERNEWLOCALE
#

EOF
    db_get localepurge/use-dpkg-feature
    if [ "$RET" = "true" ] ; then
        echo "USE_DPKG"
    else
        echo "#USE_DPKG"
    fi

    cat <<EOF
####################################################

####################################################
# Uncommenting this string enables removal of localized 
# man pages based on the configuration information for
# locale files defined below:

EOF

    db_get localepurge/mandelete

    if [ "$RET" = "true" ]; then
        echo MANDELETE
    else
        echo '#MANDELETE'
    fi

    cat <<EOF

####################################################
# Uncommenting this string causes localepurge to simply delete
# locales which have newly appeared on the system without
# bothering you about it:

EOF

    db_get localepurge/dontbothernew

    if [ "$RET" = "true" ]; then
        echo '#DONTBOTHERNEWLOCALE'
    else
        echo DONTBOTHERNEWLOCALE
    fi

    cat <<EOF

####################################################
# Uncommenting this string enables display of freed disk
# space if localepurge has purged any superfluous data:

EOF

    db_get localepurge/showfreedspace

    if [ "$RET" = "true" ]; then
        echo SHOWFREEDSPACE
    else
        echo '#SHOWFREEDSPACE'
    fi

    cat <<EOF

#####################################################
# Commenting out this string enables faster but less
# accurate calculation of freed disk space:

EOF

    db_get localepurge/quickndirtycalc

    if [ "$RET" = "true" ]; then
        echo '#QUICKNDIRTYCALC'
    else
        echo QUICKNDIRTYCALC
    fi

cat <<EOF

#####################################################
# Commenting out this string disables verbose output:

EOF

    db_get localepurge/verbose

    if [ "$RET" = "true" ]; then
        echo VERBOSE
    else
        echo '#VERBOSE'
    fi
 
    db_get localepurge/nopurge

    if [ "$RET" = "" ] || [ "$RET" = "PURGE_ALL" ]; then
        db_get localepurge/none_selected
        if [ "$RET" = "false" ]; then
            db_set localepurge/nopurge NEEDSCONFIGFIRST
            cat <<EOF

#################################################################
# Unless configured, the system's locale directories won't be
# touched. Execute "dpkg-reconfigure localepurge" to reconfigure 
# localepurge to make it actually start functioning.
#
# WARNING: Only commenting out the marker line "NEEDSCONFIGFIRST"
#          without having defined *any* locale files to keep below
#          will result in deletion of *all* locale files present
#          on the system. So *first* define which locale files you 
#          want to keep before commenting out the following line.

EOF
        elif [ "$RET" = "yes" ]; then
            db_set localepurge/nopurge PURGE_ALL
            cat <<EOF

#################################################################
# It has explicitly been requested to delete *all* locale files 
# present on the system and this will result in the definite loss 
# of all locale data in "/usr/share/locale/". You should know what
# you are doing or reconfigure "localepurge" as described above.
#################################################################

EOF
        fi
    else
        cat <<EOF

#####################################################
# Following locales won't be deleted from this system
# after package installations done with apt-get(8):

EOF
    fi
    
    db_get localepurge/nopurge
    echo "$RET" | grep -v PURGE_ALL | sed 's/,//g' | tr ' ' '\n'

}

##############################################
# Now deal with the configuration file
CONFIGFILE=/etc/locale.nopurge
TMPFILE="$CONFIGFILE.$$"

# Generate new configuration file
generate_config 0 > "$TMPFILE" 2>&1
# Use ucf to move it into place while preserving user changes
ucf --debconf-ok "$TMPFILE" "$CONFIGFILE"
# And register the file with dpkg
ucfr localepurge $CONFIGFILE

# Clean up and ensure permissions are sane
rm -f $TMPFILE
if [ -f "$CONFIGFILE" ]; then
  chown root: $CONFIGFILE
  chmod 0644 $CONFIGFILE
fi

# generate the dpkg config file if necessary.
/usr/share/localepurge/gen-dpkg-cfg.pl