Welcome to CRUX bug tracking.

FS#1074 - package upgrades removes files if they don't exist in the new package, regardless of rejection rules

Attached to Project: CRUX
Opened by Alan Mizrahi (alancio) - Friday, 24 October 2014, 08:25 GMT
Last edited by Predrag Ivanovic (pedja) - Friday, 16 June 2017, 17:28 GMT
Task Type Bug Report
Category ports → core/opt
Status New
Assigned To CRUX Developers (crux)
Operating System CRUX
Severity Low
Priority Normal
Reported Version 3.3
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 1
Private No


pkgadd -u removes files if they don't exist in the new package, regardless of the rejection rules in pkgadd.conf.

As a test I create package for app-1.0 with /etc/app.conf, and then app-2.0 without it:

[root@koji ~]# mkdir etc
[root@koji ~]# echo default configuration > etc/app.conf
[root@koji ~]# tar -czf app#1.0-1.pkg.tar.gz etc
[root@koji ~]# rm etc/app.conf
[root@koji ~]# tar -czf app#2.0-1.pkg.tar.gz etc

I will install app-1.0, and then customize my configuration file:

[root@koji ~]# pkgadd app#1.0-1.pkg.tar.gz
[root@koji tmp]# cat /etc/app.conf
default configuration
[root@koji tmp]# echo customized configuration > /etc/app.conf

Now I will upgrade to app-2.0, and my custom configuration file will be gone:

[root@koji tmp]# pkgadd -u app#2.0-1.pkg.tar.gz
[root@koji tmp]# ls -l /etc/app.conf
ls: cannot access /etc/app.conf: No such file or directory

My pkgadd.conf contains:
UPGRADE ^etc/.*$ NO
This task depends upon

Comment by Fun (fun) - Sunday, 18 June 2017, 14:40 GMT
Attached a patch that seems to fix this, with a drawback.
   0001-pkgadd-apply-rejection-r... (2.3 KiB)
Comment by Fun (fun) - Sunday, 16 July 2017, 15:24 GMT
Re-adding patch