You are not logged in.

#1 2010-07-13 09:23:50

BKLive
Member
From: Georgia
Registered: 2008-01-28
Posts: 125

PKGBUILD overwrites configs

I've googled and searched the wiki/forum for this and found a few references:
https://bbs.archlinux.org/viewtopic.php?id=16299
Something about vercmp:
http://bbs.archlinux.org/viewtopic.php?pid=706939
http://bbs.archlinux.org/viewtopic.php?pid=781731

Anyway, reading this stuff doesn't really give me that great of an answer. Basically I have the PKGBUILD for euclid-wm which is running the make commands from the Makefile for the package itself, and one of those commands is

make DESTDIR="$pkgdir" install_conf

which is supposed to install the config and rc file while saving a backup. This is denoted in the Makefile by

@install -b -D -m600 euclid-wm.conf.sample ${CONFDIR}/euclid-wm.conf
@install -b -D -m700 euclidrc ${CONFDIR}/euclidrc

however the '-b' option which is supposed to create a backup of the previous version (using your BACKUP preferences (in my case, the ~)) instead creates two copies of the same file both in the install target and the backup file (the ~ is just a clone of the new). For whatever reason this setup isn't
A) Asking me if I want to install the new configuration file. Which I understand because there isn't any implied logic, but it's also not
B) Backing up the old files that it should be with the -b command.

Having said this, it does work if I do the manual install from the command line. The ~ file IS the old version.

So my question is "How do I set up my PKGBUILD to NOT overwrite the old configs?"

Sorry if my logic is illogical, it's late/early/timeframe and 52 deg C outside. Not a joke.


Main Arch Setup: HP Pavillion p7-1209, Quad-Core i3-2120 3.3Ghz, 8GB RAM, 1TB HDD, Intel Graphics
Laptop Arch Setup: Gateway lt3103u Netbook, AMD Athlon64 1.2Ghz, 2GB RAM, 250GB HDD, ATI X1270 R600

Offline

#2 2010-07-13 09:44:00

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: PKGBUILD overwrites configs

in your pkgbuild a backup arrray.

backup=('etc/euclid-wm.conf') or whatever the path is


Give what you have. To someone, it may be better than you dare to think.

Offline

#3 2010-07-13 20:33:14

BKLive
Member
From: Georgia
Registered: 2008-01-28
Posts: 125

Re: PKGBUILD overwrites configs

Well I get this, kind of. Thanks Wonder.

My question is, if the config files are in the ~/.config/euclid-wm directory, how do I parse that into the backup=() function?

My guess?

backup=('home/${USER}/.config/euclid-wm/euclidrc' 'home/${USER}/.config/euclid-wm.conf')

but I could be wrong. Might not accept environment vars.


Main Arch Setup: HP Pavillion p7-1209, Quad-Core i3-2120 3.3Ghz, 8GB RAM, 1TB HDD, Intel Graphics
Laptop Arch Setup: Gateway lt3103u Netbook, AMD Athlon64 1.2Ghz, 2GB RAM, 250GB HDD, ATI X1270 R600

Offline

#4 2010-07-13 20:53:03

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: PKGBUILD overwrites configs

the package doesn't touch files from your home directory


Give what you have. To someone, it may be better than you dare to think.

Offline

#5 2010-07-13 21:43:47

BKLive
Member
From: Georgia
Registered: 2008-01-28
Posts: 125

Re: PKGBUILD overwrites configs

Well, sort of. It actually does. I mean, sort of.

Okay, it installs to /usr/share/euclid-wm/filename but the specific ones are in /home/.config/euclid-wm/filename and from revision to revision the config and rc files are changing.. so.. i want to ask to update them or not.

maybe i'm allowing too much here. dunno.


Main Arch Setup: HP Pavillion p7-1209, Quad-Core i3-2120 3.3Ghz, 8GB RAM, 1TB HDD, Intel Graphics
Laptop Arch Setup: Gateway lt3103u Netbook, AMD Athlon64 1.2Ghz, 2GB RAM, 250GB HDD, ATI X1270 R600

Offline

#6 2010-07-13 21:51:53

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: PKGBUILD overwrites configs

Let the user deal with it. Use the install scriptlet to detect a config change based on the version numbers passed to the post_upgrade function and warn if needed.

Offline

#7 2010-07-13 21:58:26

BKLive
Member
From: Georgia
Registered: 2008-01-28
Posts: 125

Re: PKGBUILD overwrites configs

So, you're saying I shouldn't even run the 'make DESTDIR='$pkgdir' install_conf' and just allow the user to decide that they should/could copy the files from /usr/share/euclid-wm to their config directory instead of just auto-jamming them?

I like it.


Main Arch Setup: HP Pavillion p7-1209, Quad-Core i3-2120 3.3Ghz, 8GB RAM, 1TB HDD, Intel Graphics
Laptop Arch Setup: Gateway lt3103u Netbook, AMD Athlon64 1.2Ghz, 2GB RAM, 250GB HDD, ATI X1270 R600

Offline

Board footer

Powered by FluxBB