2 Copyright 2015, 2016, 2017 IoT.bzh
4 author: José Bollo <jose.bollo@iot.bzh>
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
10 http://www.apache.org/licenses/LICENSE-2.0
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
30 #include <libxml/tree.h>
33 #include "wgtpkg-permissions.h"
34 #include "wgtpkg-xmlsec.h"
36 #include "wgtpkg-install.h"
38 static const char appname[] = "wgtpkg-installer";
39 static const char *root;
45 "usage: %s [-f] [-q] [-v] [-p list] rootdir wgtfile...\n"
47 " rootdir the root directory for installing\n"
48 " -p list a list of comma separated permissions to allow\n"
49 " -f force overwriting\n"
57 static struct option options[] = {
58 { "permissions", required_argument, NULL, 'p' },
59 { "force", no_argument, NULL, 'f' },
60 { "help", no_argument, NULL, 'h' },
61 { "quiet", no_argument, NULL, 'q' },
62 { "verbose", no_argument, NULL, 'v' },
66 /* install the widgets of the list */
67 int main(int ac, char **av)
78 i = getopt_long(ac, av, "hfqvp:", options, NULL);
96 rc = grant_permission_list(optarg);
98 ERROR("Can't set granted permission list");
103 ERROR("missing argument value");
106 ERROR("unrecognized option");
113 ERROR("arguments are missing");
117 /* install widgets */
120 for ( ; *av ; av++) {
121 ifo = install_widget(*av, root, force);