Code Review
/
src
/
app-framework-main.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
wgtpkg-install: Force uninstall
[src/app-framework-main.git]
/
src
/
wgtpkg-install.c
diff --git
a/src/wgtpkg-install.c
b/src/wgtpkg-install.c
index
2b57a4e
..
896392a
100644
(file)
--- 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-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"
#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 (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;
if (move_widget_to(installdir, force))
goto error3;