diff options
author | Jose Bollo <jose.bollo@iot.bzh> | 2018-09-17 11:06:33 +0200 |
---|---|---|
committer | Jose Bollo <jose.bollo@iot.bzh> | 2018-09-17 15:27:29 +0200 |
commit | 4c384402dc4ab629a1b006cb75db9df2aff71999 (patch) | |
tree | 090a33f347526bc880e599880403033b49954041 /src | |
parent | df39a85f21942ddd22c81042e62a289466c72232 (diff) |
wgtpkg-install: Force uninstallflounder_6.0.1flounder_6.0.0flounder/6.0.1flounder/6.0.06.0.16.0.0
This commit forces uninstall of the previous installed
version instead of reinstall to get around a bug in
cynara.
Bug-AGL: SPEC-1230
Change-Id: Id29fc59794aed7386e0a32df43f9fbacc25c0863
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src')
-rw-r--r-- | src/wgtpkg-install.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/wgtpkg-install.c b/src/wgtpkg-install.c index 27dcb87..5e8b0e9 100644 --- a/src/wgtpkg-install.c +++ b/src/wgtpkg-install.c @@ -40,6 +40,7 @@ #include "wgtpkg-permissions.h" #include "wgtpkg-digsig.h" #include "wgtpkg-install.h" +#include "wgtpkg-uninstall.h" #include "secmgr-wrap.h" #include "utils-dir.h" #include "wgtpkg-unit.h" @@ -532,6 +533,16 @@ struct wgt_info *install_widget(const char *wgtfile, const char *root, int force if (get_target_directory(installdir, root, desc)) goto error3; + if (access(installdir, F_OK) == 0) { + if (!force) { + ERROR("widget already installed"); + errno = EEXIST; + goto error3; + } + if (uninstall_widget(desc->idaver, root)) + goto error3; + } + if (move_widget_to(installdir, force)) goto error3; |