Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   ArchLinux Pacman Development (http://www.linux-archive.org/archlinux-pacman-development/)
-   -   Avoid upgrade conflict with unchanged effective path (http://www.linux-archive.org/archlinux-pacman-development/688545-avoid-upgrade-conflict-unchanged-effective-path.html)

Allan McRae 07-29-2012 06:18 AM

Avoid upgrade conflict with unchanged effective path
 
This applies to a case such as when /lib is a symlink to /usr/lib. If a
package is installed which contains /lib/libfoo.so, pacman will complain
if this package is then "fixed" to contain /usr/lib/libfoo.so. Since
these have the same effective path and it exists within the same
package, ignore the conflict.

Fixes FS#30681.

Signed-off-by: Allan McRae <allan@archlinux.org>
---
lib/libalpm/conflict.c | 1 +
lib/libalpm/filelist.c | 5 ++---
test/pacman/tests/fileconflict013.py | 2 --
3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c
index afef56c..f087ace 100644
--- a/lib/libalpm/conflict.c
+++ b/lib/libalpm/conflict.c
@@ -396,6 +396,7 @@ alpm_list_t *_alpm_db_find_fileconflicts(alpm_handle_t *handle,
_alpm_log(handle, ALPM_LOG_DEBUG, "searching for filesystem conflicts: %s
",
p1->name);
dbpkg = _alpm_db_get_pkgfromcache(handle->db_local, p1->name);
+ _alpm_filelist_resolve(handle, alpm_pkg_get_files(dbpkg));

/* Do two different checks here. If the package is currently installed,
* then only check files that are new in the new package. If the package
diff --git a/lib/libalpm/filelist.c b/lib/libalpm/filelist.c
index 59bf1ec..9b7b8bd 100644
--- a/lib/libalpm/filelist.c
+++ b/lib/libalpm/filelist.c
@@ -190,9 +190,8 @@ alpm_list_t *_alpm_filelist_difference(alpm_filelist_t *filesA,

while(ctrA < filesA->count && ctrB < filesB->count) {
alpm_file_t *fileA = filesA->files + ctrA;
- alpm_file_t *fileB = filesB->files + ctrB;
- const char *strA = fileA->name;
- const char *strB = fileB->name;
+ const char *strA = filesA->resolved_path[ctrA];
+ const char *strB = filesB->resolved_path[ctrB];
/* skip directories, we don't care about them */
if(strA[strlen(strA)-1] == '/') {
ctrA++;
diff --git a/test/pacman/tests/fileconflict013.py b/test/pacman/tests/fileconflict013.py
index 521b62e..a83923c 100644
--- a/test/pacman/tests/fileconflict013.py
+++ b/test/pacman/tests/fileconflict013.py
@@ -18,5 +18,3 @@

self.addrule("PACMAN_RETCODE=0")
self.addrule("PKG_VERSION=pkg1|1.0-2")
-
-self.expectfailure = True
--
1.7.11.3


All times are GMT. The time now is 09:35 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.