opkg_state_changed++;
pkg->state_flag |= SF_FILELIST_CHANGED;
- if (old_pkg)
+ if (old_pkg) {
pkg_remove_orphan_dependent(pkg, old_pkg);
-
+ old_pkg->is_upgrade = 1;
+ pkg->is_upgrade = 1;
+ }
/* XXX: BUG: we really should treat replacement more like an upgrade
* Instead, we're going to remove the replacees
*/
}
- opkg_msg(INFO, "Installing maintainer scripts.\n");
+ opkg_msg(INFO, "%s maintainer scripts.\n", (pkg->is_upgrade) ? ("Upgrading") : ("Installing"));
if (install_maintainer_scripts(pkg, old_pkg)) {
opkg_msg(ERROR, "Failed to extract maintainer scripts for %s."
" Package debris may remain!\n",
setenv("PKG_ROOT",
pkg->dest ? pkg->dest->root_dir : conf->default_dest->root_dir, 1);
+ if (pkg->is_upgrade)
+ setenv("PKG_UPGRADE", "1", 1);
+ else
+ setenv("PKG_UPGRADE", "0", 1);
+
+
if (! file_exists(path)) {
free(path);
return 0;