FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 06-03-2011, 11:49 PM
Allan McRae
 
Default Add helper methods for setting directory options

On 04/06/11 08:40, Dan McGee wrote:

This keeps duplicate code to a minimum and also addresses the issue
where calling set_cachedirs() didn't canonicalize the passed-in paths.
This will come in more handy as we refactor some of these option setters
away.

Signed-off-by: Dan McGee<dan@archlinux.org>
---

<snip>



int SYMEXPORT alpm_option_set_cachedirs(alpm_list_t *cachedirs)
{
+ alpm_list_t *i, *new_cachedirs = NULL;
ASSERT(handle != NULL, RET_ERR(PM_ERR_HANDLE_NULL, -1));
+ for(i = cachedirs; i; i = i->next) {
+ int ret = alpm_option_add_cachedir(i->data);
+ if(ret) {
+ return ret;
+ }
+ }
if(handle->cachedirs) FREELIST(handle->cachedirs);
- handle->cachedirs = cachedirs;
+ handle->cachedirs = new_cachedirs;
+ FREELIST(cachedirs);
return 0;
}



Should the clean-up done to this function in PATCH 3/6 be in here
instead? This confused the hell out of me until I saw the next patch
and I'm not sure how the clean-up fits into the next patch.


Allan
 

Thread Tools




All times are GMT. The time now is 07:32 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org