diff options
author | Xavier Chantry <shiningxc@gmail.com> | 2009-07-21 23:03:25 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2009-09-06 15:50:42 -0500 |
commit | 594621cbeb2f27ce8d36e652c4fdd9a9d4385ec3 (patch) | |
tree | 78041ce99beafb27918a52b6398db92e3386cfd6 /lib/libalpm/handle.c | |
parent | 92f0775e76c75ebe9e30355cc99bb40cf365abcb (diff) | |
download | pacman-594621cbeb2f27ce8d36e652c4fdd9a9d4385ec3.tar.xz |
Add Architecture and --arch option
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/handle.c')
-rw-r--r-- | lib/libalpm/handle.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 819b9742..012d4121 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -79,6 +79,7 @@ void _alpm_handle_free(pmhandle_t *handle) FREELIST(handle->cachedirs); FREE(handle->logfile); FREE(handle->lockfile); + FREE(handle->arch); FREELIST(handle->dbs_sync); FREELIST(handle->noupgrade); FREELIST(handle->noextract); @@ -213,6 +214,15 @@ alpm_list_t SYMEXPORT *alpm_option_get_ignoregrps() return handle->ignoregrp; } +const char SYMEXPORT *alpm_option_get_arch() +{ + if (handle == NULL) { + pm_errno = PM_ERR_HANDLE_NULL; + return NULL; + } + return handle->arch; +} + pmdb_t SYMEXPORT *alpm_option_get_localdb() { if (handle == NULL) { @@ -520,6 +530,12 @@ int SYMEXPORT alpm_option_remove_ignoregrp(const char *grp) return(0); } +void SYMEXPORT alpm_option_set_arch(const char *arch) +{ + if(handle->arch) FREE(handle->arch); + if(arch) handle->arch = strdup(arch); +} + void SYMEXPORT alpm_option_set_usedelta(unsigned short usedelta) { handle->usedelta = usedelta; |