libxbps: require a pointer to xbps_handle in functions that need it.

This removes 2 global vars from lib/initend.c and easier to know
what functions require access to xbps_handle.
This commit is contained in:
Juan RP
2012-06-14 08:22:11 +02:00
parent a3adbcda95
commit 3e9e87fc2a
60 changed files with 1143 additions and 901 deletions

View File

@@ -36,7 +36,8 @@
#include "xbps_api_impl.h"
int HIDDEN
xbps_remove_obsoletes(const char *pkgname,
xbps_remove_obsoletes(struct xbps_handle *xhp,
const char *pkgname,
const char *version,
const char *pkgver,
prop_dictionary_t oldd,
@@ -131,14 +132,16 @@ again:
* Obsolete obj found, remove it.
*/
if (remove(file) == -1) {
xbps_set_cb_state(XBPS_STATE_REMOVE_FILE_OBSOLETE_FAIL,
xbps_set_cb_state(xhp,
XBPS_STATE_REMOVE_FILE_OBSOLETE_FAIL,
errno, pkgname, version,
"%s: failed to remove obsolete entry `%s': %s",
pkgver, file, strerror(errno));
free(file);
continue;
}
xbps_set_cb_state(XBPS_STATE_REMOVE_FILE_OBSOLETE,
xbps_set_cb_state(xhp,
XBPS_STATE_REMOVE_FILE_OBSOLETE,
0, pkgname, version,
"Removed obsolete entry: %s", file);
free(file);