refactor
This commit is contained in:
@@ -23,24 +23,28 @@ find /var/cache/debconf/ ! -type d -wholename '/var/cache/debconf/*-old' -delete
|
||||
|
||||
__t=$(mktemp) ; : "${__t:?}"
|
||||
debconf_trim_i18n() {
|
||||
mawk 'BEGIN { m = 0 }
|
||||
$0 == "" { print }
|
||||
/^[^[:space:]]/ {
|
||||
if ($1 ~ "\.[Uu][Tt][Ff]-?8:") { m = 1; next; }
|
||||
m = 0; print $0;
|
||||
}
|
||||
/^[[:space:]]/ {
|
||||
if (m == 1) next;
|
||||
print $0;
|
||||
}' < "$1" > "${__t}"
|
||||
cat < "${__t}" > "$1"
|
||||
mawk 'BEGIN { m = 0; }
|
||||
$0 == "" { print; }
|
||||
/^[^[:space:]]/ {
|
||||
if ($1 ~ "\.[Uu][Tt][Ff]-?8:") {
|
||||
m = 1;
|
||||
next;
|
||||
}
|
||||
m = 0;
|
||||
print $0;
|
||||
}
|
||||
/^[[:space:]]/ {
|
||||
if (m == 1) next;
|
||||
print $0;
|
||||
}' < "$1" > "${__t}"
|
||||
cat < "${__t}" > "$1"
|
||||
}
|
||||
|
||||
debconf_trim_i18n /var/cache/debconf/templates.dat
|
||||
while read -r tmpl ; do
|
||||
[ -n "${tmpl}" ] || continue
|
||||
[ -s "${tmpl}" ] || continue
|
||||
debconf_trim_i18n "${tmpl}"
|
||||
[ -n "${tmpl}" ] || continue
|
||||
[ -s "${tmpl}" ] || continue
|
||||
debconf_trim_i18n "${tmpl}"
|
||||
done <<EOF
|
||||
$(find "${DPKG_ADMINDIR}/info/" -type f -name '*.templates' | sort -V)
|
||||
EOF
|
||||
|
Reference in New Issue
Block a user