Debian Bug report logs - #333460
fonty silently overwrites /etc/console-tools/config.d/fonty

version graph

Package: fonty; Maintainer for fonty is (unknown);

Reported by: Jonas Meurer <mejo@debian.org>

Date: Wed, 12 Oct 2005 01:03:02 UTC

Severity: serious

Tags: fixed, patch

Found in version fonty/1.0-23

Fixed in version 1.0-23.2

Done: "Adam D. Barratt" <debian-bts@adam-barratt.org.uk>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Piotr Roszatycki <dexter@debian.org>:
Bug#333460; Package fonty. Full text and rfc822 format available.

Acknowledgement sent to Jonas Meurer <mejo@debian.org>:
New Bug report received and forwarded. Copy sent to Piotr Roszatycki <dexter@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Jonas Meurer <mejo@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: fonty silently overwrites /etc/console-tools/config.d/fonty
Date: Wed, 12 Oct 2005 02:55:31 +0200
Package: fonty
Version: 1.0-23
Severity: serious
Justification: Policy 10.7.3

hello,

the latest upgrade of fonty has overwritten my local settings in
/etc/console-tools/config.d/fonty. It would be better to handle this
file as a configuration file as defined in the debian policy.

The upgrade did not even preserve a backup copy (for example a .dpkg-old
file), it just erased my local settings.

There are several cases where local modifications are required in
/etc/console-tools/config.d/fonty, especially as the debconf
configuration dialog at install/upgrade does not list fonts from other
packages (like fonty-rg). It would be great if that could be improved.

...
 jonas

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.13-1-amd64
Locale: LANG=C, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)

Versions of packages fonty depends on:
ii  console-data            2002.12.04dbs-49 Keymaps, fonts, charset maps, fall
ii  console-tools           1:0.2.3dbs-57    Linux console and font utilities
ii  debconf [debconf-2.0]   1.4.58           Debian configuration management sy

fonty recommends no packages.

-- debconf information:
* fonty/charset: iso15 (Western European + euro)
* fonty/restart: true



Information forwarded to debian-bugs-dist@lists.debian.org, Piotr Roszatycki <dexter@debian.org>:
Bug#333460; Package fonty. Full text and rfc822 format available.

Acknowledgement sent to Christian Aichinger <Greek0@gmx.net>:
Extra info received and forwarded to list. Copy sent to Piotr Roszatycki <dexter@debian.org>. Full text and rfc822 format available.

Message #10 received at 333460@bugs.debian.org (full text, mbox):

From: Christian Aichinger <Greek0@gmx.net>
To: 333460@bugs.debian.org
Cc: control@bugs.debian.org
Subject: Re: fonty silently overwrites /etc/console-tools/config.d/fonty
Date: Thu, 5 Jan 2006 14:50:46 +0100
[Message part 1 (text/plain, inline)]
tags 333460 patch
thanks

On Wed, Oct 12, 2005 at 02:55:31AM +0200, Jonas Meurer wrote:
> the latest upgrade of fonty has overwritten my local settings in
> /etc/console-tools/config.d/fonty. It would be better to handle this
> file as a configuration file as defined in the debian policy.
> 
> The upgrade did not even preserve a backup copy (for example a .dpkg-old
> file), it just erased my local settings.
> 
> There are several cases where local modifications are required in
> /etc/console-tools/config.d/fonty, especially as the debconf
> configuration dialog at install/upgrade does not list fonts from other
> packages (like fonty-rg). It would be great if that could be improved.

I've looked a bit into fixing this problem, and I think I've come up
with a solution.

Fonty manages /etc/console-tools/config.d/fonty itself using the
maintainer scripts, because it needs to set different values
depending on the answer of a debconf question. However in the
postinst step (configure) it overwrites the old config file without
checking for modifications. The relevant piece of code is this:

==================================================================
# install configuration file with debconf
if [ "$1" = "configure" ]; then
    CONFDIR=/etc/console-tools/config.d
    CONF=$CONFDIR/fonty
    RET=""
    db_get fonty/charset || true
    if [ -n "$RET" -a "$RET" != "none" ]; then
[...]
        test -d $CONFDIR || mkdir -p $CONFDIR
        cat > $CONF.dpkg-tmp << END
###DEBCONF###
# the configuration of this file was done by debconf and can be
# overwritten.
#
# you should use dpkg-reconfigure fonty to configure this file.
#
END
        echo "SCREEN_FONT=iso${CHARSET}graf-16" >> $CONF.dpkg-tmp
        echo "APP_CHARSET_MAP=iso$MAP" >> $CONF.dpkg-tmp
        echo "FALLBACK_TAB=fonty" >> $CONF.dpkg-tmp
[...]
        mv -f $CONF.dpkg-tmp $CONF
[...]
    fi
fi
==================================================================

So the config file is overwritten if the user has given an answer
other then "none" to the debconf question, which is pretty
standard.

I've come up with a patch that tries to solve this problem. The idea
is to only overwrite $CONF if the "###DEBCONF###" line is in there,
and to tell users to remove that line if they change anything. This
should work fine for all future versions AFAICS.

Now the problem is what happens when a user upgrades from <= 1.0-23
to a later version.

The format of the config file hasn't changed at all since at least
1.0-22 (the sarge/etch version). So I rebuild the file in exactly
the same way as previous versions did, and then compare $CONF to
that reference file. If they are the same, one can assume that the
user hasn't modified anything, so we can just overwrite it.

If the file is different, it is possible that the user modified the
file, so we remove the ###DEBCONF### line, so the file won't be
touched later.

This should make a smooth transition possible (hopefully).

The only problem that I see currently is the possibility of false
positives in the is-$CONF-different check. This could happen if the
user changed something in the setup of his VT's in the meantime.
I'm not sure how likely that is, but perhaps a debconf question
would be appropriate here.

The patch that does all this is reattached. I've tested all the
possible scenarios and it seemed to work well.

Cheers,
Christian Aichinger
[fonty-333460-fix.diff (text/plain, attachment)]
[signature.asc (application/pgp-signature, inline)]

Tags added: patch Request was from Christian Aichinger <Greek0@gmx.net> to control@bugs.debian.org. Full text and rfc822 format available.

Information stored:
Bug#333460; Package fonty. Full text and rfc822 format available.

Acknowledgement sent to Christian Aichinger <Greek0@gmx.net>:
Extra info received and filed, but not forwarded. Full text and rfc822 format available.

Message #17 received at 333460-quiet@bugs.debian.org (full text, mbox):

From: Christian Aichinger <Greek0@gmx.net>
To: dexter@debian.org
Cc: 333460-quiet@bugs.debian.org
Subject: Do you care about the RC bug on fonty?
Date: Sat, 29 Jul 2006 13:14:41 +0200
[Message part 1 (text/plain, inline)]
Hi,
you have an RC bug open on fonty since ages (#333460).

I've taken the time to write a patch that fixes the issue in
Jannuary.

You -- the maintainer of the package -- on the other hand didn't
even consider it necessary to comment the report or my patch.

I can live with it if you say you don't like the patch. I don't
consider it the cleanest thing in history myself. But at least it
seems to work for me.

The Right Way (TM) would probably be to use ucf, but that's a bit
invasive for an NMU (which I expected when I wrote the patch).

So please either fix this bug or if you've lost interest in fonty,
orphan it so someone else can get it into shape again.

Cheers,
Christian Aichinger
[signature.asc (application/pgp-signature, inline)]

Tags added: fixed Request was from Michael Meskes <meskes@debian.org> to control@bugs.debian.org. Full text and rfc822 format available.

Bug marked as fixed in version 1.0-23.2, send any further explanations to Jonas Meurer <mejo@debian.org> Request was from "Adam D. Barratt" <debian-bts@adam-barratt.org.uk> to control@bugs.debian.org. Full text and rfc822 format available.

Message sent on to Jonas Meurer <mejo@debian.org>:
Bug#333460. Full text and rfc822 format available.

Message #24 received at 333460-submitter@bugs.debian.org (full text, mbox):

From: "Adam D. Barratt" <debian-bts@adam-barratt.org.uk>
To: 331601-submitter@bugs.debian.org, 331607-submitter@bugs.debian.org, 332216-submitter@bugs.debian.org, 332237-submitter@bugs.debian.org, 332389-submitter@bugs.debian.org, 332424-submitter@bugs.debian.org, 325490-submitter@bugs.debian.org, 332451-submitter@bugs.debian.org, 332507-submitter@bugs.debian.org, 332702-submitter@bugs.debian.org, 332703-submitter@bugs.debian.org, 332808-submitter@bugs.debian.org, 332896-submitter@bugs.debian.org, 333035-submitter@bugs.debian.org, 342420-submitter@bugs.debian.org, 333046-submitter@bugs.debian.org, 333460-submitter@bugs.debian.org, 333857-submitter@bugs.debian.org, 333885-submitter@bugs.debian.org, 340743-submitter@bugs.debian.org, 334252-submitter@bugs.debian.org, 334320-submitter@bugs.debian.org, 334651-submitter@bugs.debian.org, 335126-submitter@bugs.debian.org, 335144-submitter@bugs.debian.org, 335146-submitter@bugs.debian.org, 335252-submitter@bugs.debian.org, 335274-submitter@bugs.debian.org, 335567-submitter@bugs.debian.org, 335719-submitter@bugs.debian.org, 335842-submitter@bugs.debian.org, 336168-submitter@bugs.debian.org, 336312-submitter@bugs.debian.org, 336485-submitter@bugs.debian.org, 379846-submitter@bugs.debian.org, 336535-submitter@bugs.debian.org, 336710-submitter@bugs.debian.org, 337246-submitter@bugs.debian.org, 337453-submitter@bugs.debian.org, 337495-submitter@bugs.debian.org, 337576-submitter@bugs.debian.org, 337593-submitter@bugs.debian.org, 339192-submitter@bugs.debian.org, 346695-submitter@bugs.debian.org, 347154-submitter@bugs.debian.org, 337708-submitter@bugs.debian.org, 337711-submitter@bugs.debian.org, 338327-submitter@bugs.debian.org, 340076-submitter@bugs.debian.org, 345223-submitter@bugs.debian.org, 338370-submitter@bugs.debian.org, 338432-submitter@bugs.debian.org, 338483-submitter@bugs.debian.org, 338537-submitter@bugs.debian.org, 338920-submitter@bugs.debian.org, 339024-submitter@bugs.debian.org, 341234-submitter@bugs.debian.org, 339073-submitter@bugs.debian.org, 339103-submitter@bugs.debian.org, 339187-submitter@bugs.debian.org, 339220-submitter@bugs.debian.org, 339225-submitter@bugs.debian.org, 339226-submitter@bugs.debian.org, 339236-submitter@bugs.debian.org, 339241-submitter@bugs.debian.org, 339250-submitter@bugs.debian.org, 339267-submitter@bugs.debian.org, 339268-submitter@bugs.debian.org, 339280-submitter@bugs.debian.org, 339711-submitter@bugs.debian.org, 339806-submitter@bugs.debian.org, 339835-submitter@bugs.debian.org, 340010-submitter@bugs.debian.org, 340084-submitter@bugs.debian.org, 340163-submitter@bugs.debian.org, 340174-submitter@bugs.debian.org, 340516-submitter@bugs.debian.org, 340577-submitter@bugs.debian.org, 341011-submitter@bugs.debian.org, 341975-submitter@bugs.debian.org, 342035-submitter@bugs.debian.org, 342322-submitter@bugs.debian.org, 346188-submitter@bugs.debian.org, 347153-submitter@bugs.debian.org, 343035-submitter@bugs.debian.org, 343771-submitter@bugs.debian.org, 343782-submitter@bugs.debian.org, 343795-submitter@bugs.debian.org, 343804-submitter@bugs.debian.org, 343912-submitter@bugs.debian.org, 343989-submitter@bugs.debian.org, 344029-submitter@bugs.debian.org, 344254-submitter@bugs.debian.org, 344447-submitter@bugs.debian.org, 344503-submitter@bugs.debian.org, 345737-submitter@bugs.debian.org, 345880-submitter@bugs.debian.org, 344742-submitter@bugs.debian.org
Subject: Bugs fixed in NMU, documenting versions
Date: Sun, 22 Oct 2006 23:09:18 +0100
# Hi,
#
# These bugs were fixed in an NMU, but have not been acknowledged by the
# maintainers.  With version tracking in the Debian BTS, it is important
# to know which version of a package fixes each bug so that they can be
# tracked for release status, so I'm closing these bugs with the
#relevant version information now

close 331601 0.11.3-1.3
close 331607 0.11.3-1.3
close 332216 2005.08.R1-1.1
close 332237 0.11.3-1.4
close 332389 3.1.2-0.1
close 332424 2.6.1-6sarge1
close 325490 0.7.1-1.1
close 332451 0.7.1-1.1
close 332507 0.4.5+cvs20030824-1.5
close 332702 1.5-2.1
close 332703 2.1.19-1.7
close 332808 2.0.12-1.5
close 332896 2.6.2.pre2-1.1
close 333035 0.12-8.1
close 342420 0.12-8.1
close 333046 2.2-5.1
close 333460 1.0-23.2
close 333857 1.0-23.2
close 333885 1.0.20040603-1.1
close 340743 1.0.20040603-1.1
close 334252 20031130-2.1
close 334320 1.4.2-5.1
close 334651 3.0-4.1
close 335126 0.5.3-1.1
close 335144 3.1.1-4.1
close 335146 0.2-1.1
close 335252 0.4.0-1.1
close 335274 0.13-3.2
close 335567 0.4.5+cvs20030824-1.6
close 335719 3.0.cvs20050714-1.1
close 335842 3.10-1.1
close 336168 1.4-2.1
close 336312 0.2.4-4.1
close 336485 2.1.19.dfsg1-0.3
close 379846 2.1.19.dfsg1-0.3
close 336535 2005.08.R1-1.2
close 336710 1:3.2.6-2.1
close 337246 1.0.1-6.1
close 337453 0.9b3-2.1
close 337495 2.09-2sarge1
close 337576 20.0-1.1
close 337593 1.1.3-5.1
close 339192 1.1.3-5.1
close 346695 1.1.3-5.1
close 347154 1.1.3-5.1
close 337708 1.20-2.1
close 337711 0.5-0.2
close 338327 1.9-11.1
close 340076 1.9-11.1
close 345223 1.9-11.1
close 338370 1.35-4.1
close 338432 2.3.3-6.2
close 338483 0.95-1.3
close 338537 1.6-1.1
close 338920 46-2.1
close 339024 4.2.24-1.1
close 341234 4.2.24-1.1
close 339073 1.5.19-20+sarge1
close 339103 0.5.0-1.1
close 339187 6:6.2.4.5-0.3
close 339220 0.6.5-2
close 339225 1.0.4-1.2
close 339226 2.6.1-2.2
close 339236 2.6.2.pre2-1.2
close 339241 1.2.2-4.1
close 339250 6.4-1.1
close 339267 4.2.0-8.1
close 339268 0.7.2-1.1
close 339280 0.1.5.9+cvs.2004.02.07-3.3
close 339711 2.0pl5-19.4
close 339806 0.8pre1-6.1
close 339835 2.11b-1.4
close 340010 1.3-2.2
close 340084 1:1.2.3-9.1
close 340163 0.2.9-5.1
close 340174 0.99.44-0.1
close 340516 1.1.6-2.1
close 340577 1.1.0.20050815-2.1
close 341011 1.8-1.1
close 341975 0.70.1-1.1
close 342035 0.70.1-1.1
close 342322 9.4.2-2.5
close 346188 9.4.2-2.5
close 347153 9.4.2-2.5
close 343035 0.3b.19990815-3.1
close 343771 4.3.9-2.1
close 343782 1.3.13.1-4.1
close 343795 0.5.8-0.1
close 343804 0.3.7-4.1
close 343912 0.0.4-2.1
close 343989 8.4.11-1.1
close 344029 2.1-5.1
close 344254 2.0.9-3.2
close 344447 0.79-3.1
close 344503 9.4.2-2.7
close 345737 2.1.19-1.8
close 345880 2.1.19-1.8
close 344742 0.1.14-1.1




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Tue, 26 Jun 2007 02:26:45 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 14:34:07 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.