Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/libalpm
diff options
context:
space:
mode:
authorNagy Gabor <ngaba@bibl.u-szeged.hu>2008-01-13 22:15:10 +0100
committerDan McGee <dan@archlinux.org>2008-01-21 19:39:26 -0600
commit2a7101c049dd1874da09d7d120f8855c61e55809 (patch)
treecd25104f2e775be279c4c49f4cd8579b8d174dbe /lib/libalpm
parentb2914bf0af388f369865859292b1c7342e785303 (diff)
New --asexplicit option
This is the symmetric of --asdeps, install packages explicitly. Documentation and completion files were updated accordingly. Added sync301.py and upgrade032.py pactest files to test this. I also made a little modification in ALLDEPS handling too. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
Diffstat (limited to 'lib/libalpm')
-rw-r--r--lib/libalpm/add.c17
-rw-r--r--lib/libalpm/alpm.h3
2 files changed, 10 insertions, 10 deletions
diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c
index 72b89345..5f0fbdef 100644
--- a/lib/libalpm/add.c
+++ b/lib/libalpm/add.c
@@ -99,10 +99,6 @@ int _alpm_add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name)
}
}
- if(trans->flags & PM_TRANS_FLAG_ALLDEPS) {
- pkg->reason = PM_PKG_REASON_DEPEND;
- }
-
/* add the package to the transaction */
trans->packages = alpm_list_add(trans->packages, pkg);
@@ -671,12 +667,8 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
/* we'll need to save some record for backup checks later */
oldpkg = _alpm_pkg_dup(local);
- /* copy over the install reason (unless alldeps is set) */
- if(trans->flags & PM_TRANS_FLAG_ALLDEPS) {
- newpkg->reason = PM_PKG_REASON_DEPEND;
- } else {
+ /* copy over the install reason */
newpkg->reason = alpm_pkg_get_reason(local);
- }
/* pre_upgrade scriptlet */
if(alpm_pkg_has_scriptlet(newpkg) && !(trans->flags & PM_TRANS_FLAG_NOSCRIPTLET)) {
@@ -697,6 +689,13 @@ static int commit_single_pkg(pmpkg_t *newpkg, int pkg_current, int pkg_count,
}
}
+ /* we override any pre-set reason if we have alldeps or allexplicit set */
+ if(trans->flags & PM_TRANS_FLAG_ALLDEPS) {
+ newpkg->reason = PM_PKG_REASON_DEPEND;
+ } else if(trans->flags & PM_TRANS_FLAG_ALLEXPLICIT) {
+ newpkg->reason = PM_PKG_REASON_EXPLICIT;
+ }
+
if(oldpkg) {
/* set up fake remove transaction */
int ret = upgrade_remove(oldpkg, newpkg, trans, db);
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h
index 49580c0e..0d65cff4 100644
--- a/lib/libalpm/alpm.h
+++ b/lib/libalpm/alpm.h
@@ -287,7 +287,8 @@ typedef enum _pmtransflag_t {
PM_TRANS_FLAG_NOSCRIPTLET = 0x400,
PM_TRANS_FLAG_NOCONFLICTS = 0x800,
PM_TRANS_FLAG_PRINTURIS = 0x1000,
- PM_TRANS_FLAG_NEEDED = 0x2000
+ PM_TRANS_FLAG_NEEDED = 0x2000,
+ PM_TRANS_FLAG_ALLEXPLICIT = 0x4000
} pmtransflag_t;
/* Transaction Events */