From a1e57cbec8209b64ee40fdae5990e870c8203cd7 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Sun, 15 Jul 2007 12:44:18 -0400 Subject: Add --asdeps option to pacman This replaces the former -D operation that was undocumented and rather hacky. It can be used with add, upgrade, or sync transactions and will affect all packages installed. Should close FS #7193. Also tell makepkg to use this new flag. Signed-off-by: Dan McGee --- lib/libalpm/add.c | 8 ++++++-- lib/libalpm/sync.c | 6 +----- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index 8a50be4c..a91ada24 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -332,8 +332,12 @@ int _alpm_add_commit(pmtrans_t *trans, pmdb_t *db) RET_ERR(PM_ERR_MEMORY, -1); } - /* copy over the install reason */ - newpkg->reason = alpm_pkg_get_reason(local); + /* copy over the install reason (unless alldeps is set) */ + if(trans->flags & PM_TRANS_FLAG_ALLDEPS) { + newpkg->reason = PM_PKG_REASON_DEPEND; + } else { + newpkg->reason = alpm_pkg_get_reason(local); + } /* pre_upgrade scriptlet */ if(alpm_pkg_has_scriptlet(newpkg) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) { diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 41ed144a..c1d2f9e7 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -864,11 +864,7 @@ int _alpm_sync_commit(pmtrans_t *trans, pmdb_t *db_local, alpm_list_t **data) if((ptr = calloc(512, sizeof(char))) == NULL) { RET_ERR(PM_ERR_MEMORY, -1); } - if(trans->flags & PM_TRANS_FLAG_ALLDEPS) { - doremove=1; - } else { - QUESTION(trans, PM_TRANS_CONV_CORRUPTED_PKG, (char *)pkgname, NULL, NULL, &doremove); - } + QUESTION(trans, PM_TRANS_CONV_CORRUPTED_PKG, (char *)pkgname, NULL, NULL, &doremove); if(doremove) { unlink(str); snprintf(ptr, 512, _("archive %s was corrupted (bad MD5 or SHA1 checksum)\n"), pkgname); -- cgit v1.2.3-24-g4f1b