[pacman-dev] Issue while testing largefile support
Interesting debug output while testing largefile support in pacman (http://bugs.archlinux.org/task/7578): [14:55:58] debug: config: finished parsing /usr/local/etc/pacman.conf [14:55:58] debug: registering database 'local' [14:55:58] debug: opening database 'local' [14:55:58] debug: opening database from path '/usr/local/var/lib/pacman/local/' loading package data... [14:55:58] debug: loading target 'largepackage-1-3-i686.pkg.tar.gz' [14:55:58] debug: reading 'largepackage' metadata done. checking dependencies... [14:56:58] debug: looking for unsatisfied dependencies [14:56:58] debug: loading package cache for repository 'local' [14:56:58] debug: cannot find package installed 'largepackage' [14:56:58] debug: looking for conflicts [14:56:58] debug: checkconflicts: db vs target 'largepackage' [14:56:59] debug: sorting by dependencies [14:56:59] debug: started sorting dependencies [14:56:59] debug: sorting dependencies finished done. checking for file conflicts... [14:56:59] debug: looking for file conflicts [14:56:59] debug: searching for filesystem conflicts: largepackage [14:56:59] debug: /opt/ is a directory, not a conflict [14:56:59] debug: /opt/largefile is a directory, not a conflict done. installing largepackage... [14:56:59] debug: adding package largepackage-1-3 [14:56:59] debug: extracting files [14:56:59] debug: decompression progress: 0.001907% (40960 / -2146827972) [14:56:59] debug: decompression progress: 0.001907% (40960 / -2146827972) [14:56:59] debug: decompression progress: 0.001907% (40960 / -2146827972) [14:56:59] debug: extracting /opt/ [14:56:59] debug: warning extracting opt/ (Already exists: File exists) [14:56:59] debug: decompression progress: 0.001907% (40960 / -2146827972) [14:56:59] debug: extracting /opt/largefile [14:59:25] debug: updating database [14:59:25] debug: adding database entry 'largepackage' [14:59:25] debug: writing largepackage-1-3 DESC information back to db [14:59:25] debug: writing largepackage-1-3 FILES information back to db [14:59:25] debug: writing largepackage-1-3 DEPENDS information back to db [14:59:25] debug: adding entry 'largepackage' in 'local' cache [14:59:25] debug: package has no dependencies, no other packages to update done. [14:59:25] debug: running "ldconfig -r /" Here is the package filelist: opt/ (directory) opt/largefile (a 2GB sized normal file) Notice what the above output says- that /opt/largefile is a directory, not a conflict. Clearly a problem here. This is pacman built off my working branch, so not including any recent patches from Andrew or Chantry with regards to the overwrite stuff. -Dan
Dan McGee wrote:
Interesting debug output while testing largefile support in pacman (http://bugs.archlinux.org/task/7578):
[14:55:58] debug: config: finished parsing /usr/local/etc/pacman.conf
[14:55:58] debug: registering database 'local' [14:55:58] debug: opening database 'local' [14:55:58] debug: opening database from path '/usr/local/var/lib/pacman/local/' loading package data... [14:55:58] debug: loading target 'largepackage-1-3-i686.pkg.tar.gz' [14:55:58] debug: reading 'largepackage' metadata done. checking dependencies... [14:56:58] debug: looking for unsatisfied dependencies [14:56:58] debug: loading package cache for repository 'local' [14:56:58] debug: cannot find package installed 'largepackage' [14:56:58] debug: looking for conflicts [14:56:58] debug: checkconflicts: db vs target 'largepackage' [14:56:59] debug: sorting by dependencies [14:56:59] debug: started sorting dependencies [14:56:59] debug: sorting dependencies finished done. checking for file conflicts... [14:56:59] debug: looking for file conflicts [14:56:59] debug: searching for filesystem conflicts: largepackage [14:56:59] debug: /opt/ is a directory, not a conflict [14:56:59] debug: /opt/largefile is a directory, not a conflict done. installing largepackage... [14:56:59] debug: adding package largepackage-1-3 [14:56:59] debug: extracting files [14:56:59] debug: decompression progress: 0.001907% (40960 / -2146827972) [14:56:59] debug: decompression progress: 0.001907% (40960 / -2146827972) [14:56:59] debug: decompression progress: 0.001907% (40960 / -2146827972) [14:56:59] debug: extracting /opt/ [14:56:59] debug: warning extracting opt/ (Already exists: File exists) [14:56:59] debug: decompression progress: 0.001907% (40960 / -2146827972) [14:56:59] debug: extracting /opt/largefile [14:59:25] debug: updating database [14:59:25] debug: adding database entry 'largepackage' [14:59:25] debug: writing largepackage-1-3 DESC information back to db [14:59:25] debug: writing largepackage-1-3 FILES information back to db [14:59:25] debug: writing largepackage-1-3 DEPENDS information back to db [14:59:25] debug: adding entry 'largepackage' in 'local' cache [14:59:25] debug: package has no dependencies, no other packages to update done. [14:59:25] debug: running "ldconfig -r /"
Here is the package filelist: opt/ (directory) opt/largefile (a 2GB sized normal file)
Notice what the above output says- that /opt/largefile is a directory, not a conflict. Clearly a problem here. This is pacman built off my working branch, so not including any recent patches from Andrew or Chantry with regards to the overwrite stuff.
-Dan
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev I noticed this last night, it's a stupid error message, it prints that message when the file doesn't exist on the filesystem.
Andrew
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net> --- lib/libalpm/conflict.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 3755fcd..adaba1a 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -506,7 +506,8 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root) path, p1->name, NULL); } } else { - _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); + if(S_ISDIR(buf.st_mode)) + _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); } } alpm_list_free_inner(tmpfiles, &free); -- 1.5.2.3
On Tue, Jul 10, 2007 at 04:31:13PM +0100, Andrew Fyfe wrote:
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net> --- lib/libalpm/conflict.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 3755fcd..adaba1a 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -506,7 +506,8 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root) path, p1->name, NULL); } } else { - _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); + if(S_ISDIR(buf.st_mode)) + _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); } } alpm_list_free_inner(tmpfiles, &free); -- 1.5.2.3
That looks correct but a bit weird ;) Why not just splitting the if condition, so we can correctly check for lstat failure, instead of making the S_ISDIR check a second time ?
On Tue, Jul 10, 2007 at 05:44:24PM +0200, Xavier wrote:
On Tue, Jul 10, 2007 at 04:31:13PM +0100, Andrew Fyfe wrote:
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net> --- lib/libalpm/conflict.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 3755fcd..adaba1a 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -506,7 +506,8 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root) path, p1->name, NULL); } } else { - _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); + if(S_ISDIR(buf.st_mode)) + _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); } } alpm_list_free_inner(tmpfiles, &free); -- 1.5.2.3
That looks correct but a bit weird ;) Why not just splitting the if condition, so we can correctly check for lstat failure, instead of making the S_ISDIR check a second time ?
Here is what I had in mind :
From 28108f35d00774bf29f4ed180b4a6d89e988c2f0 Mon Sep 17 00:00:00 2001 From: Chantry Xavier <shiningxc@gmail.com> Date: Fri, 13 Jul 2007 10:41:40 +0200 Subject: [PATCH] Remove conflict message for no-existent files (reworked).
Signed-off-by: Chantry Xavier <shiningxc@gmail.com> --- lib/libalpm/conflict.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 9ee8985..3eab6b1 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -432,7 +432,12 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root) snprintf(path, PATH_MAX, "%s%s", root, filestr); /* stat the file - if it exists and is not a dir, do some checks */ - if(lstat(path, &buf) == 0 && !S_ISDIR(buf.st_mode)) { + if(lstat(path, &buf) != 0) { + continue; + } + if(S_ISDIR(buf.st_mode)) { + _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); + } else { _alpm_log(PM_LOG_DEBUG, "checking possible conflict: %s", path); /* Make sure the possible conflict is not a symlink that points to a @@ -496,9 +501,6 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root) conflicts = add_fileconflict(conflicts, PM_CONFLICT_TYPE_FILE, path, p1->name, NULL); } - } else { - if(S_ISDIR(buf.st_mode)) - _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); } } alpm_list_free_inner(tmpfiles, &free); -- 1.5.2.2
Xavier wrote:
On Tue, Jul 10, 2007 at 05:44:24PM +0200, Xavier wrote:
On Tue, Jul 10, 2007 at 04:31:13PM +0100, Andrew Fyfe wrote:
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net> --- lib/libalpm/conflict.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 3755fcd..adaba1a 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -506,7 +506,8 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root) path, p1->name, NULL); } } else { - _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); + if(S_ISDIR(buf.st_mode)) + _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); } } alpm_list_free_inner(tmpfiles, &free); -- 1.5.2.3
That looks correct but a bit weird ;) Why not just splitting the if condition, so we can correctly check for lstat failure, instead of making the S_ISDIR check a second time ?
Here is what I had in mind :
From 28108f35d00774bf29f4ed180b4a6d89e988c2f0 Mon Sep 17 00:00:00 2001 From: Chantry Xavier <shiningxc@gmail.com> Date: Fri, 13 Jul 2007 10:41:40 +0200 Subject: [PATCH] Remove conflict message for no-existent files (reworked).
Signed-off-by: Chantry Xavier <shiningxc@gmail.com> --- lib/libalpm/conflict.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 9ee8985..3eab6b1 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -432,7 +432,12 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root) snprintf(path, PATH_MAX, "%s%s", root, filestr);
/* stat the file - if it exists and is not a dir, do some checks */ - if(lstat(path, &buf) == 0 && !S_ISDIR(buf.st_mode)) { + if(lstat(path, &buf) != 0) { + continue; + } + if(S_ISDIR(buf.st_mode)) { + _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); + } else { _alpm_log(PM_LOG_DEBUG, "checking possible conflict: %s", path);
/* Make sure the possible conflict is not a symlink that points to a @@ -496,9 +501,6 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root) conflicts = add_fileconflict(conflicts, PM_CONFLICT_TYPE_FILE, path, p1->name, NULL); } - } else { - if(S_ISDIR(buf.st_mode)) - _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); } } alpm_list_free_inner(tmpfiles, &free); That make more sense :)
Andrew
On 7/13/07, Andrew Fyfe <andrew@neptune-one.net> wrote:
Xavier wrote:
On Tue, Jul 10, 2007 at 05:44:24PM +0200, Xavier wrote:
On Tue, Jul 10, 2007 at 04:31:13PM +0100, Andrew Fyfe wrote:
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net> --- lib/libalpm/conflict.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 3755fcd..adaba1a 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -506,7 +506,8 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root) path, p1->name, NULL); } } else { - _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); + if(S_ISDIR(buf.st_mode)) + _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); } } alpm_list_free_inner(tmpfiles, &free); -- 1.5.2.3
That looks correct but a bit weird ;) Why not just splitting the if condition, so we can correctly check for lstat failure, instead of making the S_ISDIR check a second time ?
Here is what I had in mind :
From 28108f35d00774bf29f4ed180b4a6d89e988c2f0 Mon Sep 17 00:00:00 2001 From: Chantry Xavier <shiningxc@gmail.com> Date: Fri, 13 Jul 2007 10:41:40 +0200 Subject: [PATCH] Remove conflict message for no-existent files (reworked).
Signed-off-by: Chantry Xavier <shiningxc@gmail.com> --- lib/libalpm/conflict.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 9ee8985..3eab6b1 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -432,7 +432,12 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root) snprintf(path, PATH_MAX, "%s%s", root, filestr);
/* stat the file - if it exists and is not a dir, do some checks */ - if(lstat(path, &buf) == 0 && !S_ISDIR(buf.st_mode)) { + if(lstat(path, &buf) != 0) { + continue; + } + if(S_ISDIR(buf.st_mode)) { + _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); + } else { _alpm_log(PM_LOG_DEBUG, "checking possible conflict: %s", path);
/* Make sure the possible conflict is not a symlink that points to a @@ -496,9 +501,6 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root) conflicts = add_fileconflict(conflicts, PM_CONFLICT_TYPE_FILE, path, p1->name, NULL); } - } else { - if(S_ISDIR(buf.st_mode)) - _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); } } alpm_list_free_inner(tmpfiles, &free); That make more sense :)
Minor prodding here as I'm catching up on things I missed - is this in someone's git tree? Was it merged anywhere?
On 7/27/07, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
On 7/13/07, Andrew Fyfe <andrew@neptune-one.net> wrote:
Xavier wrote:
On Tue, Jul 10, 2007 at 05:44:24PM +0200, Xavier wrote:
On Tue, Jul 10, 2007 at 04:31:13PM +0100, Andrew Fyfe wrote:
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net> --- lib/libalpm/conflict.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 3755fcd..adaba1a 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -506,7 +506,8 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root) path, p1->name, NULL); } } else { - _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); + if(S_ISDIR(buf.st_mode)) + _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); } } alpm_list_free_inner(tmpfiles, &free); -- 1.5.2.3
That looks correct but a bit weird ;) Why not just splitting the if condition, so we can correctly check for lstat failure, instead of making the S_ISDIR check a second time ?
Here is what I had in mind :
From 28108f35d00774bf29f4ed180b4a6d89e988c2f0 Mon Sep 17 00:00:00 2001 From: Chantry Xavier <shiningxc@gmail.com> Date: Fri, 13 Jul 2007 10:41:40 +0200 Subject: [PATCH] Remove conflict message for no-existent files (reworked).
Signed-off-by: Chantry Xavier <shiningxc@gmail.com> --- lib/libalpm/conflict.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/libalpm/conflict.c b/lib/libalpm/conflict.c index 9ee8985..3eab6b1 100644 --- a/lib/libalpm/conflict.c +++ b/lib/libalpm/conflict.c @@ -432,7 +432,12 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root) snprintf(path, PATH_MAX, "%s%s", root, filestr);
/* stat the file - if it exists and is not a dir, do some checks */ - if(lstat(path, &buf) == 0 && !S_ISDIR(buf.st_mode)) { + if(lstat(path, &buf) != 0) { + continue; + } + if(S_ISDIR(buf.st_mode)) { + _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); + } else { _alpm_log(PM_LOG_DEBUG, "checking possible conflict: %s", path);
/* Make sure the possible conflict is not a symlink that points to a @@ -496,9 +501,6 @@ alpm_list_t *_alpm_db_find_conflicts(pmdb_t *db, pmtrans_t *trans, char *root) conflicts = add_fileconflict(conflicts, PM_CONFLICT_TYPE_FILE, path, p1->name, NULL); } - } else { - if(S_ISDIR(buf.st_mode)) - _alpm_log(PM_LOG_DEBUG, "%s is a directory, not a conflict", path); } } alpm_list_free_inner(tmpfiles, &free); That make more sense :)
Minor prodding here as I'm catching up on things I missed - is this in someone's git tree? Was it merged anywhere?
_______________________________________________ pacman-dev mailing list pacman-dev@archlinux.org http://archlinux.org/mailman/listinfo/pacman-dev
Yeah, this should have been merged somewhere, almost positive. And here we go: 8d62835ba18a7fb662c2f3a23b86a16fe1386388 -Dan
On 7/10/07, Andrew Fyfe <andrew@neptune-one.net> wrote:
I noticed this last night, it's a stupid error message, it prints that message when the file doesn't exist on the filesystem.
Just following up here... did someone fix this error message? It's trivial sure, but I'm going through some older emails here.
On 7/13/07, Aaron Griffin <aaronmgriffin@gmail.com> wrote:
On 7/10/07, Andrew Fyfe <andrew@neptune-one.net> wrote:
I noticed this last night, it's a stupid error message, it prints that message when the file doesn't exist on the filesystem.
Just following up here... did someone fix this error message? It's trivial sure, but I'm going through some older emails here.
Fixed twice: http://projects.archlinux.org/git/?p=pacman.git;a=commit;h=9a9928f1b88f4fa08... http://projects.archlinux.org/git/?p=pacman.git;a=commit;h=8d62835ba18a7fb66... -Dan
participants (4)
-
Aaron Griffin
-
Andrew Fyfe
-
Dan McGee
-
Xavier