summaryrefslogtreecommitdiffstats
path: root/src/pacman/sync.c
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-07-02 23:16:58 +0200
committerAllan McRae <allan@archlinux.org>2013-09-04 01:51:20 +0200
commitc0ee713704d058bac560172544d6bdef5414fe4e (patch)
tree43bbdd3f2832a4350e13b94f68e0c840ba59e7e0 /src/pacman/sync.c
parent106d0fc541ad21306f5722e0178171eef6a222e9 (diff)
downloadpacman-c0ee713704d058bac560172544d6bdef5414fe4e.tar.gz
pacman-c0ee713704d058bac560172544d6bdef5414fe4e.tar.xz
pacman: add front end support for repo usage level
Add a "Usage" key to the repo section of the config which allows for the tokens "Search", "Install", "Upgrade", "All", which correspond to values in the alpm_db_usage_t enum. Users can specify "Usage" multiple times for a given repo, or multiple flags per "Usage" line and they will be OR'd together. If unspecified, the default is full usage of the repo. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'src/pacman/sync.c')
-rw-r--r--src/pacman/sync.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index d9df5456..0002db6e 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -672,6 +672,7 @@ static int process_target(const char *target, int error)
if(targname && targname != targstring) {
alpm_db_t *db;
const char *dbname;
+ alpm_db_usage_t usage;
*targname = '\0';
targname++;
@@ -683,9 +684,19 @@ static int process_target(const char *target, int error)
ret = 1;
goto cleanup;
}
+
+ /* explicitly mark this repo as valid for installs since
+ * a repo name was given with the target */
+ alpm_db_get_usage(db, &usage);
+ alpm_db_set_usage(db, usage|ALPM_DB_USAGE_INSTALL);
+
dblist = alpm_list_add(NULL, db);
ret = process_targname(dblist, targname, error);
alpm_list_free(dblist);
+
+ /* restore old usage so we don't possibly disturb later
+ * targets */
+ alpm_db_set_usage(db, usage);
} else {
targname = targstring;
dblist = alpm_get_syncdbs(config->handle);