[pacman-dev] [PATCH] libalpm/remove.c : switch back to lstat usage.
commit b55abdce7a changed every instance of lstat to alpm_stat to remove an eventual trailing /, but in remove.c, this is not wanted. Ref: http://www.archlinux.org/pipermail/pacman-dev/2007-December/010451.html Signed-off-by: Chantry Xavier <shiningxc@gmail.com> --- lib/libalpm/remove.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 0e8b57a..125719a 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -203,7 +203,7 @@ static void unlink_file(pmpkg_t *info, alpm_list_t *lp, pmtrans_t *trans) } } - if(_alpm_lstat(file, &buf)) { + if(lstat(file, &buf)) { _alpm_log(PM_LOG_DEBUG, "file %s does not exist\n", file); return; } -- 1.5.3.7
On Dec 22, 2007 2:25 PM, Chantry Xavier <shiningxc@gmail.com> wrote:
commit b55abdce7a changed every instance of lstat to alpm_stat to remove an eventual trailing /, but in remove.c, this is not wanted.
Ref: http://www.archlinux.org/pipermail/pacman-dev/2007-December/010451.html
Signed-off-by: Chantry Xavier <shiningxc@gmail.com> --- lib/libalpm/remove.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 0e8b57a..125719a 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -203,7 +203,7 @@ static void unlink_file(pmpkg_t *info, alpm_list_t *lp, pmtrans_t *trans) } }
- if(_alpm_lstat(file, &buf)) { + if(lstat(file, &buf)) {
Looks fine, but maybe we should stick a comment in the actual code saying why we use lstat and not our lstat wrapper?
_alpm_log(PM_LOG_DEBUG, "file %s does not exist\n", file); return; }
commit b55abdce7a changed every instance of lstat to alpm_stat to remove an eventual trailing /, but in remove.c, this is not wanted. Ref: http://www.archlinux.org/pipermail/pacman-dev/2007-December/010451.html Signed-off-by: Chantry Xavier <shiningxc@gmail.com> --- lib/libalpm/remove.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/lib/libalpm/remove.c b/lib/libalpm/remove.c index 0e8b57a..4f6d647 100644 --- a/lib/libalpm/remove.c +++ b/lib/libalpm/remove.c @@ -203,7 +203,11 @@ static void unlink_file(pmpkg_t *info, alpm_list_t *lp, pmtrans_t *trans) } } - if(_alpm_lstat(file, &buf)) { + /* we want to do a lstat here, and not a _alpm_lstat. + * if a directory in the package is actually a directory symlink on the + * filesystem, we want to work with the linked directory instead of the + * actual symlink */ + if(lstat(file, &buf)) { _alpm_log(PM_LOG_DEBUG, "file %s does not exist\n", file); return; } -- 1.5.3.7
participants (2)
-
Chantry Xavier
-
Dan McGee