X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwgtpkg-installer.c;h=ea08fce416b9ef65d3d4b03762cde3a739d1967f;hb=26aaf29a3694750834b9eefb6b6e4553bc5ea83f;hp=62807aa984e468ef5918aef507db0449b45aaf34;hpb=e2de563d1ecb4585ce68521bd42f3ef45ac79f16;p=src%2Fapp-framework-main.git diff --git a/src/wgtpkg-installer.c b/src/wgtpkg-installer.c index 62807aa..ea08fce 100644 --- a/src/wgtpkg-installer.c +++ b/src/wgtpkg-installer.c @@ -1,6 +1,8 @@ /* Copyright 2015 IoT.bzh + author: José Bollo + Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -23,13 +25,17 @@ #include #include #include -#include #include +#include + #include "verbose.h" -#include "wgtpkg.h" +#include "wgtpkg-permissions.h" +#include "wgtpkg-xmlsec.h" +#include "wgt-info.h" +#include "wgtpkg-install.h" -static const char appname[] = "wgtpkg-install"; +static const char appname[] = "wgtpkg-installer"; static const char *root; static int force; @@ -61,9 +67,9 @@ static struct option options[] = { int main(int ac, char **av) { int i; - char *wpath; + struct wgt_info *ifo; - openlog(appname, LOG_PERROR, LOG_AUTH); + LOGAUTH(appname); xmlsec_init(); @@ -104,21 +110,14 @@ int main(int ac, char **av) return 1; } - /* canonic names for files */ + /* install widgets */ av += optind; - for (i = 0 ; av[i] != NULL ; i++) { - wpath = realpath(av[i], NULL); - if (wpath == NULL) { - ERROR("error while getting realpath of %dth widget: %s", i+1, av[i]); - return 1; - } - av[i] = wpath; - } root = *av++; - - /* install widgets */ - for ( ; *av ; av++) - install_widget(*av, root, force); + for ( ; *av ; av++) { + ifo = install_widget(*av, root, force); + if (ifo) + wgt_info_unref(ifo); + } return 0; }