summaryrefslogtreecommitdiff
path: root/lib/libalpm/add.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-07-14 15:32:03 -0500
committerDan McGee <dan@archlinux.org>2011-07-14 15:34:04 -0500
commitaf357d6ab00d8ca258dfd7abb689d6fd2eb4090f (patch)
tree81218f7e003e71d2d8c7feee6671516865f751d6 /lib/libalpm/add.c
parent36e48573ceee0f707de0dcc55d1da442d949d3dc (diff)
downloadpacman-af357d6ab00d8ca258dfd7abb689d6fd2eb4090f.tar.xz
Allow fileconflict if unowned file moving into backup array
The bulk of this commit is adding new tests to ensure the new behavior works without disrupting old behavior. This is a relatively sane maneuver when a package adds a conf file (e.g. '/etc/mercurial/hgrc') that was not previously in the package, but it is placed in the backup array. In essence, we can treat the existing file as having always been a part of the package and do our normal compare/install as pacnew logic checks. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/add.c')
-rw-r--r--lib/libalpm/add.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index e1827469..5e1bb8da 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -255,7 +255,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive,
alpm_backup_t *backup;
/* go to the backup array and see if our conflict is there */
/* check newpkg first, so that adding backup files is retroactive */
- backup = _alpm_needbackup(entryname, alpm_pkg_get_backup(newpkg));
+ backup = _alpm_needbackup(entryname, newpkg);
if(backup) {
/* if we force hash_orig to be non-NULL retroactive backup works */
hash_orig = "";
@@ -264,7 +264,7 @@ static int extract_single_file(alpm_handle_t *handle, struct archive *archive,
/* check oldpkg for a backup entry, store the hash if available */
if(oldpkg) {
- backup = _alpm_needbackup(entryname, alpm_pkg_get_backup(oldpkg));
+ backup = _alpm_needbackup(entryname, oldpkg);
if(backup) {
hash_orig = backup->hash;
needbackup = 1;