4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
17 #define _BSD_SOURCE /* see readdir */
32 static const char appname[] = "wgtpkg-info";
34 static void show(const char *wgtfile);
39 "usage: %s [-f] [-q] [-v] wgtfile...\n"
48 static struct option options[] = {
49 { "help", no_argument, NULL, 'h' },
50 { "quiet", no_argument, NULL, 'q' },
51 { "verbose", no_argument, NULL, 'v' },
55 /* info the widgets of the list */
56 int main(int ac, char **av)
66 i = getopt_long(ac, av, "hqv", options, NULL);
81 ERROR("missing argument value");
84 ERROR("unrecognized option");
89 /* canonic names for files */
91 for (i = 0 ; av[i] != NULL ; i++) {
92 wpath = realpath(av[i], NULL);
94 ERROR("error while getting realpath of %dth widget: %s", i+1, av[i]);
107 static int check_and_show()
109 struct wgt_info *ifo;
111 ifo = wgt_info_createat(workdirfd, NULL, 1, 1, 1);
114 wgt_info_dump(ifo, 1, "");
119 /* install the widget of the file */
120 static void show(const char *wgtfile)
122 NOTICE("-- INFO for widget %s --", wgtfile);
125 if (make_workdir_base("/tmp", "UNPACK", 0)) {
126 ERROR("failed to create a working directory");
130 if (zread(wgtfile, 0))
133 if (check_all_signatures())