This commit is contained in:
2024-12-04 21:17:59 +03:00
parent dea7d7cd0e
commit c7ff1d2b5c
14 changed files with 273 additions and 272 deletions

View File

@@ -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