X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwgtpkg-installer.c;h=792e8c23fb8a8367f4118d3a30d5409e564e002c;hb=353f837dd260914d814748cc196d129234ba265f;hp=3d9c2379d566f32b11d937d50190d17365359c28;hpb=6c6177fcf8fdcc62c42a18407e95c7577897e10c;p=src%2Fapp-framework-main.git diff --git a/src/wgtpkg-installer.c b/src/wgtpkg-installer.c index 3d9c237..792e8c2 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,11 +25,15 @@ #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-installer"; static const char *root; @@ -60,9 +66,10 @@ static struct option options[] = { /* install the widgets of the list */ int main(int ac, char **av) { - int i; + int i, rc; + struct wgt_info *ifo; - openlog(appname, LOG_PERROR, LOG_AUTH); + LOGAUTH(appname); xmlsec_init(); @@ -86,7 +93,11 @@ int main(int ac, char **av) verbosity++; break; case 'p': - grant_permission_list(optarg); + rc = grant_permission_list(optarg); + if (rc < 0) { + ERROR("Can't set granted permission list"); + exit(1); + } break; case ':': ERROR("missing argument value"); @@ -106,8 +117,11 @@ int main(int ac, char **av) /* install widgets */ av += optind; root = *av++; - 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; }