You are not logged in.

#1 2017-07-21 23:08:08

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Problem with backup array in PKGBUILD or...? [SOLVED]

The backup array in my PKGBUILD defines two package-provided conf files:

backup=('etc/conf.d/openvpn-lxc-snapshot.conf' 'etc/conf.d/pihole-lxc-snapshot.conf')

If I modify them after installing, and then bump the $pkgver and install the newer package, pacman does not write the package-provided virgin ones as .pacnew files... why not?  They are clearly in the $pkgdir:

% makepkg -si
...
% tree pkg
pkg
└── lxc-snapshots
    ├── etc
    │   └── conf.d
    │       ├── openvpn-lxc-snapshot.conf
    │       └── pihole-lxc-snapshot.conf
...

Full PKGBUILD: https://aur.archlinux.org/packages/lxc-snapshots/

Last edited by graysky (2017-07-22 02:12:57)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2017-07-22 00:57:42

GenkiSky
Member
From: This account is henceforth dis
Registered: 2017-04-04
Posts: 82

Re: Problem with backup array in PKGBUILD or...? [SOLVED]

Are you sure you're not falling under case "original=X, current=Y, new=X" or "original=X, current=Y, new=Y" from the HANDLING CONFIG FILES section in pacman(8)? Also, I could be misunderstanding what you mean by "originals", but just to clarify: pacman would write the newer package files as .pacnew files, not the ones you had.

Last edited by GenkiSky (2017-07-22 01:01:45)

Offline

#3 2017-07-22 01:10:15

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Problem with backup array in PKGBUILD or...? [SOLVED]

@GS - Yes, I edited the post.  I need to read that section of the man page to be sure... but again,

1) Install version xxx-1
2) Edit foo.conf installed by pacman as part of that package and that is in the backup array
3) Install version xxx-2
4) Since foo.conf was modified by me, pacman should install the package provided foo.conf as foo.pacnew

Am I missing something?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2017-07-22 01:19:34

GenkiSky
Member
From: This account is henceforth dis
Registered: 2017-04-04
Posts: 82

Re: Problem with backup array in PKGBUILD or...? [SOLVED]

Yeah so here is where I think pacman does something that is opinionated, but in my opinion, correct in the case of "original=X, current=Y, new=X". Basically in this case, pacman sees that even though you modified foo.conf, and the package upgrade results in installing a file that /differs/ from your modified foo.conf, it chooses /not/ to put the package's file in your system at all, as .pacnew or otherwise. This is because it reasons that even though the upgraded package's file differs, it is the same config as the file that you originally edited, so you would probably just apply your exact same changes to that file and move on. So pacman in this case just silently ignores the fact that the upgraded package has a differing file. Of course, in the case of "original=X, current=Y, new=Z" where the upgraded package has a file that is different from /both/ your current config and from the original config that you edited, pacman deems that you should know and installs it as .pacnew . I get the feeling we might be talking past each other though, so please say if that's the case.

Last edited by GenkiSky (2017-07-22 01:21:38)

Offline

#5 2017-07-22 02:09:55

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,559

Re: Problem with backup array in PKGBUILD or...? [SOLVED]

Pacman will only install a pacnew file if the file in the package changes. If xxx-1 and xxx-2 are installing the exact same file, there's no pacnew.

Online

#6 2017-07-22 02:12:44

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,597
Website

Re: Problem with backup array in PKGBUILD or...? [SOLVED]

@Scimmia - That makes sense.  xxx-1 was modified by the user. If xxx-2 = xxx-1, then why bother the user since he/she already deviated from xxx-1 with xxx-1'.  That makes sense.  Thanks for the post.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

Board footer

Powered by FluxBB