summaryrefslogtreecommitdiffstats
path: root/lib/libalpm
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-08-20 02:12:21 +0200
committerDan McGee <dan@archlinux.org>2011-08-20 02:12:21 +0200
commitd9e5dab6aceeb4d32cfa52d5500f0d22cabb487b (patch)
tree031845462cc7aefe45c86a03aae95bb62e44fdeb /lib/libalpm
parentd307ed5eb9d6684911c55f661e2d58e0fd6e4ceb (diff)
downloadpacman-d9e5dab6aceeb4d32cfa52d5500f0d22cabb487b.tar.gz
pacman-d9e5dab6aceeb4d32cfa52d5500f0d22cabb487b.tar.xz
Remove alpm_option_get_* usage from backend
These are all available directly on the handle without indirection. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/be_local.c3
-rw-r--r--lib/libalpm/be_sync.c7
-rw-r--r--lib/libalpm/db.c4
-rw-r--r--lib/libalpm/diskspace.c2
-rw-r--r--lib/libalpm/signing.c2
-rw-r--r--lib/libalpm/trans.c6
6 files changed, 11 insertions, 13 deletions
diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c
index 1b489224..f53bd640 100644
--- a/lib/libalpm/be_local.c
+++ b/lib/libalpm/be_local.c
@@ -194,8 +194,7 @@ static void *_cache_changelog_open(alpm_pkg_t *pkg)
char clfile[PATH_MAX];
alpm_db_t *db = alpm_pkg_get_db(pkg);
snprintf(clfile, PATH_MAX, "%s/%s/%s-%s/changelog",
- alpm_option_get_dbpath(pkg->handle),
- db->treename, pkg->name, pkg->version);
+ pkg->handle->dbpath, db->treename, pkg->name, pkg->version);
return fopen(clfile, "r");
}
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c
index 75f06645..6e64e5ff 100644
--- a/lib/libalpm/be_sync.c
+++ b/lib/libalpm/be_sync.c
@@ -41,13 +41,12 @@
static char *get_sync_dir(alpm_handle_t *handle)
{
- const char *dbpath = alpm_option_get_dbpath(handle);
- size_t len = strlen(dbpath) + 6;
+ size_t len = strlen(handle->dbpath) + 6;
char *syncpath;
struct stat buf;
MALLOC(syncpath, len, RET_ERR(handle, ALPM_ERR_MEMORY, NULL));
- sprintf(syncpath, "%s%s", dbpath, "sync/");
+ sprintf(syncpath, "%s%s", handle->dbpath, "sync/");
if(stat(syncpath, &buf) != 0) {
_alpm_log(handle, ALPM_LOG_DEBUG, "database dir '%s' does not exist, creating it\n",
@@ -260,7 +259,7 @@ cleanup:
if(_alpm_handle_unlock(handle)) {
_alpm_log(handle, ALPM_LOG_WARNING, _("could not remove lock file %s\n"),
- alpm_option_get_lockfile(handle));
+ handle->lockfile);
}
free(syncpath);
umask(oldmask);
diff --git a/lib/libalpm/db.c b/lib/libalpm/db.c
index 33282b87..4b23509a 100644
--- a/lib/libalpm/db.c
+++ b/lib/libalpm/db.c
@@ -224,7 +224,7 @@ alpm_siglevel_t SYMEXPORT alpm_db_get_siglevel(alpm_db_t *db)
{
ASSERT(db != NULL, return -1);
if(db->siglevel & ALPM_SIG_USE_DEFAULT) {
- return alpm_option_get_default_siglevel(db->handle);
+ return db->handle->siglevel;
} else {
return db->siglevel;
}
@@ -357,7 +357,7 @@ const char *_alpm_db_path(alpm_db_t *db)
const char *dbpath;
size_t pathsize;
- dbpath = alpm_option_get_dbpath(db->handle);
+ dbpath = db->handle->dbpath;
if(!dbpath) {
_alpm_log(db->handle, ALPM_LOG_ERROR, _("database path is undefined\n"));
RET_ERR(db->handle, ALPM_ERR_DB_OPEN, NULL);
diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c
index 1e2fa143..ad80304b 100644
--- a/lib/libalpm/diskspace.c
+++ b/lib/libalpm/diskspace.c
@@ -211,7 +211,7 @@ static int calculate_installed_size(alpm_handle_t *handle,
/* approximate space requirements for db entries */
if(filename[0] == '.') {
- filename = alpm_option_get_dbpath(handle);
+ filename = handle->dbpath;
}
snprintf(path, PATH_MAX, "%s%s", handle->root, filename);
diff --git a/lib/libalpm/signing.c b/lib/libalpm/signing.c
index 28ce6209..4428b543 100644
--- a/lib/libalpm/signing.c
+++ b/lib/libalpm/signing.c
@@ -116,7 +116,7 @@ static int init_gpgme(alpm_handle_t *handle)
return 0;
}
- sigdir = alpm_option_get_gpgdir(handle);
+ sigdir = handle->gpgdir;
if (_alpm_access(handle, sigdir, "pubring.gpg", R_OK)
|| _alpm_access(handle, sigdir, "trustdb.gpg", R_OK)) {
diff --git a/lib/libalpm/trans.c b/lib/libalpm/trans.c
index 3f595960..c594520d 100644
--- a/lib/libalpm/trans.c
+++ b/lib/libalpm/trans.c
@@ -82,7 +82,7 @@ static alpm_list_t *check_arch(alpm_handle_t *handle, alpm_list_t *pkgs)
alpm_list_t *i;
alpm_list_t *invalid = NULL;
- const char *arch = alpm_option_get_arch(handle);
+ const char *arch = handle->arch;
if(!arch) {
return NULL;
}
@@ -224,9 +224,9 @@ int SYMEXPORT alpm_trans_release(alpm_handle_t *handle)
if(!nolock_flag) {
if(_alpm_handle_unlock(handle)) {
_alpm_log(handle, ALPM_LOG_WARNING, _("could not remove lock file %s\n"),
- alpm_option_get_lockfile(handle));
+ handle->lockfile);
alpm_logaction(handle, "warning: could not remove lock file %s\n",
- alpm_option_get_lockfile(handle));
+ handle->lockfile);
}
}