From 8cea3e351bab51dd64d8d9dc830a87d2c17f8601 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 12 Jun 2019 17:57:03 +0200 Subject: [PATCH] xbps-fetch(1): new utility that replaces 'xbps-uhelper fetch'. xbps-install(1): document all libfetch env vars. Signed-off-by: Juan RP --- bin/Makefile | 1 + bin/xbps-alternatives/xbps-alternatives.1 | 1 + bin/xbps-checkvers/xbps-checkvers.1 | 1 + bin/xbps-create/xbps-create.1 | 1 + bin/xbps-dgraph/xbps-dgraph.1 | 5 +- bin/xbps-digest/xbps-digest.1 | 5 +- bin/xbps-fbulk/xbps-fbulk.1 | 1 + bin/xbps-fetch/Makefile | 7 ++ bin/xbps-fetch/main.c | 134 ++++++++++++++++++++++ bin/xbps-fetch/xbps-fetch.1 | 101 ++++++++++++++++ bin/xbps-install/xbps-install.1 | 50 +++++++- bin/xbps-pkgdb/xbps-pkgdb.1 | 1 + bin/xbps-query/xbps-query.1 | 2 + bin/xbps-reconfigure/xbps-reconfigure.1 | 1 + bin/xbps-remove/xbps-remove.1 | 1 + bin/xbps-rindex/xbps-rindex.1 | 1 + bin/xbps-uchroot/xbps-uchroot.1 | 1 + bin/xbps-uhelper/Makefile | 2 +- bin/xbps-uhelper/main.c | 43 +------ bin/xbps-uunshare/xbps-uunshare.1 | 1 + data/xbps.d.5 | 2 + 21 files changed, 314 insertions(+), 48 deletions(-) create mode 100644 bin/xbps-fetch/Makefile create mode 100644 bin/xbps-fetch/main.c create mode 100644 bin/xbps-fetch/xbps-fetch.1 diff --git a/bin/Makefile b/bin/Makefile index 7328195a..c0586aab 100644 --- a/bin/Makefile +++ b/bin/Makefile @@ -13,6 +13,7 @@ SUBDIRS += xbps-uhelper SUBDIRS += xbps-checkvers SUBDIRS += xbps-fbulk SUBDIRS += xbps-digest +SUBDIRS += xbps-fetch ifeq (${XBPS_OS},linux) SUBDIRS += xbps-uchroot diff --git a/bin/xbps-alternatives/xbps-alternatives.1 b/bin/xbps-alternatives/xbps-alternatives.1 index 5d3c31eb..6837aac2 100644 --- a/bin/xbps-alternatives/xbps-alternatives.1 +++ b/bin/xbps-alternatives/xbps-alternatives.1 @@ -75,6 +75,7 @@ Default cache directory to store downloaded binary packages. .Xr xbps-dgraph 1 , .Xr xbps-digest 1 , .Xr xbps-fbulk 1 , +.Xr xbps-fetch 1 , .Xr xbps-install 1 , .Xr xbps-pkgdb 1 , .Xr xbps-query 1 , diff --git a/bin/xbps-checkvers/xbps-checkvers.1 b/bin/xbps-checkvers/xbps-checkvers.1 index dde1723b..42863535 100644 --- a/bin/xbps-checkvers/xbps-checkvers.1 +++ b/bin/xbps-checkvers/xbps-checkvers.1 @@ -53,6 +53,7 @@ Show the version information. .Xr xbps-dgraph 1 , .Xr xbps-digest 1 , .Xr xbps-fbulk 1 , +.Xr xbps-fetch 1 , .Xr xbps-install 1 , .Xr xbps-pkgdb 1 , .Xr xbps-query 1 , diff --git a/bin/xbps-create/xbps-create.1 b/bin/xbps-create/xbps-create.1 index 958ba612..e4bfdea9 100644 --- a/bin/xbps-create/xbps-create.1 +++ b/bin/xbps-create/xbps-create.1 @@ -95,6 +95,7 @@ The package changelog string. .Xr xbps-dgraph 1 , .Xr xbps-digest 1 , .Xr xbps-fbulk 1 , +.Xr xbps-fetch 1 , .Xr xbps-install 1 , .Xr xbps-pkgdb 1 , .Xr xbps-query 1 , diff --git a/bin/xbps-dgraph/xbps-dgraph.1 b/bin/xbps-dgraph/xbps-dgraph.1 index d0eb7b60..92edc14f 100644 --- a/bin/xbps-dgraph/xbps-dgraph.1 +++ b/bin/xbps-dgraph/xbps-dgraph.1 @@ -122,11 +122,11 @@ Default package database (0.38 format). Keeps track of installed packages and pr Default cache directory to store downloaded binary packages. .El .Sh SEE ALSO -.Xr xbps.d 5 , .Xr xbps-checkvers 1 , .Xr xbps-create 1 , .Xr xbps-digest 1 , .Xr xbps-fbulk 1 , +.Xr xbps-fetch 1 , .Xr xbps-install 1 , .Xr xbps-pkgdb 1 , .Xr xbps-query 1 , @@ -134,7 +134,8 @@ Default cache directory to store downloaded binary packages. .Xr xbps-remove 1 , .Xr xbps-rindex 1 , .Xr xbps-uchroot 1 , -.Xr xbps-uunshare 1 +.Xr xbps-uunshare 1 , +.Xr xbps.d 5 .Sh AUTHORS .An Juan Romero Pardines .Sh BUGS diff --git a/bin/xbps-digest/xbps-digest.1 b/bin/xbps-digest/xbps-digest.1 index 559c1da3..93fc28e4 100644 --- a/bin/xbps-digest/xbps-digest.1 +++ b/bin/xbps-digest/xbps-digest.1 @@ -29,11 +29,11 @@ Show the help message. Show the version information. .El .Sh SEE ALSO -.Xr xbps.d 5 , .Xr xbps-checkvers 1 , .Xr xbps-create 1 , .Xr xbps-dgraph 1 , .Xr xbps-fbulk 1 , +.Xr xbps-fetch 1 , .Xr xbps-install 1 , .Xr xbps-pkgdb 1 , .Xr xbps-query 1 , @@ -41,7 +41,8 @@ Show the version information. .Xr xbps-remove 1 , .Xr xbps-rindex 1 , .Xr xbps-uchroot 1 , -.Xr xbps-uunshare 1 +.Xr xbps-uunshare 1 , +.Xr xbps.d 5 .Sh AUTHORS .An Juan Romero Pardines .Sh BUGS diff --git a/bin/xbps-fbulk/xbps-fbulk.1 b/bin/xbps-fbulk/xbps-fbulk.1 index ae3134bc..94ed5091 100644 --- a/bin/xbps-fbulk/xbps-fbulk.1 +++ b/bin/xbps-fbulk/xbps-fbulk.1 @@ -89,6 +89,7 @@ and the kernel supports the overlay filesystem, introduced in 4.0. .Xr xbps-create 1 , .Xr xbps-dgraph 1 , .Xr xbps-digest 1 , +.Xr xbps-fetch 1 , .Xr xbps-install 1 , .Xr xbps-pkgdb 1 , .Xr xbps-query 1 , diff --git a/bin/xbps-fetch/Makefile b/bin/xbps-fetch/Makefile new file mode 100644 index 00000000..f3dd684f --- /dev/null +++ b/bin/xbps-fetch/Makefile @@ -0,0 +1,7 @@ +TOPDIR = ../.. +-include $(TOPDIR)/config.mk + +BIN = xbps-fetch +OBJS = main.o ../xbps-install/fetch_cb.o + +include $(TOPDIR)/mk/prog.mk diff --git a/bin/xbps-fetch/main.c b/bin/xbps-fetch/main.c new file mode 100644 index 00000000..3cf629cb --- /dev/null +++ b/bin/xbps-fetch/main.c @@ -0,0 +1,134 @@ +/*- + * Copyright (c) 2019 Juan Romero Pardines. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include "../xbps-install/defs.h" + +static void __attribute__((noreturn)) +usage(void) +{ + fprintf(stdout, + "Usage: xbps-fetch [options] \n\n" + "OPTIONS:\n" + " -d\t\tEnable debug messages to stderr\n" + " -h\t\tShow usage()\n" + " -o \tRename downloaded file to \n" + " -v\t\tEnable verbose output\n" + " -V\t\tPrints the xbps release version\n"); + exit(EXIT_FAILURE); +} + +static char * +fname(char *url) +{ + char *filename; + + if ((filename = strrchr(url, '>'))) { + *filename = '\0'; + } else { + filename = strrchr(url, '/'); + } + if (filename == NULL) + return NULL; + return filename + 1; +} + +int +main(int argc, char **argv) +{ + int flags = 0, c = 0, rv = 0; + bool verbose = false; + struct xbps_handle xh = {}; + struct xferstat xfer = {}; + const char *filename = NULL, *progname = argv[0]; + const struct option longopts[] = { + { NULL, 0, NULL, 0 } + }; + + while ((c = getopt_long(argc, argv, "o:dhVv", longopts, NULL)) != -1) { + switch (c) { + case 'o': + filename = optarg; + break; + case 'd': + flags |= XBPS_FLAG_DEBUG; + break; + case 'v': + verbose = true; + break; + case 'V': + printf("%s\n", XBPS_RELVER); + exit(EXIT_SUCCESS); + case '?': + case 'h': + default: + usage(); + } + } + + argc -= optind; + argv += optind; + + if (!argc) + usage(); + + /* + * Initialize libxbps. + */ + xh.flags = flags; + xh.fetch_cb = fetch_file_progress_cb; + xh.fetch_cb_data = &xfer; + if ((rv = xbps_init(&xh)) != 0) { + xbps_error_printf("%s: failed to initialize libxbps: %s\n", + progname, strerror(rv)); + exit(EXIT_FAILURE); + } + + for (int i = 0; i < argc; i++) { + if ((argc == 1) && !filename) + filename = fname(argv[i]); + + rv = xbps_fetch_file_dest(&xh, argv[i], filename, verbose ? "v" : ""); + + if (rv == -1) { + fprintf(stderr, "%s: %s\n", argv[i], xbps_fetch_error_string()); + } else if (rv == 0) { + printf("%s: file is identical with remote.\n", argv[i]); + } else { + rv = 0; + } + } + + xbps_end(&xh); + exit(rv ? EXIT_FAILURE : EXIT_SUCCESS); +} diff --git a/bin/xbps-fetch/xbps-fetch.1 b/bin/xbps-fetch/xbps-fetch.1 new file mode 100644 index 00000000..03cd6122 --- /dev/null +++ b/bin/xbps-fetch/xbps-fetch.1 @@ -0,0 +1,101 @@ +.Dd June 12, 2019 +.Dt XBPS-FETCH 1 +.Sh NAME +.Nm xbps-fetch +.Nd XBPS utility to fetch files from URLs +.Sh SYNOPSIS +.Nm xbps-fetch +.Op OPTIONS +.Ar +.Ar +.Sh DESCRIPTION +The +.Nm +utility downloads files from specified URLs. +Multiple protocols are supported: +.Ar ftp , +.Ar http , +.Ar https , +.Ar socks5 . +.Sh OPTIONS +.Bl -tag -width -x +.It Fl d +Enables debug messages on stderr. +.It Fl h +Show the help message. +.It Fl o Ar output +Rename file from specified URL to +.Ar output . +.It Fl v +Enables verbose messages. +.It Fl V +Show the version information. +.El +.Sh ENVIRONMENT +.Bl -tag -width -x +.It Sy FTP_PASSIVE_MODE +If set to anything else than +.Ar "no" +passive mode will be set for the ftp connection. +.It Sy FTP_LOGIN +User name to be set for ftp authentication. +.It Sy FTP_PASSWORD +Password to be set for ftp authentication. +.It Sy FTP_PROXY +Proxy URL that will be used to establish a ftp connection. +.It Sy HTTP_PROXY +Proxy URL that will be used to establish a http connection. +.It Sy HTTP_PROXY_AUTH +Sets the credentials to authenticate a user agent to a proxy server, in the form +.Ar user:pass . +.It Sy HTTP_AUTH +Sets the credentials to authenticate to a http server, in the form +.Ar user:pass . +.It Sy HTTP_REFERER +Overrides the default Referer http header. +.It Sy HTTP_USER_AGENT +Override the default User-Agent http header. +.It Sy NO_PROXY +Specifies a set of domains for which the proxy should not be consulted. +The contents is a comma-, or space-separated list of domain names. +A single asterisk will override all proxy variables and no transactions +will be proxied. +.It Sy SOCKS_PROXY +Proxy URL that will be used to establish a socks connection. +.It Sy SSL_NO_VERIFY_HOSTNAME +Disables SSL/TLS hostname verification. +.It Sy SSL_NO_VERIFY_PEER +Disables SSL/TLS peer verification. +.It Sy SSL_CA_CERT_FILE +Overrides the default CA certificates file, by default set to +.Ar /etc/ssl/certs/ca-certificates.crt . +.It Sy SSL_CA_CERT_PATH +Overrides the default CA certificates path, by default set to +.Ar /etc/ssl/certs . +.It Sy SSL_CLIENT_CERT_FILE +Sets the SSL/TLS client verification certificate file. +.It Sy SSL_CLIENT_KEY_FILE +Sets the SSL/TLS client verification key file. +.El +.Sh SEE ALSO +.Xr xbps-checkvers 1 , +.Xr xbps-create 1 , +.Xr xbps-dgraph 1 , +.Xr xbps-digest 1 , +.Xr xbps-fbulk 1 , +.Xr xbps-install 1 , +.Xr xbps-pkgdb 1 , +.Xr xbps-query 1 , +.Xr xbps-reconfigure 1 , +.Xr xbps-remove 1 , +.Xr xbps-rindex 1 , +.Xr xbps-uchroot 1 , +.Xr xbps-uunshare 1 , +.Xr xbps.d 5 +.Sh AUTHORS +.An Juan Romero Pardines +.Sh BUGS +Probably, but I try to make this not happen. +Use it under your own responsibility and enjoy your life. +.Pp +Report bugs at https://github.com/void-linux/xbps/issues diff --git a/bin/xbps-install/xbps-install.1 b/bin/xbps-install/xbps-install.1 index 986a0c33..5b446cde 100644 --- a/bin/xbps-install/xbps-install.1 +++ b/bin/xbps-install/xbps-install.1 @@ -15,7 +15,9 @@ The argument .Ar PKG is a package expression, which is explained in the .Em PACKAGE EXPRESSION -section. If package is installed, it will be updated to the version available in repositories +section. +.Pp +If package is installed, it will be updated to the version available in repositories matching the .Em PACKAGE EXPRESSION . Otherwise it will be installed, or reinstalled/downgraded if @@ -125,7 +127,50 @@ Assume yes to all questions and avoid interactive questions. Show the version information. .El .Sh ENVIRONMENT -.Bl -tag -width XBPS_TARGET_ARCH +.Bl -tag -width SSL_NO_VERIFY_HOSTNAME +.It Sy FTP_PASSIVE_MODE +If set to anything else than +.Ar "no" +passive mode will be set for the ftp connection. +.It Sy FTP_LOGIN +User name to be set for ftp authentication. +.It Sy FTP_PASSWORD +Password to be set for ftp authentication. +.It Sy FTP_PROXY +Proxy URL that will be used to establish a ftp connection. +.It Sy HTTP_PROXY +Proxy URL that will be used to establish a http connection. +.It Sy HTTP_PROXY_AUTH +Sets the credentials to authenticate a user agent to a proxy server, in the form +.Ar user:pass . +.It Sy HTTP_AUTH +Sets the credentials to authenticate to a http server, in the form +.Ar user:pass . +.It Sy HTTP_REFERER +Overrides the default Referer http header. +.It Sy HTTP_USER_AGENT +Override the default User-Agent http header. +.It Sy NO_PROXY +Specifies a set of domains for which the proxy should not be consulted. +The contents is a comma-, or space-separated list of domain names. +A single asterisk will override all proxy variables and no transactions +will be proxied. +.It Sy SOCKS_PROXY +Proxy URL that will be used to establish a socks connection. +.It Sy SSL_NO_VERIFY_HOSTNAME +Disables SSL/TLS hostname verification. +.It Sy SSL_NO_VERIFY_PEER +Disables SSL/TLS peer verification. +.It Sy SSL_CA_CERT_FILE +Overrides the default CA certificates file, by default set to +.Ar /etc/ssl/certs/ca-certificates.crt . +.It Sy SSL_CA_CERT_PATH +Overrides the default CA certificates path, by default set to +.Ar /etc/ssl/certs . +.It Sy SSL_CLIENT_CERT_FILE +Sets the SSL/TLS client verification certificate file. +.It Sy SSL_CLIENT_KEY_FILE +Sets the SSL/TLS client verification key file. .It Sy XBPS_ARCH Overrides .Xr uname 2 @@ -157,6 +202,7 @@ Default cache directory to store downloaded binary packages. .Xr xbps-dgraph 1 , .Xr xbps-digest 1 , .Xr xbps-fbulk 1 , +.Xr xbps-fetch 1 , .Xr xbps-pkgdb 1 , .Xr xbps-query 1 , .Xr xbps-reconfigure 1 , diff --git a/bin/xbps-pkgdb/xbps-pkgdb.1 b/bin/xbps-pkgdb/xbps-pkgdb.1 index 7fb5b134..fdbf01f4 100644 --- a/bin/xbps-pkgdb/xbps-pkgdb.1 +++ b/bin/xbps-pkgdb/xbps-pkgdb.1 @@ -127,6 +127,7 @@ Default cache directory to store downloaded binary packages. .Xr xbps-dgraph 1 , .Xr xbps-digest 1 , .Xr xbps-fbulk 1 , +.Xr xbps-fetch 1 , .Xr xbps-install 1 , .Xr xbps-query 1 , .Xr xbps-reconfigure 1 , diff --git a/bin/xbps-query/xbps-query.1 b/bin/xbps-query/xbps-query.1 index 7718b302..54c3eae4 100644 --- a/bin/xbps-query/xbps-query.1 +++ b/bin/xbps-query/xbps-query.1 @@ -270,6 +270,8 @@ Default cache directory to store downloaded binary packages. .Xr xbps-create 1 , .Xr xbps-dgraph 1 , .Xr xbps-digest 1 , +.Xr xbps-fbulk 1 , +.Xr xbps-fetch 1 , .Xr xbps-install 1 , .Xr xbps-pkgdb 1 , .Xr xbps-reconfigure 1 , diff --git a/bin/xbps-reconfigure/xbps-reconfigure.1 b/bin/xbps-reconfigure/xbps-reconfigure.1 index 70e89cab..65fcb9ae 100644 --- a/bin/xbps-reconfigure/xbps-reconfigure.1 +++ b/bin/xbps-reconfigure/xbps-reconfigure.1 @@ -80,6 +80,7 @@ Default cache directory to store downloaded binary packages. .Xr xbps-dgraph 1 , .Xr xbps-digest 1 , .Xr xbps-fbulk 1 , +.Xr xbps-fetch 1 , .Xr xbps-install 1 , .Xr xbps-pkgdb 1 , .Xr xbps-query 1 , diff --git a/bin/xbps-remove/xbps-remove.1 b/bin/xbps-remove/xbps-remove.1 index 26e42d7b..b9b778e9 100644 --- a/bin/xbps-remove/xbps-remove.1 +++ b/bin/xbps-remove/xbps-remove.1 @@ -116,6 +116,7 @@ Default cache directory to store downloaded binary packages. .Xr xbps-dgraph 1 , .Xr xbps-digest 1 , .Xr xbps-fbulk 1 , +.Xr xbps-fetch 1 , .Xr xbps-install 1 , .Xr xbps-pkgdb 1 , .Xr xbps-query 1 , diff --git a/bin/xbps-rindex/xbps-rindex.1 b/bin/xbps-rindex/xbps-rindex.1 index 6170a362..25ab6fde 100644 --- a/bin/xbps-rindex/xbps-rindex.1 +++ b/bin/xbps-rindex/xbps-rindex.1 @@ -98,6 +98,7 @@ a repository. Otherwise it will ask you to enter the passphrase on the terminal. .Xr xbps-dgraph 1 , .Xr xbps-digest 1 , .Xr xbps-fbulk 1 , +.Xr xbps-fetch 1 , .Xr xbps-install 1 , .Xr xbps-pkgdb 1 , .Xr xbps-query 1 , diff --git a/bin/xbps-uchroot/xbps-uchroot.1 b/bin/xbps-uchroot/xbps-uchroot.1 index 3c60b235..b3df5322 100644 --- a/bin/xbps-uchroot/xbps-uchroot.1 +++ b/bin/xbps-uchroot/xbps-uchroot.1 @@ -77,6 +77,7 @@ other Operating Systems. The following kernel options must be enabled: .Xr xbps-dgraph 1 , .Xr xbps-digest 1 , .Xr xbps-fbulk 1 , +.Xr xbps-fetch 1 , .Xr xbps-install 1 , .Xr xbps-pkgdb 1 , .Xr xbps-query 1 , diff --git a/bin/xbps-uhelper/Makefile b/bin/xbps-uhelper/Makefile index a3952701..308e2ab0 100644 --- a/bin/xbps-uhelper/Makefile +++ b/bin/xbps-uhelper/Makefile @@ -2,7 +2,7 @@ TOPDIR = ../.. -include $(TOPDIR)/config.mk BIN = xbps-uhelper -OBJS = main.o ../xbps-install/fetch_cb.o +OBJS = main.o MAN = include $(TOPDIR)/mk/prog.mk diff --git a/bin/xbps-uhelper/main.c b/bin/xbps-uhelper/main.c index 0d369cbe..2f65861f 100644 --- a/bin/xbps-uhelper/main.c +++ b/bin/xbps-uhelper/main.c @@ -35,7 +35,6 @@ #include #include -#include "../xbps-install/defs.h" static void __attribute__((noreturn)) usage(void) @@ -52,7 +51,6 @@ usage(void) " binpkgarch\t\n" " binpkgver\t\n" " cmpver\t\t \n" - " fetch\t\tfilename]> filename]>\n" " getpkgdepname\t\n" " getpkgdepversion\t\n" " getpkgname\t\t\n" @@ -70,7 +68,6 @@ usage(void) "\n" " Examples:\n" " $ xbps-uhelper cmpver 'foo-1.0_1' 'foo-2.1_1'\n" - " $ xbps-uhelper fetch http://www.foo.org/file.blob ...\n" " $ xbps-uhelper getpkgdepname 'foo>=0'\n" " $ xbps-uhelper getpkgdepversion 'foo>=0'\n" " $ xbps-uhelper getpkgname foo-2.0_1\n" @@ -82,28 +79,13 @@ usage(void) exit(EXIT_FAILURE); } -static char* -fname(char *url) { - char *filename; - - if( (filename = strrchr(url, '>')) ) { - *filename = '\0'; - } else { - filename = strrchr(url, '/'); - } - if(filename == NULL) - return NULL; - return filename + 1; -} - int main(int argc, char **argv) { xbps_dictionary_t dict; struct xbps_handle xh; - struct xferstat xfer; const char *version, *rootdir = NULL, *confdir = NULL; - char *pkgname, *filename; + char *pkgname; int flags = 0, c, rv = 0; const struct option longopts[] = { { NULL, 0, NULL, 0 } @@ -141,14 +123,11 @@ main(int argc, char **argv) if ((strcmp(argv[0], "version") == 0) || (strcmp(argv[0], "real-version") == 0) || (strcmp(argv[0], "arch") == 0) || - (strcmp(argv[0], "getsystemdir") == 0) || - (strcmp(argv[0], "fetch") == 0)) { + (strcmp(argv[0], "getsystemdir") == 0)) { /* * Initialize libxbps. */ xh.flags = flags; - xh.fetch_cb = fetch_file_progress_cb; - xh.fetch_cb_data = &xfer; if (rootdir) xbps_strlcpy(xh.rootdir, rootdir, sizeof(xh.rootdir)); if (confdir) @@ -289,24 +268,6 @@ main(int argc, char **argv) usage(); printf("%s\n", XBPS_SYSDEFCONF_PATH); - } else if (strcmp(argv[0], "fetch") == 0) { - /* Fetch a file from specified URL */ - if (argc < 2) - usage(); - - for (int i = 1; i < argc; i++) { - filename = fname(argv[i]); - rv = xbps_fetch_file_dest(&xh, argv[i], filename, "v"); - - if (rv == -1) { - fprintf(stderr, "%s: %s\n", argv[i], - xbps_fetch_error_string()); - } else if (rv == 0) { - printf("%s: file is identical with remote.\n", - argv[i]); - } else - rv = 0; - } } else { usage(); } diff --git a/bin/xbps-uunshare/xbps-uunshare.1 b/bin/xbps-uunshare/xbps-uunshare.1 index 23d32f78..b80fc01c 100644 --- a/bin/xbps-uunshare/xbps-uunshare.1 +++ b/bin/xbps-uunshare/xbps-uunshare.1 @@ -56,6 +56,7 @@ other Operating Systems. The following kernel options must be enabled: .Xr xbps-dgraph 1 , .Xr xbps-digest 1 , .Xr xbps-fbulk 1 , +.Xr xbps-fetch 1 , .Xr xbps-install 1 , .Xr xbps-pkgdb 1 , .Xr xbps-query 1 , diff --git a/data/xbps.d.5 b/data/xbps.d.5 index 7aac606e..e34a99b6 100644 --- a/data/xbps.d.5 +++ b/data/xbps.d.5 @@ -142,6 +142,8 @@ Default cache directory to store downloaded binary packages. .Xr xbps-create 1 , .Xr xbps-dgraph 1 , .Xr xbps-digest 1 , +.Xr xbps-fbulk 1 , +.Xr xbps-fetch 1 , .Xr xbps-install 1 , .Xr xbps-pkgdb 1 , .Xr xbps-query 1 ,