Regression bug: can't preseed download location

Bug #1022891 reported by Ballock
72
This bug affects 15 people
Affects Status Importance Assigned to Milestone
msttcorefonts (Ubuntu)
In Progress
High
Siggi Langauf

Bug Description

For some time already we have been using preseed to specify our local repository containing the Microsoft fonts. The main reason for this is that we have a pretty complicated proxy environment and it's much easier to provide the local repository directly.

So we have used those preseed entries:
ttf-mscorefonts-installer msttcorefonts/dlurl string http://@HOSTNAME@@DIRECTORY@/msttcorefonts/
ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula boolean true

The postinst script says it all:
# FIXME: we don't have a way to use an alternate download source here.
db_get msttcorefonts/dlurl
URLOVERRIDE=$RET

The rules file seems to generate a static URLROOT pointing to http://downloads.sourceforge.net/corefonts/ and the URLOVERRIDE is ignored.

Our 12.04 workstations have some real issues with that. We have not worked that around yet.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in msttcorefonts (Ubuntu):
status: New → Confirmed
Revision history for this message
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/postinst.in
--- msttcorefonts-3.4ubuntu3/debian/postinst 2012-04-07 22:49:32.000000000 +0200
+++ msttcorefonts-hotfix/debian/postinst.in 2012-08-24 14:49:45.000000000 +0200
@@ -6,10 +6,21 @@
 db_get msttcorefonts/dldir
 LOCALCOPY=$RET

-# FIXME: we don't have a way to use an alternate download source here.
+URLROOT=#URLROOT#
 db_get msttcorefonts/dlurl
 URLOVERRIDE=$RET

+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 >$DLFILE.new \
+ && mv $DLFILE.new $DLFILE
+ echo "dlurl sed -e \"s/^Url: .*(\/[^/]+.exe)/Url: $REPLACE\1/\" <$DLFILE >$DLFILE.new"
+ cp $DLFILE /usr/local/ttf-mscorefonts-installer.dlfile
+fi
+
 stamp_file=/var/lib/update-notifier/package-data-downloads/ttf-mscorefonts-installer

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

As you may have noted, I had to rename "debian/postinst" to "debian/postinst.in" 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 postinst.in:

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

 override_dh_auto_install:
+ sed -e 's/#URLROOT#/'$$(echo $(URLROOT)|sed -e 's/\//\\\//g')'/' <debian/postinst.in >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...

Revision history for this message
Siggi Langauf (s-langauf) wrote :

Ooops, the patch in above comment did contain two lines of debugging that should really not be in there.

Attached is a complete patch for the issue. It should be ready to apply with "patch -p1" from the source dir.

Don't forget to remove the now-generated debian/postinst from the patched source and to add the correct signature to debian/changelog!

Hope that helps speed things up...

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "complete patch for the issue" of this bug report has been identified as being a patch in the form of a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Changed in msttcorefonts (Ubuntu):
importance: Undecided → High
tags: added: regression-release
Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Thanks for your patch! Unfortunately, it cannot be included in Ubuntu for the following reasons:
 * it ships a new postinst.in which is used to update postinst via a sed in debian/rules. This is messy and postinst should be adjusted directly with no changes to debian/rules or the additional file.
 * the file postinst.in intends to update /usr/share/package-data-downloads/ttf-mscorefonts-installer via some brittle regular expressions and sed calls (fyi, you might be interested in 'sed -i' for future scripting). A better solution is to simply adjust update-ms-fonts to honor URLOVERRIDE

Unsubscribing ubuntu-sponsors for now. Please feel free to update and mark this bug back to 'NEW' and resubscribing ubuntu-sponsors after updating the patch. Thanks again.

Changed in msttcorefonts (Ubuntu):
status: Confirmed → In Progress
assignee: nobody → Siggi Langauf (s-langauf)
Revision history for this message
Thijs Kinkhorst (kink) wrote :

Removed patch tag as per above.

Revision history for this message
Margarita Manterola (marga-9) wrote :

Hi, it's been almost a year and this bug is still present. This is a serious regression, it would be nice if trusty wouldn't be released with it.

Revision history for this message
Margarita Manterola (marga-9) wrote :

Another year has passed and the bug is still present...

Revision history for this message
linuxball (linuxball) wrote :

I have Ubuntu 16.04.1 LTS (xenial) and ttf-mscorefonts-installer (3.4+nmu1ubuntu2).

More than FOUR years have passed and this bug is still not fixed. And it is even worse now: This version does not work any longer with the hard-wired download URLs (which are forwarded to other URLs):

E: Failed to fetch https://vorboss.dl.sourceforge.net/project/corefonts/the fonts/final/andale32.exe 404 Not Found

Revision history for this message
Horst Schirmeier (horst) wrote :

Still broken in 16.10 (yakkety).

[...]
ttf-mscorefonts-installer: downloading http://downloads.sourceforge.net/corefonts/andale32.exe
Err:1 http://downloads.sourceforge.net/corefonts/andale32.exe
  404 Not Found
W: Can't drop privileges for downloading as file '/var/lib/update-notifier/package-data-downloads/partial/andale32.exe' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
E: Failed to fetch https://downloads.sourceforge.net/project/corefonts/the?download&failedmirror=vorboss.dl.sourceforge.net 404 Not Found
E: Download Failed

Workaround: Use the Debian package instead (or completely replace Ubuntu with Debian while you're at it ...).
wget http://ftp.debian.org/debian/pool/contrib/m/msttcorefonts/ttf-mscorefonts-installer_3.6_all.deb
sudo dpkg -i ttf-mscorefonts-installer_3.6_all.deb

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.