[pacman-dev] [PATCH 1/2] testdb: pass empty local pkglist to alpm_checkdeps
Passing the local package list to alpm_checkdeps as both the local packages and packages to be upgraded did nothing but cause extra overhead as the packages were all removed from the installed package list because they were being upgraded. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> --- src/util/testdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/testdb.c b/src/util/testdb.c index 7b08cb0..073acc3 100644 --- a/src/util/testdb.c +++ b/src/util/testdb.c @@ -98,7 +98,7 @@ static int check_deps(alpm_list_t *pkglist) alpm_list_t *data, *i; int ret = 0; /* check dependencies */ - data = alpm_checkdeps(handle, pkglist, NULL, pkglist, 0); + data = alpm_checkdeps(handle, NULL, NULL, pkglist, 0); for(i = data; i; i = alpm_list_next(i)) { alpm_depmissing_t *miss = i->data; char *depstring = alpm_dep_compute_string(miss->depend); -- 1.8.1.5
Quoting output substitutions makes whitespace errors such as FS#30101 much more obvious: old: missing perl-test-pod dependency for perl-test-output new: missing 'perl-test-pod ' dependency for 'perl-test-output' Several of the quoted substitutions should not be capable of containing whitespace in theory, but this errs on the side of caution as the point of the tool is to find error conditions. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> --- src/util/testdb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/util/testdb.c b/src/util/testdb.c index 073acc3..0ca7ffc 100644 --- a/src/util/testdb.c +++ b/src/util/testdb.c @@ -64,7 +64,7 @@ static int check_localdb_files(void) dbpath = alpm_option_get_dbpath(handle); snprintf(path, sizeof(path), "%slocal", dbpath); if(!(dir = opendir(path))) { - fprintf(stderr, "error : %s : %s\n", path, strerror(errno)); + fprintf(stderr, "error : '%s' : %s\n", path, strerror(errno)); return 1; } @@ -76,12 +76,12 @@ static int check_localdb_files(void) /* check for known db files in local database */ snprintf(path, sizeof(path), "%slocal/%s/desc", dbpath, ent->d_name); if(access(path, F_OK)) { - printf("%s: description file is missing\n", ent->d_name); + printf("'%s': description file is missing\n", ent->d_name); ret++; } snprintf(path, sizeof(path), "%slocal/%s/files", dbpath, ent->d_name); if(access(path, F_OK)) { - printf("%s: file list is missing\n", ent->d_name); + printf("'%s': file list is missing\n", ent->d_name); ret++; } } @@ -102,7 +102,7 @@ static int check_deps(alpm_list_t *pkglist) for(i = data; i; i = alpm_list_next(i)) { alpm_depmissing_t *miss = i->data; char *depstring = alpm_dep_compute_string(miss->depend); - printf("missing %s dependency for %s\n", depstring, miss->target); + printf("missing '%s' dependency for '%s'\n", depstring, miss->target); free(depstring); ret++; } @@ -118,7 +118,7 @@ static int check_conflicts(alpm_list_t *pkglist) data = alpm_checkconflicts(handle, pkglist); for(i = data; i; i = i->next) { alpm_conflict_t *conflict = i->data; - printf("%s conflicts with %s\n", + printf("'%s' conflicts with '%s'\n", conflict->package1, conflict->package2); ret++; } @@ -185,7 +185,7 @@ static int check_filelists(alpm_list_t *pkglist) for(j = 0; j < offset; j++) { struct fileitem *fileitem = all_files + j; if(prev_fileitem && fileitem_cmp(prev_fileitem, fileitem) == 0) { - printf("file owned by %s and %s: %s\n", + printf("file owned by '%s' and '%s': '%s'\n", alpm_pkg_get_name(prev_fileitem->pkg), alpm_pkg_get_name(fileitem->pkg), fileitem->file->name); -- 1.8.1.5
participants (1)
-
Andrew Gregory