diff --git a/bin/xbps-repo/main.c b/bin/xbps-repo/main.c index 01b26e22..1ab55374 100644 --- a/bin/xbps-repo/main.c +++ b/bin/xbps-repo/main.c @@ -57,6 +57,7 @@ usage(void) " remove\t\n" " search\t\n" " show\t\n" + " sync\t\t\n" " Options shared by all actions:\n" " -r\t\t\n" " -V\t\tPrints xbps release version\n" @@ -309,6 +310,17 @@ main(int argc, char **argv) if (rv != 0) exit(rv); + } else if (strcasecmp(argv[0], "sync") == 0) { + /* Syncs the pkg index file from a remote repo */ + if (argc != 2) + usage(); + + if (!sanitize_localpath(dpkgidx, argv[1])) + exit(EXIT_FAILURE); + + printf("Updating package index from: %s\n", dpkgidx); + rv = xbps_sync_repository_pkg_index(dpkgidx); + } else { usage(); } diff --git a/bin/xbps-repo/xbps-repo.8.txt b/bin/xbps-repo/xbps-repo.8.txt index ca9fa2c4..fbb524e1 100644 --- a/bin/xbps-repo/xbps-repo.8.txt +++ b/bin/xbps-repo/xbps-repo.8.txt @@ -71,6 +71,11 @@ Please note that all targets are *case insensitive*. the size it takes in filesystem, description, maintainer, architecture and other information. +*sync 'URI'*:: + Syncs the package index file that is available from the repository + specified at 'URI'. The new file will be fetched if it has been + modified since last synchronization. + BUGS ----