rpm -Uhv --oldpackage loses configs

Elan Ruusamäe glen at delfi.ee
Tue Jun 7 19:58:10 CEST 2016


On 07.06.2016 20:42, Jeffrey Johnson wrote:
>> On Jun 7, 2016, at 1:29 PM, Elan Ruusamäe <glen at delfi.ee> wrote:
>>
>> On 06.06.2016 22:00, Elan Ruusamäe wrote:
>>> (pld has --downgrade alias to --oldpackage via popt)
>>>
>>> downgrading from repackage lost config files,
>>> i.e saved them as .rpmsave leaving original path missing
>> remote reproducer using docker:
>> (commands that Dockerfile runs are displayed on that page, so not posting them here)
>>
>> https://hub.docker.com/r/glen/rpm-repackage-bug/builds/b96cnokzxisbioj7egrc7d8/
>>
> I’m sure the problem is reproducible for you. Meanwhile, if rpm is to support
> —downgrade with %config file handling, I need a far simpler reproducer
> that does not involve docker and hundreds of packages.
>

docker was just easy way to show how problem can be reproduced. nothing 
suits you.
a reproducer that you can run on your own however you want.
and docker runs nowadays linux/osx/windows, natively! [*1]

to preproduce just need two packages:
1. old package, v1.1
2. new package, v1.2

and scenario:
1. install v1.1
2. upgrade v1.1->v1.2
3. "downgrade" v1.2->v1.1 with matching v1.1 and v1.2 packages (it will 
not really downgrade)

showing this, using the same docker image:
1. download "pure" packages:

# poldek --fetch=/tmp -u pam pam-libs --nodeps
# poldek --fetch=/tmp -u pam pam-libs --force -n th-2015 --noask
bash-4.3# ls -l /tmp/*pam*
-rw-r--r-- 1 root root 747324 Mar 28  2015 /tmp/pam-1.1.8-8.x86_64.rpm
-rw-r--r-- 1 root root 760576 May 15 08:41 /tmp/pam-1.2.1-1.x86_64.rpm
-rw-r--r-- 1 root root  34016 Mar 28  2015 /tmp/pam-libs-1.1.8-8.x86_64.rpm
-rw-r--r-- 1 root root  34391 May 15 08:41 /tmp/pam-libs-1.2.1-1.x86_64.rpm
bash-4.3# rpm -q pam pam-libs
pam-1.2.1-1.x86_64
pam-libs-1.2.1-1.x86_64
bash-4.3# rpm -Uhv --oldpackage /tmp/*pam*
warning: package pam = 1:1.1.8-8 was already added, replacing with pam 
 >= 1:1.2.1-1
warning: package pam-libs = 1:1.1.8-8 was already added, replacing with 
pam-libs >= 1:1.2.1-1
Preparing... ########################################### [100%]
Repackaging...
    1:pam ########################################### [ 50%]
    2:pam-libs ########################################### [100%]
Upgrading...
    1:pam-libs ########################################### [ 50%]
warning: /etc/environment saved as /etc/environment.rpmsave
    2:pam ########################################### [100%]
bash-4.3# rpm -q pam pam-libs
pam-1.2.1-1.x86_64
pam-libs-1.2.1-1.x86_64
bash-4.3#



> Meanwhile abandoning %config renaming (and doing a git check-in with RPM+LIBGIT2),
> is likely the best forward-looking solution.
pld will not sign up to this. %config handling needs to be fixed.
> There are also better solutions than /var/spool/repackage that can be attempted these
> days.
why are you sure it's repackage problem if you can't even understand why 
it behaves like it does.
i've seen rpm losing configs ever other corner. this was just easily 
reproducible usecase.

[*1]: may need beta signup, i'm not using win/mac myself

-- 
glen



More information about the pld-devel-en mailing list