summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2006-01-10 18:19:06 +0000
committerAurelien Foret <aurelien@archlinux.org>2006-01-10 18:19:06 +0000
commit668e58626dfdb1077f3e1eb47187f6071d3ed302 (patch)
treeaae9dc8dcb8ab98cf6a7c8e72e7309500872c181
parentec305c14439ac0c6eeee66bd99c9bcf8ab72577f (diff)
downloadpacman-668e58626dfdb1077f3e1eb47187f6071d3ed302.tar.xz
added ALLDEPS transaction flag mainly to handle "makepkg -s"
-rw-r--r--lib/libalpm/add.c6
-rw-r--r--lib/libalpm/alpm.h1
-rw-r--r--lib/libalpm/package.c2
-rw-r--r--lib/libalpm/sync.c4
4 files changed, 5 insertions, 8 deletions
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) {