diff options
author | Andrew Gregory <andrew.gregory.8@gmail.com> | 2013-03-09 11:59:33 -0500 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2013-03-10 09:01:56 +1000 |
commit | c9b7f9b0d0a85a8106d144edfdf3d22a7f7f9802 (patch) | |
tree | 54ff3824f5327640feec94ddebeaf8f677f78b60 | |
parent | 0ff57350fbf359c9f0a6700da1f91250a1f9a239 (diff) | |
download | pacman-c9b7f9b0d0a85a8106d144edfdf3d22a7f7f9802.tar.xz |
testdb: quote output substitutions
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>
Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r-- | src/util/testdb.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/util/testdb.c b/src/util/testdb.c index 073acc3b..0ca7ffc8 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); |