Package: ttf-mscorefonts-installer
Version: 3.8

The package postinst script contains this bit:

    while ! echo "$http_proxy" | \
        egrep -iq 'https?://[[:alnum:]][-.[:alnum:]]+(:\d+)?/?' &&  \
        [ ! -z "$http_proxy" ] ; do
            db_fset msttcorefonts/http_proxy seen false
            db_input high msttcorefonts/http_proxy
            db_go
            db_get msttcorefonts/http_proxy
            http_proxy=$RET
    done

This appears intended to reject an environment setting of, for example,

    http_proxy=socks5h://proxy.example.com/

as wget(1) (which is used to download the font archives) does not
support SOCKS proxies.

However, note that wget can also be configured to use a proxy via a
wgetrc file, which will override the environment variable. In my
deployment, I set http_proxy in the environment to a SOCKS server so
that APT will download packages via same, and set http_proxy in
~/.wgetrc to an alternate HTTP proxy so that wget will work. (The latter
proxy happens to be somewhat unreliable, so the SOCKS one is preferable
wherever it can be used.) This has worked fine with everything I've used
save for this package.

The postinst script's validation of $http_proxy is thus not helpful, and
prevents downloading the package and then the fonts in a single APT
invocation. Here is the error I saw in an automated install process:

    Unpacking ttf-mscorefonts-installer (3.8) ...
    Setting up libmspack0:i386 (0.10.1-2) ...
    Setting up cabextract (1.9-3) ...
    Setting up ttf-mscorefonts-installer (3.8) ...
    dpkg: error processing package ttf-mscorefonts-installer (--configure):
     installed ttf-mscorefonts-installer package post-installation script 
subprocess returned error exit status 30
    Processing triggers for libc-bin (2.31-13+deb11u5) ...
    Processing triggers for man-db (2.9.4-2) ...
    Processing triggers for fontconfig (2.13.1-4.2) ...
    Errors were encountered while processing:
     ttf-mscorefonts-installer
    E: Sub-process /usr/bin/dpkg returned an error code (1)

If I attempt to complete the installation by hand, I get a debconf
dialog that pops back up repeatedly unless I remove the SOCKS proxy
setting. Given that the dialog makes no mention of wget's limited proxy
support, and neglects to give any sort of error message, this behavior
is quite user-hostile.

Note that the Ubuntu version of this package not only gets rid of the
$http_proxy validation, it also eliminates the msttcorefonts/http_proxy
debconf setting, and the questionable behavior of storing the install-
time value of $http_proxy therein. In fact, the package scripts make no
mention of a proxy at all. That not only seems to me like the right
approach (in that it avoids making assumptions on how the user manages
their proxies), it appears to be the convention followed by other
packages that perform an embedded download, like libdvd-pkg.

Given that the Ubuntu package has diverged slightly from the Debian one,
this may be a good opportunity/excuse to merge them back together.


--Daniel


-- 
Daniel Richard G. || sk...@iskunk.org
My ASCII-art .sig got a bad case of Times New Roman.

Reply via email to