From bd09c115217e960cc1dff73d322e3e9581cf2d33 Mon Sep 17 00:00:00 2001 From: ticktock35 Date: Mon, 15 Dec 2008 00:11:12 -0500 Subject: 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 --- (limited to 'tests') 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 #include +#include + +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); } -- cgit v0.9.1