You are not logged in.
Hi
I am bit frustrated for I searched on web and failed to find answer, though I believe it must be trivial.
I am writing PKGBUILD, with one config file (in /etc/ of course). But when I reinstall the package, my (customized) config file is flatly overwritten (my changes lost), instead of creating *.pacnew file.
I looked at pacman manpage (mainly section Handling Config Files), PKGBUILD wiki (https://wiki.archlinux.org/index.php/PKGBUILD) but can not see what should I set. It seems to me that I have to say to pacman what files in my package are configuration files, if it is the case, how?
Please help...
Last edited by TiborB (2012-03-30 22:52:39)
Offline
Doesn't something like
backup=('etc/your-file.conf')work for you?
:: Registered Linux User No. 223384
:: github
:: infinality-bundle+fonts: good looking fonts made easy
Offline
No.
Of course I looked at this option and I have it in PKGBUILD.
BTW, from wiki:
backup
An array of files to be backed up as file.pacsave when the package is removed.
so this is something different
Offline
Can you post your PKGBUILD? I think bohoomil is right and the backup array protects your configs.
https://wiki.archlinux.org/index.php/Pa … ckup_files
Last edited by karol (2012-03-30 22:05:30)
Offline
Karol,
here is my pkgbuild: http://pastebin.com/5BVD6c5S
indeed the link you posted confirms what you said, but I tested it once again now and it does not work. But test it by yourself, I wonder if it will work for you.....
Offline
I'm sorry, my fault. I added backup=() option, but did not saved PKGBUILD. Yes, now it works... sorry ![]()
Administrators, feel free to delete this thread altogether....
Last edited by TiborB (2012-03-30 22:28:06)
Offline
[karol@black foo5]$ pacman -R repokeeper
checking dependencies...
Targets (1):
Name Old Version New Version Net Change
repokeeper 0.0.3-1 -0,03 MiB
Total Removed Size: 0,03 MiB
Do you want to remove these packages? [Y/n]
(1/1) removing repokeeper [#############] 100%
warning: /etc/repokeeper.conf saved as /etc/repokeeper.conf.pacsaveWhen I reinstall the package, /etc/repokeeper.conf is the default config, w/o my changes, as they are in /etc/repokeeper.conf.pacsave.
Edit: Ah, glad it's working :-)
I've edited the wiki, so that it mentions pacnew files too: https://wiki.archlinux.org/index.php/PKGBUILD#backup
Last edited by karol (2012-03-30 22:30:12)
Offline
Karol, see my post above...
BTW, I talked about scenario when you reinstall (or update) the package. No removing the package in between.
Anyway, it works now...
Offline
Karol, see my post above...
BTW, I talked about scenario when you reinstall (or update) the package. No removing the package in between.
Anyway, it works now...
I was just trying to figure out what could have gone wrong. That was the only thing that came to my mind, even though it was not exactly what you said you were doing.
Administrators, feel free to delete this thread altogether....
No need for such drastic measures, just please remember to mark the thread as solved.
Offline
Karol, if I can dare to suggest small modificaton to your wording in wiki:
An array of files that can contain user-made changes and should be preserved during update/remove of a package, primarily intended for configuration files in /etc.
When updating, new version will be saved as file.pacnew. Similarly, when the package is removed, file will be preserved as file.pacsave. The file paths in this array should be relative paths (e.g. etc/pacman.conf) not absolute paths (e.g.
/etc/pacman.conf).
See also Pacnew and Pacsave Files.
Offline
Thanks for you suggestions, I've made some changes to that article.
One thing I want to point out:
When updating, new version may be saved as file.pacnew.
original = X, current = Y, new = X
The original package and the new package both contain exactly the same version of the file, but the version currently in the filesystem has been modified. Leave the current version in place and discard the new version without notifying the user.
https://wiki.archlinux.org/index.php/Pa … es#.pacnew
If the new version provides the same config as the old version and I've modified that config file, there will be no pacnew file created when updating.
If you think https://wiki.archlinux.org/index.php/PKGBUILD#backup needs further refinement, just edit it yourself - it's a wiki after all :-)
Offline
Karol,
I just want to say that the changes you made in wiki are very good, thanks
Offline