diff options
author | Dan McGee <dan@archlinux.org> | 2012-02-02 06:45:52 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-02-06 12:49:52 +0100 |
commit | b488f229d2ec4f2e4b9e746d68422460ca664715 (patch) | |
tree | 31604f41d7c3780d3b76ac4bb87c10e676a16c54 /src/pacman/sync.c | |
parent | f12effc6ff4605ea81b3b765ff1655107aad29d8 (diff) | |
download | pacman-b488f229d2ec4f2e4b9e746d68422460ca664715.tar.gz pacman-b488f229d2ec4f2e4b9e746d68422460ca664715.tar.xz |
ALPM API adjustments for sanity and consistency
This makes several small adjustments to our exposed method names, and in
one case, parameters. The justification here is to make methods less odd
in their naming convention. If a method takes an alpm_db_t argument, the
method should be named 'alpm_db_*', but perhaps more importantly, if it
doesn't take a database as the first parameter, it should not.
Summary of changes:
alpm_db_register_sync -> alpm_register_syncdb
alpm_db_unregister_all -> alpm_unregister_all_syncdbs
alpm_option_get_localdb -> aplpm_get_localdb
alpm_option_get_syncdbs -> aplpm_get_syncdbs
alpm_db_readgroup -> alpm_db_get_group
alpm_db_set_pkgreason -> alpm_pkg_set_reason
All methods keep the same argument list except for alpm_pkg_set_reason;
there we drop the 'handle' argument as it can be retrieved from the
passed in package object.
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src/pacman/sync.c')
-rw-r--r-- | src/pacman/sync.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/pacman/sync.c b/src/pacman/sync.c index e22f94f7..700bb780 100644 --- a/src/pacman/sync.c +++ b/src/pacman/sync.c @@ -49,7 +49,7 @@ static int sync_cleandb(const char *dbpath, int keep_used) return 1; } - syncdbs = alpm_option_get_syncdbs(config->handle); + syncdbs = alpm_get_syncdbs(config->handle); rewinddir(dir); /* step through the directory one file at a time */ @@ -147,8 +147,8 @@ static int sync_cleandb_all(void) static int sync_cleancache(int level) { alpm_list_t *i; - alpm_list_t *sync_dbs = alpm_option_get_syncdbs(config->handle); - alpm_db_t *db_local = alpm_option_get_localdb(config->handle); + alpm_list_t *sync_dbs = alpm_get_syncdbs(config->handle); + alpm_db_t *db_local = alpm_get_localdb(config->handle); alpm_list_t *cachedirs = alpm_option_get_cachedirs(config->handle); int ret = 0; @@ -320,7 +320,7 @@ static int sync_search(alpm_list_t *syncs, alpm_list_t *targets) alpm_list_t *i, *j, *ret; int freelist; int found = 0; - alpm_db_t *db_local = alpm_option_get_localdb(config->handle); + alpm_db_t *db_local = alpm_get_localdb(config->handle); for(i = syncs; i; i = alpm_list_next(i)) { alpm_db_t *db = i->data; @@ -389,7 +389,7 @@ static int sync_group(int level, alpm_list_t *syncs, alpm_list_t *targets) const char *grpname = i->data; for(j = syncs; j; j = alpm_list_next(j)) { alpm_db_t *db = j->data; - alpm_group_t *grp = alpm_db_readgroup(db, grpname); + alpm_group_t *grp = alpm_db_get_group(db, grpname); if(grp) { /* get names of packages in group */ @@ -496,7 +496,7 @@ static int sync_info(alpm_list_t *syncs, alpm_list_t *targets) static int sync_list(alpm_list_t *syncs, alpm_list_t *targets) { alpm_list_t *i, *j, *ls = NULL; - alpm_db_t *db_local = alpm_option_get_localdb(config->handle); + alpm_db_t *db_local = alpm_get_localdb(config->handle); if(targets) { for(i = targets; i; i = alpm_list_next(i)) { @@ -551,8 +551,8 @@ static int sync_list(alpm_list_t *syncs, alpm_list_t *targets) static alpm_list_t *syncfirst(void) { alpm_list_t *i, *res = NULL; - alpm_db_t *db_local = alpm_option_get_localdb(config->handle); - alpm_list_t *syncdbs = alpm_option_get_syncdbs(config->handle); + alpm_db_t *db_local = alpm_get_localdb(config->handle); + alpm_list_t *syncdbs = alpm_get_syncdbs(config->handle); for(i = config->syncfirst; i; i = alpm_list_next(i)) { const char *pkgname = i->data; @@ -572,7 +572,7 @@ static alpm_list_t *syncfirst(void) { static alpm_db_t *get_db(const char *dbname) { alpm_list_t *i; - for(i = alpm_option_get_syncdbs(config->handle); i; i = i->next) { + for(i = alpm_get_syncdbs(config->handle); i; i = i->next) { alpm_db_t *db = i->data; if(strcmp(alpm_db_get_name(db), dbname) == 0) { return db; @@ -709,7 +709,7 @@ static int process_target(const char *target, int error) alpm_list_free(dblist); } else { targname = targstring; - dblist = alpm_option_get_syncdbs(config->handle); + dblist = alpm_get_syncdbs(config->handle); ret = process_targname(dblist, targname, error); } @@ -911,7 +911,7 @@ int pacman_sync(alpm_list_t *targets) return 1; } - sync_dbs = alpm_option_get_syncdbs(config->handle); + sync_dbs = alpm_get_syncdbs(config->handle); if(config->op_s_sync) { /* grab a fresh package list */ |