diff --git a/bin/xbps-bin/main.c b/bin/xbps-bin/main.c index 0feee5e6c0..1fb47372c1 100644 --- a/bin/xbps-bin/main.c +++ b/bin/xbps-bin/main.c @@ -113,7 +113,7 @@ main(int argc, char **argv) break; case 'v': verbose = true; - flags |= XBPS_VERBOSE; + flags |= XBPS_FLAG_VERBOSE; break; case '?': default: diff --git a/include/xbps_api.h b/include/xbps_api.h index a4b8d065c4..b3c9eba61f 100644 --- a/include/xbps_api.h +++ b/include/xbps_api.h @@ -58,7 +58,8 @@ #define XBPS_PKGINDEX_VERSION "1.0" /* Verbose messages */ -#define XBPS_VERBOSE 0x00000001 +#define XBPS_FLAG_VERBOSE 0x00000001 +#define XBPS_FLAG_FORCE 0x00000002 #define ARCHIVE_READ_BLOCKSIZE 10240 diff --git a/lib/remove.c b/lib/remove.c index 81a1b61145..67a0cf09bb 100644 --- a/lib/remove.c +++ b/lib/remove.c @@ -97,7 +97,7 @@ remove_pkg_metadir(const char *pkgname) } if ((rv = unlink(path)) == -1) { - if (flags & XBPS_VERBOSE) + if (flags & XBPS_FLAG_VERBOSE) printf("WARNING: can't remove %s (%s)\n", pkgname, strerror(errno)); } @@ -144,13 +144,13 @@ remove_pkg_files(prop_dictionary_t dict) return EINVAL; } if ((rv = remove(path)) == -1) { - if (flags & XBPS_VERBOSE) + if (flags & XBPS_FLAG_VERBOSE) printf("WARNING: can't remove link %s (%s)\n", file, strerror(errno)); free(path); continue; } - if (flags & XBPS_VERBOSE) + if (flags & XBPS_FLAG_VERBOSE) printf("Removed link: %s\n", file); free(path); @@ -199,7 +199,7 @@ files: free(path); continue; } else if (rv == ERANGE) { - if (flags & XBPS_VERBOSE) + if (flags & XBPS_FLAG_VERBOSE) printf("WARNING: SHA256 doesn't match " "for %s %s, ignoring...\n", curftype, file); @@ -211,14 +211,14 @@ files: return rv; } if ((rv = remove(path)) == -1) { - if (flags & XBPS_VERBOSE) + if (flags & XBPS_FLAG_VERBOSE) printf("WARNING: can't remove " "%s %s (%s)\n", curftype, file, strerror(errno)); free(path); continue; } - if (flags & XBPS_VERBOSE) + if (flags & XBPS_FLAG_VERBOSE) printf("Removed %s: %s\n", curftype, file); free(path); @@ -256,7 +256,7 @@ dirs: free(path); continue; } - if (flags & XBPS_VERBOSE) { + if (flags & XBPS_FLAG_VERBOSE) { printf("WARNING: can't remove " "directory %s (%s)\n", file, strerror(errno)); @@ -264,7 +264,7 @@ dirs: continue; } } - if (flags & XBPS_VERBOSE) + if (flags & XBPS_FLAG_VERBOSE) printf("Removed directory: %s\n", file); free(path); diff --git a/lib/unpack.c b/lib/unpack.c index 36a34ff93c..a196337ce3 100644 --- a/lib/unpack.c +++ b/lib/unpack.c @@ -232,7 +232,7 @@ unpack_archive_fini(struct archive *ar, prop_dictionary_t pkg, archive_error_string(ar)); return rv;; } else if (rv == EEXIST) { - if (flags & XBPS_VERBOSE) { + if (flags & XBPS_FLAG_VERBOSE) { printf("WARNING: ignoring existent " "path: %s\n", archive_entry_pathname(entry)); @@ -241,7 +241,7 @@ unpack_archive_fini(struct archive *ar, prop_dictionary_t pkg, continue; } } - if (flags & XBPS_VERBOSE) { + if (flags & XBPS_FLAG_VERBOSE) { printf(" %s\n", archive_entry_pathname(entry)); (void)fflush(stdout); }