summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-02-14 12:32:25 -0600
committerDan McGee <dan@archlinux.org>2012-04-12 08:55:49 -0500
commit6a8e50a69ec419cc95ee513cd2e73944c4ac57f9 (patch)
tree9db3a839aaa5b1f337a7875ef2b8fab1346abf58 /src
parent8fb1948cd05eb90d8c61c7ab4873c90eea0e9f09 (diff)
downloadpacman-6a8e50a69ec419cc95ee513cd2e73944c4ac57f9.tar.xz
Remove SyncFirst option
This has outlived its usefulness and causes more problems than it solves. It has historically only ever been used to install pacman first. That should not be needed given we provide the vercmp utility (which has no library dependencies) and so calling pacman in install scripts is a sign of poor packaging. Work-duplicated-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/conf.c3
-rw-r--r--src/pacman/conf.h1
-rw-r--r--src/pacman/sync.c53
3 files changed, 1 insertions, 56 deletions
diff --git a/src/pacman/conf.c b/src/pacman/conf.c
index 2632d18f..4aaacb54 100644
--- a/src/pacman/conf.c
+++ b/src/pacman/conf.c
@@ -71,7 +71,6 @@ int config_free(config_t *oldconfig)
alpm_list_free(oldconfig->explicit_removes);
FREELIST(oldconfig->holdpkg);
- FREELIST(oldconfig->syncfirst);
FREELIST(oldconfig->ignorepkg);
FREELIST(oldconfig->ignoregrp);
FREELIST(oldconfig->noupgrade);
@@ -422,8 +421,6 @@ static int _parse_options(const char *key, char *value,
setrepeatingoption(value, "IgnoreGroup", &(config->ignoregrp));
} else if(strcmp(key, "HoldPkg") == 0) {
setrepeatingoption(value, "HoldPkg", &(config->holdpkg));
- } else if(strcmp(key, "SyncFirst") == 0) {
- setrepeatingoption(value, "SyncFirst", &(config->syncfirst));
} else if(strcmp(key, "CacheDir") == 0) {
setrepeatingoption(value, "CacheDir", &(config->cachedirs));
} else if(strcmp(key, "Architecture") == 0) {
diff --git a/src/pacman/conf.h b/src/pacman/conf.h
index d3494c75..69c955ed 100644
--- a/src/pacman/conf.h
+++ b/src/pacman/conf.h
@@ -84,7 +84,6 @@ typedef struct __config_t {
/* select -Sc behavior */
unsigned short cleanmethod;
alpm_list_t *holdpkg;
- alpm_list_t *syncfirst;
alpm_list_t *ignorepkg;
alpm_list_t *ignoregrp;
alpm_list_t *noupgrade;
diff --git a/src/pacman/sync.c b/src/pacman/sync.c
index 9c17f45f..3b094854 100644
--- a/src/pacman/sync.c
+++ b/src/pacman/sync.c
@@ -591,26 +591,6 @@ static int sync_list(alpm_list_t *syncs, alpm_list_t *targets)
return 0;
}
-static alpm_list_t *syncfirst(void) {
- alpm_list_t *i, *res = NULL;
- alpm_db_t *db_local = alpm_get_localdb(config->handle);
- alpm_list_t *syncdbs = alpm_get_syncdbs(config->handle);
-
- for(i = config->syncfirst; i; i = alpm_list_next(i)) {
- const char *pkgname = i->data;
- alpm_pkg_t *pkg = alpm_db_get_pkg(db_local, pkgname);
- if(pkg == NULL) {
- continue;
- }
-
- if(alpm_sync_newversion(pkg, syncdbs)) {
- res = alpm_list_add(res, strdup(pkgname));
- }
- }
-
- return res;
-}
-
static alpm_db_t *get_db(const char *dbname)
{
alpm_list_t *i;
@@ -1001,38 +981,7 @@ int pacman_sync(alpm_list_t *targets)
}
}
- alpm_list_t *targs = alpm_list_strdup(targets);
- if(!config->op_s_downloadonly && !config->print) {
- /* check for newer versions of packages to be upgraded first */
- alpm_list_t *packages = syncfirst();
- if(packages) {
- /* Do not ask user if all the -S targets are SyncFirst packages, see FS#15810 */
- alpm_list_t *tmp = NULL;
- if(config->op_s_upgrade || (tmp = alpm_list_diff(targets, packages, (alpm_list_fn_cmp)strcmp))) {
- alpm_list_free(tmp);
- printf(_(":: The following packages should be upgraded first :\n"));
- list_display(" ", packages, getcols(fileno(stdout)));
- if(yesno(_(":: Do you want to cancel the current operation\n"
- ":: and upgrade these packages now?"))) {
- FREELIST(targs);
- targs = packages;
- config->flags = 0;
- config->op_s_upgrade = 0;
- } else {
- FREELIST(packages);
- }
- printf("\n");
- } else {
- pm_printf(ALPM_LOG_DEBUG, "skipping SyncFirst dialog\n");
- FREELIST(packages);
- }
- }
- }
-
- int ret = sync_trans(targs);
- FREELIST(targs);
-
- return ret;
+ return sync_trans(targets);
}
/* vim: set ts=2 sw=2 noet: */