summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/pacman/conf.c18
-rw-r--r--src/pacman/conf.h4
-rw-r--r--src/pacman/pacman.c4
3 files changed, 25 insertions, 1 deletions
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index 8b298ccf..5028284d 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -134,6 +134,7 @@ int config_free(config_t *oldconfig)
FREELIST(oldconfig->holdpkg);
FREELIST(oldconfig->ignorepkg);
FREELIST(oldconfig->ignoregrp);
+ FREELIST(oldconfig->assumeinstalled);
FREELIST(oldconfig->noupgrade);
FREELIST(oldconfig->noextract);
free(oldconfig->configfile);
@@ -650,6 +651,7 @@ static int setup_libalpm(void)
int ret = 0;
alpm_errno_t err;
alpm_handle_t *handle;
+ alpm_list_t *i;
pm_printf(ALPM_LOG_DEBUG, "setup_libalpm called\n");
@@ -742,6 +744,22 @@ static int setup_libalpm(void)
alpm_option_set_noupgrades(handle, config->noupgrade);
alpm_option_set_noextracts(handle, config->noextract);
+ for(i = config->assumeinstalled; i; i = i->next) {
+ char *entry = i->data;
+ alpm_depend_t *dep = alpm_dep_from_string(entry);
+ if(!dep) {
+ return 1;
+ }
+ pm_printf(ALPM_LOG_DEBUG, "parsed assume installed: %s %s\n", dep->name, dep->version);
+
+ ret = alpm_option_add_assumeinstalled(handle, dep);
+ if(ret) {
+ pm_printf(ALPM_LOG_ERROR, _("Failed to pass assume installed entry to libalpm"));
+ alpm_dep_free(dep);
+ return ret;
+ }
+ }
+
return 0;
}
diff --git a/src/pacman/conf.h b/src/pacman/conf.h
index e8cac509..8aed6d6b 100644
--- a/src/pacman/conf.h
+++ b/src/pacman/conf.h
@@ -101,6 +101,7 @@ typedef struct __config_t {
alpm_list_t *holdpkg;
alpm_list_t *ignorepkg;
alpm_list_t *ignoregrp;
+ alpm_list_t *assumeinstalled;
alpm_list_t *noupgrade;
alpm_list_t *noextract;
char *xfercommand;
@@ -176,7 +177,8 @@ enum {
OP_UNNEEDED,
OP_VERBOSE,
OP_DOWNLOADONLY,
- OP_REFRESH
+ OP_REFRESH,
+ OP_ASSUMEINSTALLED
};
/* clean method */
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 30bb4528..5cac37ca 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -634,6 +634,9 @@ static int parsearg_trans(int opt)
free(config->print_format);
config->print_format = strdup(optarg);
break;
+ case OP_ASSUMEINSTALLED:
+ parsearg_util_addlist(&(config->assumeinstalled));
+ break;
default:
return 1;
}
@@ -857,6 +860,7 @@ static int parseargs(int argc, char *argv[])
{"noconfirm", no_argument, 0, OP_NOCONFIRM},
{"config", required_argument, 0, OP_CONFIG},
{"ignore", required_argument, 0, OP_IGNORE},
+ {"assume-installed", required_argument, 0, OP_ASSUMEINSTALLED},
{"debug", optional_argument, 0, OP_DEBUG},
{"force", no_argument, 0, OP_FORCE},
{"noprogressbar", no_argument, 0, OP_NOPROGRESSBAR},