[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#898303: marked as done (setupcon always uses the cached font, doesn't update it when called with --save)



Your message dated Tue, 14 Aug 2018 13:19:01 +0000
with message-id <E1fpZDx-0003at-HH@fasolo.debian.org>
and subject line Bug#898303: fixed in console-setup 1.185
has caused the Debian Bug report #898303,
regarding setupcon always uses the cached font, doesn't update it when called with --save
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
898303: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=898303
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: console-setup
Version: 1.184
Tags: patch

Hi,

After upgrading the console-setup package to version 1.184 to get the fix for 
bug #895047 [1], I found that the issue was still there. I had to remove the 
cached font in /etc/console-setup and then run 'setupcon --save' in order to 
finally get rid of it.

It turned out that findfile() function used 'ls' to get available file matches, 
and then simply picked the first one. But 'ls' sorts its output alphabetically 
by default, hence the cached font in /etc always won despite the normal one 
being available in /usr. As the result, setupcon never updated the cached font 
while always using it for setting up ttys, rendering font updates (like the 
one in #895047) useless.

A proposed fix is attached.

 [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895047
>From 92b4f2f4252a168962fefbdcb6ff007f27811962 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A8=D0=B8?=
 =?UTF-8?q?=D0=BB=D0=B8=D0=BD?= <rootlexx@mail.ru>
Date: Wed, 9 May 2018 17:11:35 +0300
Subject: [PATCH] setupcon: Make findfile() respect location priorities

findfile() used 'ls' to create a list of available file matches, and
then picked the first one. But 'ls' sorts the result alphabetically
which led to findfile() always picking the cached version in /etc even
if the normal one was available.

As one of the consequences, the cached font was not updated on package
upgrades. Given that the cached version was used all of the time, any
font updates in the new version of the package had no effect until one
manually removed the cached one.

This commit makes findfile() respect the given order of possible file
paths, which fixes the issues. It moves away from using 'ls' (which
doesn't have a usable and portable way to switch off sorting) to a
POSIX-compliant for-loop.
---
 setupcon | 26 +++++++++++++++-----------
 1 file changed, 15 insertions(+), 11 deletions(-)

diff --git a/setupcon b/setupcon
index 6121632..f0d6734 100755
--- a/setupcon
+++ b/setupcon
@@ -228,7 +228,7 @@ run () {
 # Example: findfile share/consolefonts Uni3-*.psf.gz
 # Result: /usr/share/consolefonts/Uni3-Fixed13.psf.gz
 findfile () {
-    local x
+    local f
     case "$2" in
         /*)
             if [ -f "$2" ]; then
@@ -237,16 +237,20 @@ findfile () {
             fi
             ;;
     esac
-    x=`(ls "$installdir"/$1/$2 \
-           /usr/local/$1/$2 \
-	   /usr/$1/$2 \
-           /etc/console-setup/cached_$2 \
-           /etc/console-setup/$2 \
-           "$installdir"/etc/console-setup/cached_$2 \
-           "$installdir"/etc/console-setup/$2) 2>/dev/null`
-    x=`echo $x`
-    [ "${x%% *}" ] || report Unable to find "$2".
-    echo "${x%% *}"
+    for f in "$installdir"/$1/$2 \
+             /usr/local/$1/$2 \
+             /usr/$1/$2 \
+             /etc/console-setup/cached_$2 \
+             /etc/console-setup/$2 \
+             "$installdir"/etc/console-setup/cached_$2 \
+             "$installdir"/etc/console-setup/$2
+    do
+        if [ -f "$f" ]; then
+            echo "$f"
+            return 0
+        fi
+    done
+    report Unable to find "$2".
 }
 
 # Return code 0: we are on the console; 1: we are not on the console
-- 
2.11.0


--- End Message ---
--- Begin Message ---
Source: console-setup
Source-Version: 1.185

We believe that the bug you reported is fixed in the latest version of
console-setup, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 898303@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Holger Wansing <hwansing@mailbox.org> (supplier of updated console-setup package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Tue, 14 Aug 2018 14:24:24 +0200
Source: console-setup
Binary: keyboard-configuration console-setup console-setup-mini console-setup-linux console-setup-freebsd bdf2psf console-setup-udeb console-setup-amiga-ekmap console-setup-ataritt-ekmap console-setup-macintoshold-ekmap console-setup-pc-ekmap console-setup-sun4-ekmap console-setup-sun5-ekmap console-setup-pc-ekbd console-setup-linux-fonts-udeb console-setup-freebsd-fonts-udeb console-setup-linux-charmaps-udeb console-setup-freebsd-charmaps-udeb
Architecture: source
Version: 1.185
Distribution: unstable
Urgency: medium
Maintainer: Debian Install System Team <debian-boot@lists.debian.org>
Changed-By: Holger Wansing <hwansing@mailbox.org>
Description:
 bdf2psf    - font converter to generate console fonts from BDF source fonts
 console-setup - console font and keymap setup program
 console-setup-amiga-ekmap - encoded Linux keyboard layouts for Amiga keyboards (udeb)
 console-setup-ataritt-ekmap - encoded Linux keyboard layouts for Atari TT keyboards (udeb)
 console-setup-freebsd - FreeBSD specific part of console-setup
 console-setup-freebsd-charmaps-udeb - FreeBSD 8-bit charmaps for console-setup-udeb (udeb)
 console-setup-freebsd-fonts-udeb - FreeBSD console fonts for Debian Installer (udeb)
 console-setup-linux - Linux specific part of console-setup
 console-setup-linux-charmaps-udeb - Linux 8-bit charmaps for console-setup-udeb (udeb)
 console-setup-linux-fonts-udeb - Linux console fonts for Debian Installer (udeb)
 console-setup-macintoshold-ekmap - encoded Linux keyboard layouts for old-style Macintosh keyboards (udeb)
 console-setup-mini - console font and keymap setup program - reduced version for Linux
 console-setup-pc-ekbd - encoded FreeBSD keyboard layouts for PC keyboards (udeb)
 console-setup-pc-ekmap - encoded Linux keyboard layouts for PC keyboards (udeb)
 console-setup-sun4-ekmap - encoded Linux keyboard layouts for Sun4 keyboards (udeb)
 console-setup-sun5-ekmap - encoded Linux keyboard layouts for Sun5 keyboards (udeb)
 console-setup-udeb - Configure the keyboard (udeb)
 keyboard-configuration - system-wide keyboard preferences
Closes: 898303
Changes:
 console-setup (1.185) unstable; urgency=medium
 .
   * Team upload
 .
   [ Cyril Brulebois ]
   * setupcon(findfile): Do not use `ls` in order to find a file because
     `ls` sorts its argumengs.  Thanks to Alexey Shilin (patch provided),
     closes: #898303.
   * Update Vcs-{Browser,Git} to point to salsa (alioth's replacement).
 .
   [ Updated translations ]
   * Belarusian (be.po) by Viktar Siarheichyk
   * Esperanto (eo.po) by Felipe Castro
   * Finnish (fi.po) by Arto Keiski
   * Hebrew (he.po) by Yaron Shahrabani
   * Icelandic (is.po) by Sveinn í Felli
   * Indonesian (id.po) by Andika Triwidada
   * Kannada (kn.po) by Yogesh
   * Korean (ko.po) by Changwoo Ryu
   * Norwegian Bokmål (nb.po) by Allan Nordhøy
   * Dutch (nl.po) by Frans Spiesschaert
   * Serbian (sr.po) by Filipovic Dragan
   * Swedish (sv.po) by Anders Jonsson
   * Telugu (te.po) by Praveen Illa
   * Simplified Chinese (zh_CN.po) by Boyuan Yang
   * Traditional Chinese (zh_TW.po) by Anthony Wong
Checksums-Sha1:
 2f3817a969242ba9db2fef7c9f50c8b36235ba42 3292 console-setup_1.185.dsc
 54b8395210333fe8a35c58b14d6065b9c7d0b7a3 1648384 console-setup_1.185.tar.xz
 86733bdb7e5e97f7b83bcef43f21a4dd82678027 11602 console-setup_1.185_amd64.buildinfo
Checksums-Sha256:
 a6d8dd839634a2641c4a5e782026955bfafc46ef2b5968918eec618219994117 3292 console-setup_1.185.dsc
 e01f554969954887aefc8b54e8bf40e5b74d6ebd02614dfc8f40536621c04cc8 1648384 console-setup_1.185.tar.xz
 3263a5cd23f3667de18e67285d894fc1dd84f4c4702bad49809dffafaa459396 11602 console-setup_1.185_amd64.buildinfo
Files:
 d0d2a6eab3f754e3336c6b99742ee14a 3292 utils optional console-setup_1.185.dsc
 a03ff938b952fa8190314cba17b83280 1648384 utils optional console-setup_1.185.tar.xz
 82085cd8dafd8f4cba80dccb8be15cbe 11602 utils optional console-setup_1.185_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEESWrG6BRCSzSFCDUpWfGHyhVusHYFAlty0Q4ACgkQWfGHyhVu
sHbu6hAAkaqkf3HoK0bDBtbDDaKNDUNHKb4VBPUd3ENMCmxrlwnp/EIsKFbnjwyA
UxKT7itx5zFCCShQnywD322y27ytlFJQnNNFaAy0HgGof5iiUzmOc+YcW0LiCff1
utknxAajrUeG0H9/lIvQOHZgBzzKv2dJafZIGbQ1/2UZD7uB4XTCCBWfutwuyiLV
QXmGOesuOogKu61cX0lnSIaGwR0PhA3MfJrx3pnqRymyb9MU5vGR2aacJA7LGrDU
naVgT15McogN7m+HhTMek5htiBnyjEt+pvjs7XOvx//3xBb6CS1htUPoGl4aLniA
VawoKRKD3+sGjCNsGOhGs5C71xWX/3KTX3qrINK6WI78HcyrfqXtUSzajFvY9spp
8pjbbFjKMoStMjGsDw7YbvC2DEc3GdBFTCpjexqTcrloadSHEZzBNLanwG9Dtr41
qEVJVh11PWzZq+d3gErbxFUkvp+mG+lecfgYArM2AVPhlKgNx8Ee915jrQuFe464
sxpqv6HacbtnPt8mNbhY/HGOfUbrQOvGG+R+8ifDTJGpEOZpIKZQ8UW89ntevZYO
8+/gY1euu8QRpntZcg+oXsJzgHEHAyvfxCQ8gvKjvec1FllTLaNKP51PqyYeljOI
l7yG773tLFLJzbeG/DN3DjtVy7BppG16TMjTeRYZgNzbxGA4rp0=
=iEIm
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: