Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/src/util/testpkg.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-03 15:46:06 -0500
committerDan McGee <dan@archlinux.org>2011-06-07 11:37:05 -0500
commit19755b648c80f637a430ba5c914db76264024c9a (patch)
tree49ff0f6940ca12b5e0160ef0bf1637059218941d /src/util/testpkg.c
parentfb4b422fc4567238332050b9a6c8c1cac2a8f091 (diff)
Update utilities for new initialize/release methods
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/util/testpkg.c')
-rw-r--r--src/util/testpkg.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/util/testpkg.c b/src/util/testpkg.c
index ad6ec30b..20920ff0 100644
--- a/src/util/testpkg.c
+++ b/src/util/testpkg.c
@@ -40,6 +40,8 @@ static void output_cb(pmloglevel_t level, const char *fmt, va_list args)
int main(int argc, char *argv[])
{
int retval = 1; /* default = false */
+ pmhandle_t *handle;
+ enum _pmerrno_t err;
pmpkg_t *pkg = NULL;
if(argc != 2) {
@@ -47,8 +49,9 @@ int main(int argc, char *argv[])
return 1;
}
- if(alpm_initialize() == -1) {
- fprintf(stderr, "cannot initialize alpm: %s\n", alpm_strerrorlast());
+ handle = alpm_initialize(ROOTDIR, DBPATH, &err);
+ if(!handle) {
+ fprintf(stderr, "cannot initialize alpm: %s\n", alpm_strerror(err));
return 1;
}
@@ -76,8 +79,8 @@ int main(int argc, char *argv[])
retval = 0;
}
- if(alpm_release() == -1) {
- fprintf(stderr, "error releasing alpm: %s\n", alpm_strerrorlast());
+ if(alpm_release(handle) == -1) {
+ fprintf(stderr, "error releasing alpm\n");
}
return retval;