521-ipkg_upgrade_env.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. --- a/archival/libipkg/ipkg_install.c
  2. +++ b/archival/libipkg/ipkg_install.c
  3. @@ -136,6 +136,7 @@
  4. ipkg_error_t ipkg_install_by_name(ipkg_conf_t *conf, const char *pkg_name)
  5. {
  6. int cmp;
  7. + int u = 0;
  8. pkg_t *old, *new;
  9. char *old_version, *new_version;
  10. @@ -201,6 +202,7 @@
  11. } else if (cmp < 0) {
  12. new->dest = old->dest;
  13. old->state_want = SW_DEINSTALL; /* Here probably the problem for bug 1277 */
  14. + u = 1;
  15. }
  16. }
  17. @@ -211,7 +213,7 @@
  18. anyone ever wants to make a nice libipkg. */
  19. ipkg_message(conf, IPKG_DEBUG2,"Function: %s calling ipkg_install_pkg \n",__FUNCTION__);
  20. - return ipkg_install_pkg(conf, new,0);
  21. + return ipkg_install_pkg(conf, new,u);
  22. }
  23. ipkg_error_t ipkg_install_multi_by_name(ipkg_conf_t *conf, const char *pkg_name)
  24. @@ -750,8 +752,10 @@
  25. char* file_md5;
  26. - if ( from_upgrade )
  27. + if ( from_upgrade ) {
  28. message = 1; /* Coming from an upgrade, and should change the output message */
  29. + setenv("IPKG_UPGRADE", "yes", 1);
  30. + }
  31. if (!pkg) {
  32. ipkg_message(conf, IPKG_ERROR,