xbps-install(1): added -U --unpack-only to only unpack pkgs, skips configuration.

This commit is contained in:
Juan RP 2015-06-03 11:15:11 +02:00
parent b2dd18faba
commit 07e8330936
5 changed files with 28 additions and 5 deletions

3
NEWS
View File

@ -1,5 +1,8 @@
xbps-0.45 (???): xbps-0.45 (???):
* xbps-install(1): added -U --unpack-only option, to only unpack packages
in the transaction, skips the configuration phase.
* configure: added `--enable-fulldebug` option to enable extra/expensive * configure: added `--enable-fulldebug` option to enable extra/expensive
debug output. debug output.

View File

@ -52,6 +52,7 @@ usage(bool fail)
" overwritten.\n" " overwritten.\n"
" -h --help Print help usage\n" " -h --help Print help usage\n"
" -i --ignore-conf-repos Ignore repositories defined in xbps.d\n" " -i --ignore-conf-repos Ignore repositories defined in xbps.d\n"
" -U --unpack-only Unpack packages in transaction, do not configure them\n"
" -M --memory-sync Remote repository data is fetched and stored\n" " -M --memory-sync Remote repository data is fetched and stored\n"
" in memory, ignoring on-disk repodata archives.\n" " in memory, ignoring on-disk repodata archives.\n"
" -n --dry-run Dry-run mode\n" " -n --dry-run Dry-run mode\n"
@ -93,7 +94,7 @@ 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:dfhiMnR:r:SuVvy"; const char *shortopts = "AC:c:dfhiMnR: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' },
@ -107,6 +108,7 @@ main(int argc, char **argv)
{ "repository", required_argument, NULL, 'R' }, { "repository", required_argument, NULL, 'R' },
{ "rootdir", required_argument, NULL, 'r' }, { "rootdir", required_argument, NULL, 'r' },
{ "sync", no_argument, NULL, 'S' }, { "sync", no_argument, NULL, 'S' },
{ "unpack-only", no_argument, NULL, 'U' },
{ "update", no_argument, NULL, 'u' }, { "update", no_argument, NULL, 'u' },
{ "verbose", no_argument, NULL, 'v' }, { "verbose", no_argument, NULL, 'v' },
{ "version", no_argument, NULL, 'V' }, { "version", no_argument, NULL, 'V' },
@ -167,6 +169,9 @@ main(int argc, char **argv)
case 'S': case 'S':
syncf = true; syncf = true;
break; break;
case 'U':
flags |= XBPS_FLAG_UNPACK_ONLY;
break;
case 'u': case 'u':
update = true; update = true;
break; break;

View File

@ -1,4 +1,4 @@
.Dd May 16, 2015 .Dd June 3, 2015
.Dt XBPS-INSTALL 1 .Dt XBPS-INSTALL 1
.Sh NAME .Sh NAME
.Nm xbps-install .Nm xbps-install
@ -104,6 +104,10 @@ This option can be specified multiple times.
Specifies a full path for the target root directory. Specifies a full path for the target root directory.
.It Fl S, Fl -sync .It Fl S, Fl -sync
Synchronize remote repository index files. Synchronize remote repository index files.
.It Fl U, Fl -unpack-only
If set, packages to be installed or upgraded in the transaction won't be configured,
just unpacked. That means that those packages should be reconfigured via
.Xr xbps-reconfigure 1 .
.It Fl u, Fl -update .It Fl u, Fl -update
Performs a full system upgrade: all installed packages will be updated to the greatest Performs a full system upgrade: all installed packages will be updated to the greatest
versions that were found in repositories. versions that were found in repositories.

View File

@ -48,7 +48,7 @@
* *
* This header documents the full API for the XBPS Library. * This header documents the full API for the XBPS Library.
*/ */
#define XBPS_API_VERSION "20150528" #define XBPS_API_VERSION "20150603"
#ifndef XBPS_VERSION #ifndef XBPS_VERSION
#define XBPS_VERSION "UNSET" #define XBPS_VERSION "UNSET"
@ -200,6 +200,13 @@
*/ */
#define XBPS_FLAG_FORCE_REMOVE_REVDEPS 0x00000800 #define XBPS_FLAG_FORCE_REMOVE_REVDEPS 0x00000800
/**
* @def XBPS_FLAG_UNPACK_ONLY
* Do not configure packages in the transaction, just unpack them.
* Must be set through the xbps_handle::flags member.
*/
#define XBPS_FLAG_UNPACK_ONLY 0x00001000
/** /**
* @def XBPS_FETCH_CACHECONN * @def XBPS_FETCH_CACHECONN
* Default (global) limit of cached connections used in libfetch. * Default (global) limit of cached connections used in libfetch.

View File

@ -348,9 +348,13 @@ xbps_transaction_commit(struct xbps_handle *xhp)
!xbps_dictionary_get(xhp->transd, "total-install-pkgs")) !xbps_dictionary_get(xhp->transd, "total-install-pkgs"))
goto out; goto out;
/* if installing packages for target_arch, don't configure anything */ if (xhp->target_arch && strcmp(xhp->native_arch, xhp->target_arch)) {
if (xhp->target_arch && strcmp(xhp->native_arch, xhp->target_arch)) /* if installing packages for target_arch, don't configure anything */
goto out; goto out;
/* do not configure packages if only unpacking is desired */
} else if (xhp->flags & XBPS_FLAG_UNPACK_ONLY) {
goto out;
}
xbps_object_iterator_reset(iter); xbps_object_iterator_reset(iter);
/* Force a pkgdb write for all unpacked pkgs in transaction */ /* Force a pkgdb write for all unpacked pkgs in transaction */