X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwgtpkg-sign.c;h=76abce1e94f84013f6364c3a38e3bfa9fca0d446;hb=7553044c59814c33763bb4b1c34664dceed68735;hp=9df50ec7bf934ff51d290490919876821e801bbc;hpb=41e3ea4dbae634ca13941d134e990d953b741c4b;p=src%2Fapp-framework-main.git diff --git a/src/wgtpkg-sign.c b/src/wgtpkg-sign.c index 9df50ec..76abce1 100644 --- a/src/wgtpkg-sign.c +++ b/src/wgtpkg-sign.c @@ -1,5 +1,7 @@ /* - Copyright 2015 IoT.bzh + Copyright (C) 2015-2019 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. @@ -25,8 +27,13 @@ #include #include +#include + #include "verbose.h" -#include "wgtpkg.h" +#include "wgtpkg-files.h" +#include "wgtpkg-workdir.h" +#include "wgtpkg-digsig.h" +#include "wgtpkg-xmlsec.h" #if !defined(MAXCERT) #define MAXCERT 20 @@ -53,10 +60,24 @@ static unsigned int get_number(const char *value) return (unsigned int)val; } +static void version() +{ + printf( + "\n" + " %s version="AFM_VERSION"\n" + "\n" + " Copyright (C) 2015-2019 \"IoT.bzh\"\n" + " AFB comes with ABSOLUTELY NO WARRANTY.\n" + " Licence Apache 2\n" + "\n", + appname + ); +} + static void usage() { printf( - "usage: %s [-f] [-k keyfile] [-c certfile]... [-o wgtfile] [-d number | -a] directory\n" + "usage: %s [-f] [-k keyfile] [-c certfile]... [-d number | -a] directory\n" "\n" " -k keyfile the private key to use for author signing\n" " -c certfile the certificate(s) to use for author signing\n" @@ -65,6 +86,7 @@ static void usage() " -f force overwriting\n" " -q quiet\n" " -v verbose\n" + " -V version\n" "\n", appname ); @@ -79,6 +101,7 @@ static struct option options[] = { { "help", no_argument, NULL, 'h' }, { "quiet", no_argument, NULL, 'q' }, { "verbose", no_argument, NULL, 'v' }, + { "version", no_argument, NULL, 'V' }, { NULL, 0, NULL, 0 } }; @@ -96,7 +119,7 @@ int main(int ac, char **av) number = UINT_MAX; keyfile = directory = NULL; for (;;) { - i = getopt_long(ac, av, "hfqvak:c:d:", options, NULL); + i = getopt_long(ac, av, "hfqvVak:c:d:", options, NULL); if (i < 0) break; switch (i) { @@ -112,6 +135,7 @@ int main(int ac, char **av) case 'f': force = 1; continue; case 'a': author = 1; continue; case 'h': usage(); return 0; + case 'V': version(); return 0; case 'q': if (verbosity) verbosity--;