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;
46 " %s version="AFM_VERSION"\n"
48 " Copyright (C) 2015, 2016, 2017 \"IoT.bzh\"\n"
49 " AFB comes with ABSOLUTELY NO WARRANTY.\n"
59 "usage: %s [-f] [-q] [-v] [-p list] rootdir wgtfile...\n"
61 " rootdir the root directory for installing\n"
62 " -p list a list of comma separated permissions to allow\n"
63 " -f force overwriting\n"
72 static struct option options[] = {
73 { "permissions", required_argument, NULL, 'p' },
74 { "force", no_argument, NULL, 'f' },
75 { "help", no_argument, NULL, 'h' },
76 { "quiet", no_argument, NULL, 'q' },
77 { "verbose", no_argument, NULL, 'v' },
78 { "version", no_argument, NULL, 'V' },
82 /* install the widgets of the list */
83 int main(int ac, char **av)
94 i = getopt_long(ac, av, "hfqvVp:", options, NULL);
115 rc = grant_permission_list(optarg);
117 ERROR("Can't set granted permission list");
122 ERROR("missing argument value");
125 ERROR("unrecognized option");
132 ERROR("arguments are missing");
136 /* install widgets */
139 for ( ; *av ; av++) {
140 ifo = install_widget(*av, root, force);