From: Alejandro del Castillo Date: Mon, 27 Mar 2017 21:58:17 +0000 (-0500) Subject: pkg_run_script: use pkg->dest in half installed case X-Git-Url: http://git.openwrt.org/feed/routing.git;lede-17.01?a=commitdiff_plain;h=3f13edd42bd2411f1f0bdc40b0033b1a193ef037;p=project%2Fopkg-lede.git pkg_run_script: use pkg->dest in half installed case Fixes running scripts for packages in half-installed state which would otherwise fail with: * pkg_run_script: Internal error: ... has a NULL tmp_unpack_dir. * opkg_remove_pkg: not removing package "...", prerm script failed Upstream bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=11245 Signed-off-by: Alejandro del Castillo [Jo-Philipp Wich: rebased onto opkg-lede, updated commit message] Signed-off-by: Jo-Philipp Wich --- diff --git a/libopkg/pkg.c b/libopkg/pkg.c index c0de884..551c629 100644 --- a/libopkg/pkg.c +++ b/libopkg/pkg.c @@ -1335,7 +1335,8 @@ int pkg_run_script(pkg_t * pkg, const char *script, const char *args) /* Installed packages have scripts in pkg->dest->info_dir, uninstalled packages have scripts in tmp_unpack_dir. */ if (pkg->state_status == SS_INSTALLED - || pkg->state_status == SS_UNPACKED) { + || pkg->state_status == SS_UNPACKED + || pkg->state_status == SS_HALF_INSTALLED) { if (pkg->dest == NULL) { opkg_msg(ERROR, "Internal error: %s has a NULL dest.\n", pkg->name);