From 5c58b3d500d0971747af9a0c978ff6cfac668882 Mon Sep 17 00:00:00 2001 From: Nathan Jones Date: Fri, 9 Nov 2007 20:13:28 -0500 Subject: Add IgnoreGroup and --ignoregroup option. This will be used in the next commit. Signed-off-by: Nathan Jones Signed-off-by: Dan McGee --- lib/libalpm/alpm.h | 4 ++++ lib/libalpm/handle.c | 21 +++++++++++++++++++++ lib/libalpm/handle.h | 1 + 3 files changed, 26 insertions(+) (limited to 'lib') diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 20d77876..f8558e1b 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -130,6 +130,10 @@ alpm_list_t *alpm_option_get_holdpkgs(); void alpm_option_add_holdpkg(const char *pkg); void alpm_option_set_holdpkgs(alpm_list_t *holdpkgs); +alpm_list_t *alpm_option_get_ignoregrps(); +void alpm_option_add_ignoregrp(const char *grp); +void alpm_option_set_ignoregrps(alpm_list_t *ignoregrps); + time_t alpm_option_get_upgradedelay(); void alpm_option_set_upgradedelay(time_t delay); diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c index af549498..78ac1171 100644 --- a/lib/libalpm/handle.c +++ b/lib/libalpm/handle.c @@ -100,6 +100,7 @@ void _alpm_handle_free(pmhandle_t *handle) FREELIST(handle->noextract); FREELIST(handle->ignorepkg); FREELIST(handle->holdpkg); + FREELIST(handle->ignoregrp); FREE(handle); } @@ -211,6 +212,15 @@ alpm_list_t SYMEXPORT *alpm_option_get_holdpkgs() return handle->holdpkg; } +alpm_list_t SYMEXPORT *alpm_option_get_ignoregrps() +{ + if (handle == NULL) { + pm_errno = PM_ERR_HANDLE_NULL; + return NULL; + } + return handle->ignoregrp; +} + time_t SYMEXPORT alpm_option_get_upgradedelay() { if (handle == NULL) { @@ -461,6 +471,17 @@ void SYMEXPORT alpm_option_set_holdpkgs(alpm_list_t *holdpkgs) if(holdpkgs) handle->holdpkg = holdpkgs; } +void SYMEXPORT alpm_option_add_ignoregrp(const char *grp) +{ + handle->ignoregrp = alpm_list_add(handle->ignoregrp, strdup(grp)); +} + +void alpm_option_set_ignoregrps(alpm_list_t *ignoregrps) +{ + if(handle->ignoregrp) FREELIST(handle->ignoregrp); + if(ignoregrps) handle->ignoregrp = ignoregrps; +} + void SYMEXPORT alpm_option_set_upgradedelay(time_t delay) { handle->upgradedelay = delay; diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h index 0874ecd3..63a46884 100644 --- a/lib/libalpm/handle.h +++ b/lib/libalpm/handle.h @@ -55,6 +55,7 @@ typedef struct _pmhandle_t { alpm_list_t *noextract; /* List of packages NOT to extract */ /*TODO is this used?*/ alpm_list_t *ignorepkg; /* List of packages to ignore */ alpm_list_t *holdpkg; /* List of packages which 'hold' pacman */ + alpm_list_t *ignoregrp; /* List of groups to ignore */ /* options */ unsigned short usesyslog; /* Use syslog instead of logfile? */ /* TODO move to frontend */ -- cgit v1.2.3-54-g00ecf