summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-15 00:11:12 (EST)
committer ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358>2008-12-15 00:11:12 (EST)
commitbd09c115217e960cc1dff73d322e3e9581cf2d33 (patch)
treea2f52c696e32554b72f7a80c356b8b6f97f0267f /tests
parent20d4f5551c46c3be45255fc31c08f2b8be679fc3 (diff)
opkg: add progress callbacks to libopkg api
libopkg: fix opkg_install_package() git-svn-id: http://opkg.googlecode.com/svn/trunk@80 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'tests')
-rw-r--r--tests/libopkg_test.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/libopkg_test.c b/tests/libopkg_test.c
index fd39778..49aef22 100644
--- a/tests/libopkg_test.c
+++ b/tests/libopkg_test.c
@@ -1,5 +1,13 @@
#include <opkg.h>
#include <stdlib.h>
+#include <stdio.h>
+
+void
+progress_callback (opkg_t *opkg, int percent, void *data)
+{
+ printf ("%s %d\n", (char*) data, percent);
+}
+
int
main (int argc, char **argv)
@@ -13,9 +21,13 @@ main (int argc, char **argv)
opkg_read_config_files (opkg);
- err = opkg_update_package_lists (opkg);
+ err = opkg_update_package_lists (opkg, progress_callback, "Updating...");
printf ("opkg_update_package_lists returned %d\n", err);
+ err = opkg_install_package (opkg, "aspell", progress_callback, "Installing...");
+
+ printf ("opkg_install_package returned %d\n", err);
+
opkg_free (opkg);
}