xbps-{install,query}: added -M --memory-sync option.

This explicitly enables the in memory fetch/store of remote repository
data archives mode, ignoring existing on-disk repodata archives.

This changes the previous behaviour of falling back to this mode if no
on-disk repodata archives were found.

Thanks to @Gottox and @dominikh for comments.
This commit is contained in:
Juan RP
2014-11-27 10:42:05 +01:00
parent 8e2225eb4e
commit fe9a795995
7 changed files with 45 additions and 16 deletions

View File

@@ -43,6 +43,8 @@ usage(bool fail)
" -d --debug Debug mode shown to stderr\n"
" -h --help Print help usage\n"
" -i --ignore-conf-repos Ignore repositories defined in xbps.d\n"
" -M --memory-sync Remote repository data is fetched and stored\n"
" in memory, ignoring on-disk repodata archives.\n"
" -p --property PROP[,...] Show properties for PKGNAME\n"
" -R --repository Enable repository mode. This mode explicitly\n"
" looks for packages in repositories.\n"
@@ -74,7 +76,7 @@ usage(bool fail)
int
main(int argc, char **argv)
{
const char *shortopts = "C:c:df:hHiLlmOo:p:Rr:s:S:VvX:x:";
const char *shortopts = "C:c:df:hHiLlMmOo:p:Rr:s:S:VvX:x:";
const struct option longopts[] = {
{ "config", required_argument, NULL, 'C' },
{ "cachedir", required_argument, NULL, 'c' },
@@ -84,6 +86,7 @@ main(int argc, char **argv)
{ "list-repos", no_argument, NULL, 'L' },
{ "list-pkgs", no_argument, NULL, 'l' },
{ "list-hold-pkgs", no_argument, NULL, 'H' },
{ "memory-sync", no_argument, NULL, 'M' },
{ "list-manual-pkgs", no_argument, NULL, 'm' },
{ "list-orphans", no_argument, NULL, 'O' },
{ "ownedby", required_argument, NULL, 'o' },
@@ -148,6 +151,9 @@ main(int argc, char **argv)
case 'l':
list_pkgs = opmode = true;
break;
case 'M':
flags |= XBPS_FLAG_REPOS_MEMSYNC;
break;
case 'm':
list_manual = opmode = true;
break;

View File

@@ -1,4 +1,4 @@
.Dd November 21, 2014
.Dd November 27, 2014
.Dt XBPS-QUERY 8
.Sh NAME
.Nm xbps-query
@@ -70,6 +70,9 @@ Ignore repositories defined in configuration files.
Only repositories specified in the command line via
.Ar --repository
will be used.
.It Fl M, Fl -memory-sync
For remote repositories, the data is fetched and stored in memory for the current
operation. This ignores the existing on-disk repository archives in rootdir.
.It Fl p, Fl -property Ar PROP[,...]
Only match this package property.
Multiple properties can be specified by delimiting them with commas.