FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 07-14-2011, 05:28 PM
Dan McGee
 
Default Adding a new config file to a package (e.g. mercurial file conflict)

I did an -Syu on my Arch box today, which updated Mercurial, and the
new package contains a /etc/mercurial/hgrc file. I had already created
one on my system, and the old package did not contain one, so I got a
file conflict.

(54/54) checking package integrity [######################] 100%
(54/54) checking for file conflicts [######################] 100%
error: failed to commit transaction (conflicting files)
mercurial: /etc/mercurial/hgrc exists in filesystem
Errors occurred, no packages were upgraded.


So instead, I had to -Sf the package, which installs the file with a pacnew:

(1/1) checking package integrity [######################] 100%
(1/1) checking available disk space [######################] 100%
(1/1) upgrading mercurial [######################] 100%
warning: /etc/mercurial/hgrc installed as /etc/mercurial/hgrc.pacnew


This behavior is a bit...odd. We don't like people using -f, and they
are trained to assume the worst, so most would not expect the backup
logic to still kick into effect. A pactest is below, but I'm asking
for thoughts on expected behavior in this case. Many possibilities
listed for completeness, some of which are just plain dumb.

1) Keep as is with file conflict error, require -Sf, keep backing up
file to pacnew
2) Keep as is with file conflict error, require -Sf, don't backup
(this is stupid)
3) Don't error at all, treat as a normal backup case except pretend
old file is the same as /dev/null (aka empty).
4) Same as (3), but make the pacnew warning message slightly
different, e.g. "%s is new in package, installed as %s" or something.
5) Something like (3) or (4) but don't even treat it the same as an
empty file, treat it as never matching anything.

My vote is 3 or 4, not that we are a democracy.

-Dan


self.description = "Upgrade a package, with a file entering the pkg in 'backup'"

lp = pmpkg("dummy")
lp.files = ["usr/bin/dummy"]
self.addpkg2db("local", lp)

p = pmpkg("dummy", "1.0-2")
p.files = ["usr/bin/dummy",
"etc/dummy.conf"]
p.backup = ["etc/dummy.conf"]
self.addpkg(p)

self.args = "-U %s" % p.filename()

self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=dummy|1.0-2")
self.addrule("!FILE_PACSAVE=etc/dummy.conf")
self.addrule("FILE_PACNEW=etc/dummy.conf")
self.addrule("FILE_EXIST=etc/dummy.conf")
 

Thread Tools




All times are GMT. The time now is 07:06 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org