1 --- a/libopkg/opkg_install.c
2 +++ b/libopkg/opkg_install.c
5 pkg->state_flag |= SF_FILELIST_CHANGED;
9 pkg_remove_orphan_dependent(pkg, old_pkg);
11 + pkg->is_upgrade = 1;
13 /* XXX: BUG: we really should treat replacement more like an upgrade
14 * Instead, we're going to remove the replacees
20 - opkg_msg(INFO, "Installing maintainer scripts.\n");
21 + opkg_msg(INFO, "%s maintainer scripts.\n", (pkg->is_upgrade) ? ("Upgrading") : ("Installing"));
22 if (install_maintainer_scripts(pkg, old_pkg)) {
23 opkg_msg(ERROR, "Failed to extract maintainer scripts for %s."
24 " Package debris may remain!\n",
27 @@ -1285,6 +1285,12 @@
29 pkg->dest ? pkg->dest->root_dir : conf->default_dest->root_dir, 1);
31 + if (pkg->is_upgrade)
32 + setenv("PKG_UPGRADE", "1", 1);
34 + setenv("PKG_UPGRADE", "0", 1);
37 if (! file_exists(path)) {
43 /* this flag specifies whether the package was installed to satisfy another
44 * package's dependancies */