+ pkg_t *pkg;
+
+ opkg_assert (opkg != NULL);
+ opkg_assert (package_name != NULL);
+
+ progress (0);
+
+ pkg_info_preinstall_check (opkg->conf);
+
+ if (opkg->conf->restrict_to_default_dest)
+ {
+ pkg = pkg_hash_fetch_installed_by_name_dest (&opkg->conf->pkg_hash,
+ package_name,
+ opkg->conf->default_dest);
+ if (pkg == NULL)
+ {
+ /* XXX: Error: Package not installed in default_dest */
+ return 1;
+ }
+ }
+ else
+ {
+ pkg = pkg_hash_fetch_installed_by_name (&opkg->conf->pkg_hash,
+ package_name);
+ }
+
+ if (!pkg)
+ {
+ /* XXX: Error: Package not installed */
+ return 1;
+ }
+
+ progress (25);
+
+ opkg_upgrade_pkg (opkg->conf, pkg);
+ progress (75);
+
+ opkg_configure_packages (opkg->conf, NULL);
+ progress (100);
+ return 0;