[aur-general] Fixing a package with broken config symlinks

Florian Bruhin me at the-compiler.org
Wed Jun 3 07:28:44 UTC 2015


Hi,

I inherited a package (agendav) for a webapplication which had the
config symlinking backwards. This means:

- The real config files were installed into /usr/share/webapps/foo
- /etc/webapps/foo is a symlink to /usr/share/webapps/foo
- backup=() in the PKGBUILD only lists etc/webapps/foo

I'd like to correct this situation in an update, but that update will
of course overwrite /usr/share/webapps/foo with the new version (i.e.
the new symlink) and nuke the user's current config.

I tried adding both the etc/ and the old usr/share path to backup=()
in the hope that pacman would create a .pacsav on update, but that
didn't help:

https://github.com/The-Compiler/pkgbuild/blob/master/agendav/PKGBUILD

diff to the broken version:
https://github.com/The-Compiler/pkgbuild/commit/f5af712f76a7ed5d0869130f1f7f9da69541462b

Currently when I update, this happens:

- /etc/webapps/foo is a broken symlink because it links to
  /usr/share/webapps/foo (which now links to /etc/webapps/foo).
- The template config from the package is installed to
  /etc/webapps/foo.pacnew
- /usr/share/webapps/foo is now the (correct) symlink to
  /etc/webapps/foo
- The user config in /usr/share/webapps/foo got overwritten by that
  symlink without a .pacnew or .pacsav (why? Is there something I did
  wrong?).

Is there any way I could fix this mess without deleting the user's
config?

If you want to experiment, you can get the current broken version (-2)
from the AUR, and the "fixed" one (-3) from the git repo above.

Thanks,

Florian

-- 
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.archlinux.org/pipermail/aur-general/attachments/20150603/52d98a15/attachment.asc>


More information about the aur-general mailing list