index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2007-05-31 02:51:28 -0400 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-05-31 02:51:28 -0400 |
commit | 7bd2ff685188d0d9b6ab6c6f43f6d28811936881 (patch) | |
tree | 30bbb96d2bbb8a6c63d9f7e7e6ac1c8b4b818148 /lib/libalpm/handle.c | |
parent | 722db4535ae6690d8834ffebf3a0de3a880188f9 (diff) |
-rw-r--r-- | lib/libalpm/handle.c | 19 |
diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index 47abcb32..7eb8dc36 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -79,9 +79,10 @@ pmhandle_t *_alpm_handle_new() handle->access = PM_ACCESS_RW; #endif - handle->root = strdup(PM_ROOT); - handle->dbpath = strdup(PM_DBPATH); - handle->cachedir = strdup(PM_CACHEDIR); + handle->root = strdup(ROOTDIR); + handle->dbpath = strdup(DBPATH); + handle->cachedir = strdup(CACHEDIR); + handle->lockfile = strdup(LOCKFILE); handle->logmask = PM_LOG_ERROR | PM_LOG_WARNING; return(handle); @@ -111,6 +112,7 @@ void _alpm_handle_free(pmhandle_t *handle) FREE(handle->dbpath); FREE(handle->cachedir); FREE(handle->logfile); + FREE(handle->lockfile); FREE(handle->xfercommand); FREELIST(handle->dbs_sync); FREELIST(handle->noupgrade); @@ -126,7 +128,8 @@ unsigned short SYMEXPORT alpm_option_get_logmask() { return handle->logmask; } const char SYMEXPORT *alpm_option_get_root() { return handle->root; } const char SYMEXPORT *alpm_option_get_dbpath() { return handle->dbpath; } const char SYMEXPORT *alpm_option_get_cachedir() { return handle->cachedir; } -const char *alpm_option_get_logfile() { return handle->logfile; } +const char SYMEXPORT *alpm_option_get_logfile() { return handle->logfile; } +const char SYMEXPORT *alpm_option_get_lockfile() { return handle->lockfile; } unsigned short alpm_option_get_usesyslog() { return handle->usesyslog; } alpm_list_t *alpm_option_get_noupgrades() { return handle->noupgrade; } alpm_list_t *alpm_option_get_noextracts() { return handle->noextract; } @@ -228,6 +231,14 @@ void alpm_option_set_logfile(const char *logfile) } } +void SYMEXPORT alpm_option_set_lockfile(const char *lockfile) +{ + if(handle->lockfile) FREE(handle->lockfile); + if(lockfile) { + handle->lockfile = strdup(lockfile); + } +} + void alpm_option_set_usesyslog(unsigned short usesyslog) { handle->usesyslog = usesyslog; |