xbps-install(1): added -D, --download-only.
Added `-D, --download-only` flag to allow downloading packages to the cache without attempting to install them. Contributed by Toyam Cox via #9 Adapted to master by yours truly. Close #9
This commit is contained in:
parent
4f717dc597
commit
fe943eb7d2
6
NEWS
6
NEWS
@ -1,6 +1,10 @@
|
|||||||
xbps-0.55 (???):
|
xbps-0.55 (???):
|
||||||
|
|
||||||
* xbps-install(1): added `-I --ignore-file-conflicts` to not abort
|
* xbps-install(1): Added `-D, --download-only` flag to allow
|
||||||
|
downloading packages to the cache without attempting to
|
||||||
|
install them. [Toyam Cox]
|
||||||
|
|
||||||
|
* xbps-install(1): added `-I, --ignore-file-conflicts` to not abort
|
||||||
the transaction even if file conflicts were detected. [xtraeme]
|
the transaction even if file conflicts were detected. [xtraeme]
|
||||||
|
|
||||||
* xbps-install(1): return 0 if package is already installed,
|
* xbps-install(1): return 0 if package is already installed,
|
||||||
|
@ -47,6 +47,7 @@ usage(bool fail)
|
|||||||
" -C --config <dir> Path to confdir (xbps.d)\n"
|
" -C --config <dir> Path to confdir (xbps.d)\n"
|
||||||
" -c --cachedir <dir> Path to cachedir\n"
|
" -c --cachedir <dir> Path to cachedir\n"
|
||||||
" -d --debug Debug mode shown to stderr\n"
|
" -d --debug Debug mode shown to stderr\n"
|
||||||
|
" -D --download-only Download packages and check integrity, nothing else.\n"
|
||||||
" -f --force Force package re-installation\n"
|
" -f --force Force package re-installation\n"
|
||||||
" If specified twice, all files will be\n"
|
" If specified twice, all files will be\n"
|
||||||
" overwritten.\n"
|
" overwritten.\n"
|
||||||
@ -95,12 +96,13 @@ repo_import_key_cb(struct xbps_repo *repo, void *arg UNUSED, bool *done UNUSED)
|
|||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
const char *shortopts = "AC:c:dfhIiMnR:r:SuUVvy";
|
const char *shortopts = "AC:c:DdfhIiMnR:r:SuUVvy";
|
||||||
const struct option longopts[] = {
|
const struct option longopts[] = {
|
||||||
{ "automatic", no_argument, NULL, 'A' },
|
{ "automatic", no_argument, NULL, 'A' },
|
||||||
{ "config", required_argument, NULL, 'C' },
|
{ "config", required_argument, NULL, 'C' },
|
||||||
{ "cachedir", required_argument, NULL, 'c' },
|
{ "cachedir", required_argument, NULL, 'c' },
|
||||||
{ "debug", no_argument, NULL, 'd' },
|
{ "debug", no_argument, NULL, 'd' },
|
||||||
|
{ "download-only", no_argument, NULL, 'D' },
|
||||||
{ "force", no_argument, NULL, 'f' },
|
{ "force", no_argument, NULL, 'f' },
|
||||||
{ "help", no_argument, NULL, 'h' },
|
{ "help", no_argument, NULL, 'h' },
|
||||||
{ "ignore-conf-repos", no_argument, NULL, 'i' },
|
{ "ignore-conf-repos", no_argument, NULL, 'i' },
|
||||||
@ -144,6 +146,9 @@ main(int argc, char **argv)
|
|||||||
case 'd':
|
case 'd':
|
||||||
flags |= XBPS_FLAG_DEBUG;
|
flags |= XBPS_FLAG_DEBUG;
|
||||||
break;
|
break;
|
||||||
|
case 'D':
|
||||||
|
flags |= XBPS_FLAG_DOWNLOAD_ONLY;
|
||||||
|
break;
|
||||||
case 'f':
|
case 'f':
|
||||||
fflag++;
|
fflag++;
|
||||||
if (fflag > 1)
|
if (fflag > 1)
|
||||||
|
@ -72,6 +72,11 @@ If the first character is not '/' then it's a relative path of
|
|||||||
.Ar rootdir .
|
.Ar rootdir .
|
||||||
.It Fl d, Fl -debug
|
.It Fl d, Fl -debug
|
||||||
Enables extra debugging shown to stderr.
|
Enables extra debugging shown to stderr.
|
||||||
|
.It Fl D, Fl -download-only
|
||||||
|
Only download packages to the cache, do not do any other installation steps.
|
||||||
|
This may be useful for doing system upgrades while offline, or automatically
|
||||||
|
downloading updates while leaving you with the option of still manually running
|
||||||
|
the update.
|
||||||
.It Fl f, Fl -force
|
.It Fl f, Fl -force
|
||||||
Force downgrade installation (if package version in repos is less than installed version),
|
Force downgrade installation (if package version in repos is less than installed version),
|
||||||
or reinstallation (if package version in repos is the same) to the target
|
or reinstallation (if package version in repos is the same) to the target
|
||||||
|
@ -210,11 +210,18 @@
|
|||||||
#define XBPS_FLAG_UNPACK_ONLY 0x00001000
|
#define XBPS_FLAG_UNPACK_ONLY 0x00001000
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @def XBPS_FLAG_DOWNLOAD_ONLY
|
||||||
|
* Only download packages to the cache, do not do any installation steps.
|
||||||
|
* Must be set through the xbps_handle::flags member.
|
||||||
|
*/
|
||||||
|
#define XBPS_FLAG_DOWNLOAD_ONLY 0x00002000
|
||||||
|
|
||||||
|
/*
|
||||||
* @def XBPS_FLAG_IGNORE_FILE_CONFLICTS
|
* @def XBPS_FLAG_IGNORE_FILE_CONFLICTS
|
||||||
* Continue with transaction even if there are file conflicts.
|
* Continue with transaction even if there are file conflicts.
|
||||||
* Must be set through the xbps_handle::flags member.
|
* Must be set through the xbps_handle::flags member.
|
||||||
*/
|
*/
|
||||||
#define XBPS_FLAG_IGNORE_FILE_CONFLICTS 0x00002000
|
#define XBPS_FLAG_IGNORE_FILE_CONFLICTS 0x00004000
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @def XBPS_FETCH_CACHECONN
|
* @def XBPS_FETCH_CACHECONN
|
||||||
@ -1282,7 +1289,6 @@ xbps_dictionary_t xbps_archive_fetch_plist(const char *url, const char *p);
|
|||||||
/** @addtogroup repopool */
|
/** @addtogroup repopool */
|
||||||
/*@{*/
|
/*@{*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @struct xbps_repo xbps.h "xbps.h"
|
* @struct xbps_repo xbps.h "xbps.h"
|
||||||
* @brief Repository structure
|
* @brief Repository structure
|
||||||
@ -1633,7 +1639,6 @@ xbps_array_t xbps_repo_get_pkg_revdeps(struct xbps_repo *repo, const char *pkg);
|
|||||||
*/
|
*/
|
||||||
int xbps_repo_key_import(struct xbps_repo *repo);
|
int xbps_repo_key_import(struct xbps_repo *repo);
|
||||||
|
|
||||||
|
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
/** @addtogroup archive_util */
|
/** @addtogroup archive_util */
|
||||||
|
@ -255,6 +255,10 @@ xbps_transaction_commit(struct xbps_handle *xhp)
|
|||||||
"%s\n", strerror(rv));
|
"%s\n", strerror(rv));
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
if (xhp->flags & XBPS_FLAG_DOWNLOAD_ONLY) {
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Collect files in the transaction and find some issues
|
* Collect files in the transaction and find some issues
|
||||||
* like multiple packages installing the same file.
|
* like multiple packages installing the same file.
|
||||||
@ -265,6 +269,7 @@ xbps_transaction_commit(struct xbps_handle *xhp)
|
|||||||
"%s\n", strerror(rv));
|
"%s\n", strerror(rv));
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Install, update, configure or remove packages as specified
|
* Install, update, configure or remove packages as specified
|
||||||
* in the transaction dictionary.
|
* in the transaction dictionary.
|
||||||
|
Loading…
Reference in New Issue
Block a user