[Bug 1022891] Re: Regression bug: can't preseed download location

Siggi Langauf s.langauf at stuttgarter.de
Fri Aug 24 13:50:56 UTC 2012


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

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to msttcorefonts in Ubuntu.
https://bugs.launchpad.net/bugs/1022891

Title:
  Regression bug: can't preseed download location

Status in “msttcorefonts” package in Ubuntu:
  Confirmed

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.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/msttcorefonts/+bug/1022891/+subscriptions




More information about the foundations-bugs mailing list