Comment 2 for bug 1022891

Siggi Langauf (s-langauf) wrote :

Okay, as this is a real showstopper here, I've just forked the package locally and applied the following changes to fix the issue:

First, I added a little snippet to postinst in order to pull in the override URL from debconf:

diff -u msttcorefonts-3.4ubuntu3/debian/postinst msttcorefonts-hotfix/debian/
--- msttcorefonts-3.4ubuntu3/debian/postinst 2012-04-07 22:49:32.000000000 +0200
+++ msttcorefonts-hotfix/debian/ 2012-08-24 14:49:45.000000000 +0200
@@ -6,10 +6,21 @@
 db_get msttcorefonts/dldir

-# FIXME: we don't have a way to use an alternate download source here.
 db_get msttcorefonts/dlurl

+if test -n "$URLOVERRIDE"; then
+ DLFILE=/usr/share/package-data-downloads/ttf-mscorefonts-installer
+ echo "substituting $URLOVERRIDE for corefonts download URL..."
+ SEARCH=$(echo "$URLROOT"|sed -e 's/\//\\\//g')
+ REPLACE=$(echo "$URLOVERRIDE"|sed -e 's/\//\\\//g')
+ sed -e "s/$SEARCH/$REPLACE/" <$DLFILE >$ \
+ && mv $ $DLFILE
+ echo "dlurl sed -e \"s/^Url: .*(\/[^/]+.exe)/Url: $REPLACE\1/\" <$DLFILE >$"
+ cp $DLFILE /usr/local/ttf-mscorefonts-installer.dlfile

 if dpkg --compare-versions "$2" lt-nl 3.4ubuntu3 \

As you may have noted, I had to rename "debian/postinst" to "debian/" in order to be able to add the base URL from debian/rules during package build time. One could just repeat the URL in debian/postinst, which I found too error-prone. The following line in debian/rules generates postinst from

diff -u msttcorefonts-3.4ubuntu3/debian/rules msttcorefonts-hotfix/debian/rules
--- msttcorefonts-3.4ubuntu3/debian/rules 2012-04-09 07:05:54.000000000 +0200
+++ msttcorefonts-hotfix/debian/rules 2012-08-24 15:36:18.000000000 +0200
@@ -6,6 +6,7 @@
        dh $@

+ sed -e 's/#URLROOT#/'$$(echo $(URLROOT)|sed -e 's/\//\\\//g')'/' <debian/ >debian/postinst
        mkdir -p debian/tmp/usr/share/package-data-downloads
        while read sum file; do \
                echo "Url: $(URLROOT)$$file"; \

Hope that somebody picks this up soon...