Bug 3100

Summary: Upgrade process breaks compressed man pages support (.xz)
Product: Mageia Reporter: Daniel Osmari <danielosmari>
Component: RPM PackagesAssignee: QA Team <qa-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Normal CC: davidwhodgins, marja11, oliver.bgr, pterjan, qa-bugs, sysadmin-bugs, thierry.vignaud, tmb
Version: 1Keywords: validated_update
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: man CVE:
Status comment:

Description Daniel Osmari 2011-10-18 21:16:59 CEST
Description of problem:
A normal upgrade to Mageia 1 does not overwrite /etc/man.config, creating /etc/man.config.rpmnew instead.

Only the new config has proper support for .xz compression. So all .xz man pages become unreadable.

At no point during the upgrade process the user is asked to replace the old man.config.
Fixing it requires a
mv /etc/man.config.rpmnew /etc/man.config
Comment 1 Pascal Terjan 2011-10-18 22:25:17 CEST
This means your /etc/man.config had been modified.
Overwriting it will lose the local modifications

CC: (none) => pterjan

Comment 2 Daniel Osmari 2011-10-18 22:31:30 CEST
I never touched that file. In fact, I only learned about its existence after 3 different machines with Mandriva 2010.2 had the same problem. Either something in the previous system altered it, or the modification detection is not working as expected.
Comment 3 Pascal Terjan 2011-10-18 22:35:02 CEST
Well i am sure the modification detection works as expected (the content of the file has changed), but yes it can have been modified by something before the update.
Manuel Hiebel 2011-10-26 18:33:30 CEST

Component: Installer => RPM Packages
Source RPM: man => urpmi

Comment 4 Daniel Osmari 2011-10-26 20:19:16 CEST
Couldn't the default behavior for a system upgrade be replace the original files? At least the files in the package are supposed to work with the new version, while the old files might not.

Or maybe a post-upgrade step, where all .rpmnew files created during upgrade are presented to the user like in a normal install.
Comment 5 Pascal Terjan 2011-10-26 20:23:59 CEST
(In reply to comment #4)
> Couldn't the default behavior for a system upgrade be replace the original
> files? At least the files in the package are supposed to work with the new
> version, while the old files might not.

No
If you replace /etc/fstab, or other important configuration files, your system will no longer even boot.
 
> Or maybe a post-upgrade step, where all .rpmnew files created during upgrade
> are presented to the user like in a normal install.

That can be a solution, but most users will have no idea what to do about it :/
Comment 6 Thierry Vignaud 2011-12-06 10:27:25 CET
MageiaUpdate does this.

You can run "rpmdrake --merge-all-rpmnew" to manually forces it.

However in this case, man could simplye be %config() instead of %config(noreplace) so that old conf file is saved as .rpmsave instead

CC: (none) => thierry.vignaud
Source RPM: urpmi => man

Comment 7 Marja Van Waes 2012-01-26 20:52:42 CET
Assigning to maintainer

We don't have the slightest idea how many people upgrade from Mdv 2010.x to Mageia 1 atm, do we? But then, I did see some new users who are switching (or consider switching) from Mdv to Mga in the forum and/or on IRC this month.

CC: (none) => marja11
Assignee: bugsquad => oliver.bgr

Comment 8 Oliver Burger 2012-02-18 18:23:13 CET
Replaced %config(noreplace) by %config in spec.

-----
This update fixes Bug #3100
On migrating from Mdv to Mga support for xz compressed man pages was broken,
because the old Mandriva man.config file was not replaced.
-----

Status: NEW => ASSIGNED
Assignee: oliver.bgr => qa-bugs

Comment 9 Dave Hodgins 2012-02-19 00:51:58 CET
For testing, I uninstalled man, and installed the Mandriva version.  Then ...
tail /etc/man.config
# Decompress with given decompressor when input file has given extension
# The command given must act as a filter.
#
.gz             /bin/gunzip -c
.bz2            /usr/bin/bzip2 -c -d
.lzma           /usr/bin/unlzma -c -d
.z
.Z              /bin/zcat
.F
.Y
[root@hodgins /]# urpmi man


    http://twiska.zarb.org/mageia/distrib/1/i586/media/core/updates_testing/man-1.6g-2.2.mga1.i586.rpm
installing man-1.6g-2.2.mga1.i586.rpm from /var/cache/urpmi/rpms
Preparing...                     ################################################################################
      1/1: man                   ################################################################################
[root@hodgins /]# tail /etc/man.config
# The command given must act as a filter.
#
.gz             /bin/gunzip -c
.bz2            /usr/bin/bzip2 -c -d
.lzma           /usr/bin/unlzma -c -d
.z
.Z              /bin/zcat
.F
.Y
.xz             /usr/bin/unxz -c
[root@hodgins /]# ll /etc/man.*
-rw-r--r-- 1 root root 4819 Feb 18 12:21 /etc/man.config

I expected the old man.config would have been saved as man.config.rpmsave

Is it correct for the file to just be replaced?

CC: (none) => davidwhodgins

Comment 10 claire robinson 2012-02-23 16:29:29 CET
Adding Oliver to cc, could you respond to comment 9 please. Thankyou :)

CC: (none) => oliver.bgr

Comment 11 Oliver Burger 2012-02-23 18:40:12 CET
I'll have a look.
Comment 12 claire robinson 2012-03-02 16:07:32 CET
Testing x86_64

Confirmed with mdv man rpm

# rpm -e --nodeps man
# rpm -q man
package man is not installed

# urpmi ./man-1.6f-1mdv2010.1.x86_64.rpm


installing man-1.6f-1mdv2010.1.x86_64.rpm from .
Preparing...                     ###############################################
      1/1: man                   ###############################################
# tail /etc/man.config
# Decompress with given decompressor when input file has given extension
# The command given must act as a filter.
#
.gz             /bin/gunzip -c
.bz2            /usr/bin/bzip2 -c -d
.lzma           /usr/bin/unlzma -c -d
.z
.Z              /bin/zcat
.F
.Y

# urpmi.update --ignore "Core Updates Testing"
# urpmi man


    ftp://ftp.linuxcabal.org/pub/mirrors/Mageia/distrib/1/x86_64/media/core/updates/man-1.6g-2.1.mga1.x86_64.rpm
installing man-1.6g-2.1.mga1.x86_64.rpm from /var/cache/urpmi/rpms
Preparing...                     ###############################################
      1/1: man                   ###############################################

# tail /etc/man.config
# The command given must act as a filter.
#
.gz             /bin/gunzip -c
.bz2            /usr/bin/bzip2 -c -d
.lzma           /usr/bin/unlzma -c -d
.z
.Z              /bin/zcat
.F
.Y
.xz             /usr/bin/unxz -c


So with mga1 version from Core Updates xz is already added.

I'll test again with release version to see if this was  already fixed by the previous update from December ( bug 1622 ).
Comment 13 claire robinson 2012-03-02 16:25:00 CET
# rpm -e --nodeps man
# urpmi ./man-1.6f-1mdv2010.1.x86_64.rpm


installing man-1.6f-1mdv2010.1.x86_64.rpm from .
Preparing...                     ###############################################
      1/1: man                   ###############################################
# ll /etc/man.*
-rw-r--r-- 1 root root 4801 Feb 21  2010 /etc/man.config
# tail /etc/man.config
# Decompress with given decompressor when input file has given extension
# The command given must act as a filter.
#
.gz             /bin/gunzip -c
.bz2            /usr/bin/bzip2 -c -d
.lzma           /usr/bin/unlzma -c -d
.z
.Z              /bin/zcat
.F
.Y



# urpmi --media Release man


    ftp://ftp.linuxcabal.org/pub/mirrors/Mageia/distrib/1/x86_64/media/core/release/man-1.6g-2.mga1.x86_64.rpm
installing man-1.6g-2.mga1.x86_64.rpm from /var/cache/urpmi/rpms
Preparing...                     ###############################################
      1/1: man                   ###############################################
# ll /etc/man.*
-rw-r--r-- 1 root root 4819 Jan 10  2011 /etc/man.config

# tail /etc/man.config
# The command given must act as a filter.
#
.gz             /bin/gunzip -c
.bz2            /usr/bin/bzip2 -c -d
.lzma           /usr/bin/unlzma -c -d
.z
.Z              /bin/zcat
.F
.Y
.xz             /usr/bin/unxz -c





Using urpmi has already overwritten the config file with the Release version.

If I remove the xz line and install the update..





# nano /etc/man.config 
# tail /etc/man.config
# The command given must act as a filter.
#
.gz             /bin/gunzip -c
.bz2            /usr/bin/bzip2 -c -d
.lzma           /usr/bin/unlzma -c -d
.z
.Z              /bin/zcat
.F
.Y

# urpmi man


    ftp://ftp.linuxcabal.org/pub/mirrors/Mageia/distrib/1/x86_64/media/core/updates/man-1.6g-2.1.mga1.x86_64.rpm
installing man-1.6g-2.1.mga1.x86_64.rpm from /var/cache/urpmi/rpms
Preparing...                     ###############################################
      1/1: man                   ###############################################
[root@mega ~]# ll /etc/man.*
-rw-r--r-- 1 root root 4796 Mar  2 15:17 /etc/man.config
[root@mega ~]# tail /etc/man.config
# The command given must act as a filter.
#
.gz             /bin/gunzip -c
.bz2            /usr/bin/bzip2 -c -d
.lzma           /usr/bin/unlzma -c -d
.z
.Z              /bin/zcat
.F
.Y



It is still missing xz support and there is no rpmsave/rpmnew.

Updating to update candidate from updates_testing...




# urpmi.update --no-ignore "Core Updates Testing"
# urpmi man


    ftp://ftp.linuxcabal.org/pub/mirrors/Mageia/distrib/1/x86_64/media/core/updates_testing/man-1.6g-2.2.mga1.x86_64.rpm
installing man-1.6g-2.2.mga1.x86_64.rpm from /var/cache/urpmi/rpms
Preparing...                     ###############################################
      1/1: man                   ###############################################

# tail /etc/man.config
# The command given must act as a filter.
#
.gz             /bin/gunzip -c
.bz2            /usr/bin/bzip2 -c -d
.lzma           /usr/bin/unlzma -c -d
.z
.Z              /bin/zcat
.F
.Y

# ll /etc/man.*
-rw-r--r-- 1 root root 4796 Mar  2 15:17 /etc/man.config



Xz is still missing and no rmpsave/rpmnew, so I'm not noticing any difference with the update_candidate.
Comment 14 claire robinson 2012-03-07 11:12:40 CET
Assigning Oliver. Please reassign to QA when you've had a chance to look.
Thanks!

CC: (none) => qa-bugs
Assignee: qa-bugs => oliver.bgr

Comment 15 Oliver Burger 2012-03-10 23:08:38 CET
If I understand it correctly, a file marked as %config in the spec is replaced, if
the file was changed on the disk
AND
the file between the original rpm and the update are different

So I added a dummy change to /etc/man.config
I hope, this does the trick.

Please test with new release of man.

Assignee: oliver.bgr => qa-bugs

Comment 16 Dave Hodgins 2012-03-11 00:42:37 CET
Testing complete on i586 for the srpm
man-1.6g-2.3.mga1.src.rpm

diff /etc/man.config /var/mnt/magtest/etc/man.config
152d151
< #

The /var/mnt/magtest is a clean mageia 1 install + updates,
excluding updates testing.

The line
.xz             /usr/bin/unxz -c

is present in both.  This test shows the file will get
replaced, wether that line is present or not.
Comment 17 Oliver Burger 2012-03-11 10:28:39 CET
It will not as shown in Comment #13 and in my own tests.

When the file was not changed on the file system, it will be replaced without creating an .rpmsave file.
When it was changed on the file system, it will not be replaced, when the file from the update rpm is not different from the original one.
When it was changed on the file system and the file from the update rpm is different from the original one, it will be replaced and a .rpmsave file will be created.

If I should be totally wrong here, please someone with more knowledge of rpm's internals correct me.

The testing procedure thus would be, to install the original Mga1 man rpm, change the man.config file there and then install the update_testing package.
It should install the man.config file from the package and create an .rpmsave file.
Comment 18 Oliver Burger 2012-03-12 08:56:53 CET
Tested on i586 using the procedure described in Comment #17
Everything works as expected.
Comment 19 Dave Hodgins 2012-03-13 02:32:53 CET
We still need retesting on x86-64 for the srpm
man-1.6g-2.3.mga1.src.rpm
Comment 20 claire robinson 2012-03-20 13:34:28 CET
x86_64

# rpm -e --nodeps man
warning: /etc/man.config saved as /etc/man.config.rpmsave

So that version did save the config when being removed, just not when installed.

# rm -f /etc/man.config
# rm -f /etc/man.config.rpmsave
# urpmi --media Release man


    ftp://ftp.linuxcabal.org/pub/mirrors/Mageia/distrib/1/x86_64/media/core/release/man-1.6g-2.mga1.x86_64.rpm
installing man-1.6g-2.mga1.x86_64.rpm from /var/cache/urpmi/rpms
Preparing...                     ###############################################
      1/1: man                   ###############################################

# tail /etc/man.config

# The command given must act as a filter.
#
.gz             /bin/gunzip -c
.bz2            /usr/bin/bzip2 -c -d
.lzma           /usr/bin/unlzma -c -d
.z
.Z              /bin/zcat
.F
.Y
.xz             /usr/bin/unxz -c

Removing xz support.

# nano /etc/man.config
# tail /etc/man.config

# Decompress with given decompressor when input file has given extension
# The command given must act as a filter.
#
.gz             /bin/gunzip -c
.bz2            /usr/bin/bzip2 -c -d
.lzma           /usr/bin/unlzma -c -d
.z
.Z              /bin/zcat
.F
.Y

# urpmi.update --no-ignore "Core Updates Testing"
# urpmi man


    ftp://ftp.linuxcabal.org/pub/mirrors/Mageia/distrib/1/x86_64/media/core/updates_testing/man-1.6g-2.3.mga1.x86_64.rpm
installing man-1.6g-2.3.mga1.x86_64.rpm from /var/cache/urpmi/rpms
Preparing...                     ###############################################
      1/1: man                   warning: /etc/man.config saved as /etc/man.config.rpmsave

# ll /etc/man.config*
-rw-r--r-- 1 root root 4821 Mar 10 22:01 /etc/man.config
-rw-r--r-- 1 root root 4797 Mar 20 12:28 /etc/man.config.rpmsave

# tail /etc/man.config
#
.gz             /bin/gunzip -c
.bz2            /usr/bin/bzip2 -c -d
.lzma           /usr/bin/unlzma -c -d
.z
.Z              /bin/zcat
.F
.Y
.xz             /usr/bin/unxz -c
#

# tail /etc/man.config.rpmsave
# Decompress with given decompressor when input file has given extension
# The command given must act as a filter.
#
.gz             /bin/gunzip -c
.bz2            /usr/bin/bzip2 -c -d
.lzma           /usr/bin/unlzma -c -d
.z
.Z              /bin/zcat
.F
.Y


So it is now adding xz support and saving an rpmsave when it is updated as it should.
Comment 21 claire robinson 2012-03-20 13:46:49 CET
Validating


Advisory
-----------
This update corrects an issue where /etc/man.config was not being overwritten on upgrade from Mandriva. 

The upgraded version would be saved as /etc/man.config.rpmnew, meaning man would be missing support for xz compressed man pages until the config was manually replaced by the rpmnew.

With this update /etc/man.config will be automatically overwritten if different and the older version backed up as /etc/man.conf.rpmsave. Man will now support xz compressed pages as it should.
-----------

SRPM: man-1.6g-2.3.mga1.src.rpm

Could sysadmin please push from core/updates_testing to core/updates

Thankyou!

Keywords: (none) => validated_update
CC: (none) => sysadmin-bugs

Comment 22 claire robinson 2012-03-20 13:48:23 CET
Updated Advisory (config not conf)
-----------
This update corrects an issue where /etc/man.config was not being overwritten
on upgrade from Mandriva. 

The upgraded version would be saved as /etc/man.config.rpmnew, meaning man
would be missing support for xz compressed man pages until the config was
manually replaced by the rpmnew.

With this update /etc/man.config will be automatically overwritten if different
and the older version backed up as /etc/man.config.rpmsave. Man will now support
xz compressed pages as it should.
-----------
Comment 23 Thomas Backlund 2012-03-21 20:01:34 CET
Update pushed

Status: ASSIGNED => RESOLVED
CC: (none) => tmb
Resolution: (none) => FIXED