diff --git a/bin/xbps-uhelper/main.c b/bin/xbps-uhelper/main.c index 3f0a1aa9..874b60d6 100644 --- a/bin/xbps-uhelper/main.c +++ b/bin/xbps-uhelper/main.c @@ -49,7 +49,7 @@ usage(void) " Action arguments:\n" " cmpver\t\t \n" " digest\t\t \n" - " fetch\t\t \n" + " fetch\t\t \n" " getpkgdepname\t\n" " getpkgdepversion\t\n" " getpkgname\t\t\n" @@ -87,7 +87,7 @@ main(int argc, char **argv) struct xbps_handle xh; struct xferstat xfer; const char *version, *rootdir = NULL, *confdir = NULL; - char *pkgname, *hash; + char *pkgname, *hash, *sep; int flags = 0, c, rv = 0; while ((c = getopt(argc, argv, "C:dr:V")) != -1) { @@ -248,13 +248,19 @@ main(int argc, char **argv) usage(); for (int i = 1; i < argc; i++) { - rv = xbps_fetch_file(&xh, argv[i], "v"); + if( (sep = strrchr(argv[i], '>')) ) { + *sep = '\0'; + rv = xbps_fetch_file_dest(&xh, argv[i], sep+1, "v"); + } else { + rv = xbps_fetch_file(&xh, argv[i], "v"); + } + if (rv == -1) { - printf("%s: %s\n", argv[1], + printf("%s: %s\n", argv[i], xbps_fetch_error_string()); } else if (rv == 0) { printf("%s: file is identical than remote.\n", - argv[1]); + argv[i]); } else rv = 0; }