From 668e58626dfdb1077f3e1eb47187f6071d3ed302 Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Tue, 10 Jan 2006 18:19:06 +0000 Subject: added ALLDEPS transaction flag mainly to handle "makepkg -s" --- lib/libalpm/add.c | 6 +++--- lib/libalpm/alpm.h | 1 + lib/libalpm/package.c | 2 +- lib/libalpm/sync.c | 4 ---- 4 files changed, 5 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/libalpm/add.c b/lib/libalpm/add.c index e2276695..65dfbeef 100644 --- a/lib/libalpm/add.c +++ b/lib/libalpm/add.c @@ -176,9 +176,9 @@ int add_loadtarget(pmtrans_t *trans, pmdb_t *db, char *name) goto error; } - /* set the reason to EXPLICIT by default - * it will be overwritten in the case of an upgrade or a sync operation */ - info->reason = PM_PKG_REASON_EXPLICIT; + if(trans->flags & PM_TRANS_FLAG_ALLDEPS) { + info->reason = PM_PKG_REASON_EXPLICIT; + } /* add the package to the transaction */ trans->packages = pm_list_add(trans->packages, info); diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index 9ec571b0..f0b92996 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -214,6 +214,7 @@ enum { #define PM_TRANS_FLAG_CASCADE 0x10 #define PM_TRANS_FLAG_RECURSE 0x20 #define PM_TRANS_FLAG_DBONLY 0x40 +#define PM_TRANS_FLAG_ALLDEPS 0x80 /* Transaction Events */ enum { diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c index 784b9b07..eda87f18 100644 --- a/lib/libalpm/package.c +++ b/lib/libalpm/package.c @@ -62,7 +62,7 @@ pmpkg_t *pkg_new(const char *name, const char *version) pkg->size = 0; pkg->scriptlet = 0; pkg->force = 0; - pkg->reason = 0; + pkg->reason = PM_PKG_REASON_EXPLICIT; pkg->requiredby = NULL; pkg->conflicts = NULL; pkg->files = NULL; diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c index 7908a484..f508b47b 100644 --- a/lib/libalpm/sync.c +++ b/lib/libalpm/sync.c @@ -690,11 +690,7 @@ int sync_commit(pmtrans_t *trans, pmdb_t *db_local, PMList **data) * end of the tr->packages list */ spkg = _alpm_list_last(tr->packages)->data; if(sync->type == PM_SYNC_TYPE_DEPEND) { - /* ORE - * if called from makepkg, reason should be set to PM_PKG_REASON_DEPEND */ spkg->reason = PM_PKG_REASON_DEPEND; - } else { - spkg->reason = PM_PKG_REASON_EXPLICIT; } } if(trans_prepare(tr, data) == -1) { -- cgit v1.2.3-54-g00ecf