From 250331a636699561e1239e341f30f2adfebbcb43 Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Thu, 22 Nov 2007 21:01:45 +0100 Subject: Add new --needed option for -S. During a pacman operation such as a group install, pacman can ask several questions such as "local version is up to date. Upgrade anyway?". They are usually all answered either by yes or by no: * yes when you want to reinstall all the targets. * no when you only want to install the missing ones (either because you are installing a group, or because you are copying a pacman -S line from wiki or whatever). So instead of asking this question for each target, it is now now configured with a flag. Yes will be the default -S behavior, No will be achieved with the --needed flag. Signed-off-by: Chantry Xavier Signed-off-by: Dan McGee --- lib/libalpm/sync.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'lib/libalpm/sync.c') diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 5e58400f..f6b130d2 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -349,15 +349,14 @@ int _alpm_sync_addtarget(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_sy local = _alpm_db_get_pkgfromcache(db_local, alpm_pkg_get_name(spkg)); if(local) { if(alpm_pkg_compare_versions(local, spkg) == 0) { - /* spkg is NOT an upgrade, get confirmation before adding */ - if(!(trans->flags & PM_TRANS_FLAG_PRINTURIS)) { - int resp = 0; - QUESTION(trans, PM_TRANS_CONV_LOCAL_UPTODATE, local, NULL, NULL, &resp); - if(!resp) { - _alpm_log(PM_LOG_WARNING, _("%s-%s is up to date -- skipping\n"), - alpm_pkg_get_name(local), alpm_pkg_get_version(local)); - return(0); - } + /* spkg is NOT an upgrade */ + if(trans->flags & PM_TRANS_FLAG_NEEDED) { + _alpm_log(PM_LOG_WARNING, _("%s-%s is up to date -- skipping\n"), + alpm_pkg_get_name(local), alpm_pkg_get_version(local)); + return(0); + } else { + _alpm_log(PM_LOG_WARNING, _("%s-%s is up to date -- reinstalling\n"), + alpm_pkg_get_name(local), alpm_pkg_get_version(local)); } } } -- cgit v1.2.3-54-g00ecf