6 progress_callback (opkg_t
*opkg
, int percent
, void *data
)
8 printf ("\r%s %3d%%", (char*) data
, percent
);
14 main (int argc
, char **argv
)
21 opkg_set_option (opkg
, "offline_root", "/tmp/");
23 opkg_read_config_files (opkg
);
25 err
= opkg_update_package_lists (opkg
, progress_callback
, "Updating...");
26 printf ("\nopkg_update_package_lists returned %d\n", err
);
28 err
= opkg_install_package (opkg
, "aspell", progress_callback
, "Installing...");
29 printf ("\nopkg_install_package returned %d\n", err
);
31 err
= opkg_upgrade_package (opkg
, "aspell", progress_callback
, "Upgrading...");
32 printf ("\nopkg_upgrade_package returned %d\n", err
);
34 err
= opkg_upgrade_all (opkg
, progress_callback
, "Upgrading all...");
35 printf ("\nopkg_upgrade_package returned %d\n", err
);
37 err
= opkg_remove_package (opkg
, "aspell", progress_callback
, "Removing...");
38 printf ("\nopkg_remove_package returned %d\n", err
);