xbps-rindex(8): added -v --verbose option (mainly for -r mode).
This commit is contained in:
parent
a5ecaa493f
commit
c91050fc35
4
NEWS
4
NEWS
@ -1,5 +1,7 @@
|
|||||||
xbps-0.27 (???):
|
xbps-0.27 (???):
|
||||||
|
|
||||||
|
* xbps-rindex(8): added -v --verbose option.
|
||||||
|
|
||||||
* xbps-rindex(8): -c --clean mode has been removed. Generating a local repository
|
* xbps-rindex(8): -c --clean mode has been removed. Generating a local repository
|
||||||
is almost as fast as cleaning up the repository data.
|
is almost as fast as cleaning up the repository data.
|
||||||
|
|
||||||
@ -8,7 +10,7 @@ xbps-0.27 (???):
|
|||||||
* Support for RSA signed repositories. A repository can be signed with your
|
* Support for RSA signed repositories. A repository can be signed with your
|
||||||
preferred RSA key (any ssh key works) as follows:
|
preferred RSA key (any ssh key works) as follows:
|
||||||
|
|
||||||
$ xbps-rindex -s --signedby "foobar <foo@bar>" --privkey /priv/key /path/to/repo
|
$ xbps-rindex --sign --signedby "foobar <foo@bar>" --privkey /priv/key /path/to/repo
|
||||||
|
|
||||||
Public keys must be imported before using a remote signed repository thru
|
Public keys must be imported before using a remote signed repository thru
|
||||||
the xbps-rkeys(8) utility:
|
the xbps-rkeys(8) utility:
|
||||||
|
@ -39,6 +39,7 @@ usage(bool fail)
|
|||||||
"OPTIONS\n"
|
"OPTIONS\n"
|
||||||
" -f --force Force mode to overwrite entry in add mode\n"
|
" -f --force Force mode to overwrite entry in add mode\n"
|
||||||
" -h --help Show help usage\n"
|
" -h --help Show help usage\n"
|
||||||
|
" -v --verbose Verbose messages\n"
|
||||||
" -V --version Show XBPS version\n"
|
" -V --version Show XBPS version\n"
|
||||||
" --privkey <key> Path to the private key for signing\n"
|
" --privkey <key> Path to the private key for signing\n"
|
||||||
" --signedby <string> Signature details, i.e \"name <email>\"\n\n"
|
" --signedby <string> Signature details, i.e \"name <email>\"\n\n"
|
||||||
@ -52,13 +53,14 @@ usage(bool fail)
|
|||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
const char *shortopts = "afhrV";
|
const char *shortopts = "afhrVv";
|
||||||
struct option longopts[] = {
|
struct option longopts[] = {
|
||||||
{ "add", no_argument, NULL, 'a' },
|
{ "add", no_argument, NULL, 'a' },
|
||||||
{ "force", no_argument, NULL, 'f' },
|
{ "force", no_argument, NULL, 'f' },
|
||||||
{ "help", no_argument, NULL, 'h' },
|
{ "help", no_argument, NULL, 'h' },
|
||||||
{ "remove-obsoletes", no_argument, NULL, 'r' },
|
{ "remove-obsoletes", no_argument, NULL, 'r' },
|
||||||
{ "version", no_argument, NULL, 'V' },
|
{ "version", no_argument, NULL, 'V' },
|
||||||
|
{ "verbose", no_argument, NULL, 'v' },
|
||||||
{ "privkey", required_argument, NULL, 0},
|
{ "privkey", required_argument, NULL, 0},
|
||||||
{ "signedby", required_argument, NULL, 1},
|
{ "signedby", required_argument, NULL, 1},
|
||||||
{ "sign", no_argument, NULL, 's'},
|
{ "sign", no_argument, NULL, 's'},
|
||||||
@ -66,7 +68,7 @@ main(int argc, char **argv)
|
|||||||
};
|
};
|
||||||
struct xbps_handle xh;
|
struct xbps_handle xh;
|
||||||
const char *privkey = NULL, *signedby = NULL;
|
const char *privkey = NULL, *signedby = NULL;
|
||||||
int rv, c;
|
int rv, c, flags = 0;
|
||||||
bool add_mode, rm_mode, sign_mode, force;
|
bool add_mode, rm_mode, sign_mode, force;
|
||||||
|
|
||||||
add_mode = rm_mode = sign_mode = force = false;
|
add_mode = rm_mode = sign_mode = force = false;
|
||||||
@ -94,6 +96,9 @@ main(int argc, char **argv)
|
|||||||
case 's':
|
case 's':
|
||||||
sign_mode = true;
|
sign_mode = true;
|
||||||
break;
|
break;
|
||||||
|
case 'v':
|
||||||
|
flags |= XBPS_FLAG_VERBOSE;
|
||||||
|
break;
|
||||||
case 'V':
|
case 'V':
|
||||||
printf("%s\n", XBPS_RELVER);
|
printf("%s\n", XBPS_RELVER);
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
@ -111,6 +116,7 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
/* initialize libxbps */
|
/* initialize libxbps */
|
||||||
memset(&xh, 0, sizeof(xh));
|
memset(&xh, 0, sizeof(xh));
|
||||||
|
xh.flags = flags;
|
||||||
if ((rv = xbps_init(&xh)) != 0) {
|
if ((rv = xbps_init(&xh)) != 0) {
|
||||||
fprintf(stderr, "failed to initialize libxbps: %s\n",
|
fprintf(stderr, "failed to initialize libxbps: %s\n",
|
||||||
strerror(rv));
|
strerror(rv));
|
||||||
|
@ -83,7 +83,8 @@ cleaner_cb(struct xbps_handle *xhp, xbps_object_t obj, const char *key _unused,
|
|||||||
xbps_object_release(pkgd);
|
xbps_object_release(pkgd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
printf("checking %s (%s)\n", pkgver, binpkg);
|
if (xhp->flags & XBPS_FLAG_VERBOSE)
|
||||||
|
printf("checking %s (%s)\n", pkgver, binpkg);
|
||||||
/*
|
/*
|
||||||
* If binpkg is not registered in index, remove binpkg.
|
* If binpkg is not registered in index, remove binpkg.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user