Make some xbps_warn_printf dependent of XBPS_FLAG_VERBOSE.

This commit is contained in:
Juan RP 2011-01-30 18:38:16 +01:00
parent 5c7eaf2f92
commit da607becf9
2 changed files with 9 additions and 5 deletions

View File

@ -151,6 +151,7 @@ xbps_remove_pkg_files(prop_dictionary_t dict, const char *key)
* Remove the object if possible. * Remove the object if possible.
*/ */
if (remove(path) == -1) { if (remove(path) == -1) {
if (flags & XBPS_FLAG_VERBOSE)
xbps_warn_printf("can't remove %s `%s': %s\n", xbps_warn_printf("can't remove %s `%s': %s\n",
curobj, file, strerror(errno)); curobj, file, strerror(errno));

View File

@ -169,7 +169,7 @@ unpack_archive(prop_dictionary_t pkg_repod,
size_t nmetadata = 0, entry_idx = 0; size_t nmetadata = 0, entry_idx = 0;
const char *rootdir, *entry_pname, *transact; const char *rootdir, *entry_pname, *transact;
char *buf; char *buf;
int rv, flags; int rv, flags, xflags;
bool preserve, update, replace_files_in_pkg_update; bool preserve, update, replace_files_in_pkg_update;
assert(ar != NULL); assert(ar != NULL);
@ -179,6 +179,7 @@ unpack_archive(prop_dictionary_t pkg_repod,
preserve = update = false; preserve = update = false;
rootdir = xbps_get_rootdir(); rootdir = xbps_get_rootdir();
xflags = xbps_get_flags();
if (chdir(rootdir) == -1) { if (chdir(rootdir) == -1) {
xbps_error_printf("cannot chdir to rootdir for " xbps_error_printf("cannot chdir to rootdir for "
@ -415,8 +416,10 @@ unpack_archive(prop_dictionary_t pkg_repod,
pkgname, version, strerror(rv)); pkgname, version, strerror(rv));
goto out; goto out;
} else { } else {
if (xflags & XBPS_FLAG_VERBOSE)
xbps_warn_printf("ignoring existing " xbps_warn_printf("ignoring existing "
"entry: %s\n", entry_pname); "entry: %s\n", entry_pname);
RUN_PROGRESS_CB(); RUN_PROGRESS_CB();
continue; continue;
} }