summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-03-28 00:35:17 -0400
committerDan McGee <dan@archlinux.org>2007-03-28 00:35:17 -0400
commit4a0aac3862acda7d3e42362ffc95d27b9d84f0cb (patch)
tree02f7b831805f5bf8a2ed80020368c924ad79a1c0 /lib
parent8cacc46f8bcfe5b2325a2fae2af9b1fc5b09139e (diff)
downloadpacman-4a0aac3862acda7d3e42362ffc95d27b9d84f0cb.tar.xz
Fix --ignore behavior on sysupgrade
* --ignore was being ignored (haha) on sysupgrade when a package was listed as being a force upgrade. This adds a prompt to the user in this case asking what to do. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/sync.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 1de78f75..8405bbfb 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -216,14 +216,22 @@ int _alpm_sync_sysupgrade(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t *dbs_s
alpm_pkg_get_name(local), alpm_pkg_get_version(local),
alpm_pkg_get_name(spkg), alpm_pkg_get_version(spkg));
if(!_alpm_sync_find(trans->packages, alpm_pkg_get_name(spkg))) {
- pmpkg_t *dummy = _alpm_pkg_new(alpm_pkg_get_name(local),
- alpm_pkg_get_version(local));
- if(dummy == NULL) {
+ /* If package is in the ignorepkg list, ask before we add it to
+ * the transaction */
+ if(alpm_list_find_str(handle->ignorepkg, alpm_pkg_get_name(local))) {
+ int resp = 0;
+ QUESTION(trans, PM_TRANS_CONV_INSTALL_IGNOREPKG, local, NULL, NULL, &resp);
+ if(!resp) {
+ continue;
+ }
+ }
+ pmpkg_t *tmp = _alpm_pkg_dup(local);
+ if(tmp == NULL) {
goto error;
}
- sync = _alpm_sync_new(PM_SYNC_TYPE_UPGRADE, spkg, dummy);
+ sync = _alpm_sync_new(PM_SYNC_TYPE_UPGRADE, spkg, tmp);
if(sync == NULL) {
- FREEPKG(dummy);
+ FREEPKG(tmp);
goto error;
}
trans->packages = alpm_list_add(trans->packages, sync);