xbps-repo: add a sync target, to sync the pkg index file from a
remote repository. --HG-- extra : convert_revision : xtraeme%40gmail.com-20091031105740-xdqqsjqymc9rty5j
This commit is contained in:
		| @@ -57,6 +57,7 @@ usage(void) | ||||
| 	"    remove\t<URI>\n" | ||||
| 	"    search\t<string>\n" | ||||
| 	"    show\t<pkgname>\n" | ||||
| 	"    sync\t\t<URI>\n" | ||||
| 	" Options shared by all actions:\n" | ||||
| 	"    -r\t\t<rootdir>\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(); | ||||
| 	} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user