2014-12-08 17:40:53 +00:00
|
|
|
--- a/libopkg/opkg_install.c
|
|
|
|
+++ b/libopkg/opkg_install.c
|
2016-11-21 14:14:02 +00:00
|
|
|
@@ -1405,9 +1405,11 @@ opkg_install_pkg(pkg_t *pkg, int from_up
|
2014-12-08 17:40:53 +00:00
|
|
|
opkg_state_changed++;
|
|
|
|
pkg->state_flag |= SF_FILELIST_CHANGED;
|
|
|
|
|
|
|
|
- if (old_pkg)
|
|
|
|
+ if (old_pkg) {
|
|
|
|
pkg_remove_orphan_dependent(pkg, old_pkg);
|
|
|
|
-
|
2016-11-21 14:14:02 +00:00
|
|
|
+ old_pkg->is_upgrade = 1;
|
2014-09-11 12:27:09 +00:00
|
|
|
+ pkg->is_upgrade = 1;
|
2014-12-08 17:40:53 +00:00
|
|
|
+ }
|
|
|
|
/* XXX: BUG: we really should treat replacement more like an upgrade
|
|
|
|
* Instead, we're going to remove the replacees
|
|
|
|
*/
|
2016-11-21 14:14:02 +00:00
|
|
|
@@ -1466,7 +1468,7 @@ opkg_install_pkg(pkg_t *pkg, int from_up
|
2014-09-11 12:27:09 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- 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",
|
2014-12-08 17:40:53 +00:00
|
|
|
--- a/libopkg/pkg.c
|
|
|
|
+++ b/libopkg/pkg.c
|
2016-11-21 14:14:02 +00:00
|
|
|
@@ -1285,6 +1285,12 @@ pkg_run_script(pkg_t *pkg, const char *s
|
2014-09-11 12:27:09 +00:00
|
|
|
setenv("PKG_ROOT",
|
|
|
|
pkg->dest ? pkg->dest->root_dir : conf->default_dest->root_dir, 1);
|
|
|
|
|
|
|
|
+ if (pkg->is_upgrade)
|
2014-12-02 15:21:50 +00:00
|
|
|
+ setenv("PKG_UPGRADE", "1", 1);
|
2014-09-11 12:27:09 +00:00
|
|
|
+ else
|
2014-12-02 15:21:50 +00:00
|
|
|
+ setenv("PKG_UPGRADE", "0", 1);
|
2014-09-11 12:27:09 +00:00
|
|
|
+
|
|
|
|
+
|
|
|
|
if (! file_exists(path)) {
|
|
|
|
free(path);
|
|
|
|
return 0;
|
2014-12-08 17:40:53 +00:00
|
|
|
--- a/libopkg/pkg.h
|
|
|
|
+++ b/libopkg/pkg.h
|
2016-11-21 14:14:02 +00:00
|
|
|
@@ -184,6 +184,7 @@ struct pkg
|
2014-09-11 12:27:09 +00:00
|
|
|
/* this flag specifies whether the package was installed to satisfy another
|
|
|
|
* package's dependancies */
|
|
|
|
int auto_installed;
|
|
|
|
+ int is_upgrade;
|
|
|
|
};
|
|
|
|
|
|
|
|
pkg_t *pkg_new(void);
|