diff options
author | Tim Yardley <lst@openwrt.org> | 2007-10-30 22:19:35 +0000 |
---|---|---|
committer | Tim Yardley <lst@openwrt.org> | 2007-10-30 22:19:35 +0000 |
commit | 0c5ccd2ace130f30c841cf9eaa436e286b2457cc (patch) | |
tree | 0feb492252c6c5e78ed9818a40ffd8998ada71e1 | |
parent | 7145d9015bffcbb3d205a243e36c57ee20eaf7bd (diff) | |
download | upstream-0c5ccd2ace130f30c841cf9eaa436e286b2457cc.tar.gz upstream-0c5ccd2ace130f30c841cf9eaa436e286b2457cc.tar.bz2 upstream-0c5ccd2ace130f30c841cf9eaa436e286b2457cc.zip |
expose an environment variable (IPKG_UPGRADE) to the scripts executed during a package upgrade so that they can intelligently determine what to do inside the ipk
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@9465 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | package/busybox/patches/521-ipkg_upgrade_env.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/package/busybox/patches/521-ipkg_upgrade_env.patch b/package/busybox/patches/521-ipkg_upgrade_env.patch new file mode 100644 index 0000000000..0063fa0798 --- /dev/null +++ b/package/busybox/patches/521-ipkg_upgrade_env.patch @@ -0,0 +1,41 @@ +Index: busybox-1.7.2/archival/libipkg/ipkg_install.c +=================================================================== +--- busybox-1.7.2.orig/archival/libipkg/ipkg_install.c 2007-10-30 17:15:31.000000000 -0500 ++++ busybox-1.7.2/archival/libipkg/ipkg_install.c 2007-10-30 17:15:33.000000000 -0500 +@@ -136,6 +136,7 @@ + ipkg_error_t ipkg_install_by_name(ipkg_conf_t *conf, const char *pkg_name) + { + int cmp; ++ int u = 0; + pkg_t *old, *new; + char *old_version, *new_version; + +@@ -201,6 +202,7 @@ + } else if (cmp < 0) { + new->dest = old->dest; + old->state_want = SW_DEINSTALL; /* Here probably the problem for bug 1277 */ ++ u = 1; + } + } + +@@ -211,7 +213,7 @@ + anyone ever wants to make a nice libipkg. */ + + ipkg_message(conf, IPKG_DEBUG2,"Function: %s calling ipkg_install_pkg \n",__FUNCTION__); +- return ipkg_install_pkg(conf, new,0); ++ return ipkg_install_pkg(conf, new,u); + } + + ipkg_error_t ipkg_install_multi_by_name(ipkg_conf_t *conf, const char *pkg_name) +@@ -750,8 +752,10 @@ + char* file_md5; + + +- if ( from_upgrade ) ++ if ( from_upgrade ) { + message = 1; /* Coming from an upgrade, and should change the output message */ ++ setenv("IPKG_UPGRADE", "yes", 1); ++ } + + if (!pkg) { + ipkg_message(conf, IPKG_ERROR, |