From d5c2a3266f37dacc685ce8c2089c07aee1855e69 Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Sat, 5 Feb 2011 12:21:04 +0100
Subject: [PATCH] Rename the transaction object key to "transaction" rater than
 "trans-action".

---
 bin/xbps-bin/install.c              | 8 ++++----
 doc/xbps_transaction_dictionary.dot | 2 +-
 lib/package_replaces.c              | 2 +-
 lib/package_unpack.c                | 2 +-
 lib/repository_finddeps.c           | 6 +++---
 lib/repository_findpkg.c            | 4 ++--
 lib/transaction_dictionary.c        | 2 +-
 7 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/bin/xbps-bin/install.c b/bin/xbps-bin/install.c
index 20adf781..8b11abbc 100644
--- a/bin/xbps-bin/install.c
+++ b/bin/xbps-bin/install.c
@@ -186,7 +186,7 @@ show_package_list(prop_object_iterator_t iter, const char *match)
 
 	while ((obj = prop_object_iterator_next(iter)) != NULL) {
 		prop_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
-		prop_dictionary_get_cstring_nocopy(obj, "trans-action", &tract);
+		prop_dictionary_get_cstring_nocopy(obj, "transaction", &tract);
 		if (strcmp(match, tract))
 			continue;
 		print_package_line(pkgver, false);
@@ -207,7 +207,7 @@ show_transaction_sizes(struct transaction *trans)
 	trans_inst = trans_up = trans_conf = trans_rm = false;
 
 	while ((obj = prop_object_iterator_next(trans->iter))) {
-		prop_dictionary_get_cstring_nocopy(obj, "trans-action", &tract);
+		prop_dictionary_get_cstring_nocopy(obj, "transaction", &tract);
 		if (strcmp(tract, "install") == 0) {
 			trans->inst_pkgcnt++;
 			trans_inst = true;
@@ -453,7 +453,7 @@ exec_transaction(struct transaction *trans)
 		prop_dictionary_get_cstring_nocopy(obj, "version", &version);
 		prop_dictionary_get_cstring_nocopy(obj, "pkgver", &pkgver);
 		prop_dictionary_get_cstring_nocopy(obj, "filename", &filen);
-		prop_dictionary_get_cstring_nocopy(obj, "trans-action", &tract);
+		prop_dictionary_get_cstring_nocopy(obj, "transaction", &tract);
 		prop_dictionary_get_bool(obj, "automatic-install", &autoinst);
 		prop_dictionary_get_bool(obj, "preserve",  &preserve);
 		/*
@@ -535,7 +535,7 @@ exec_transaction(struct transaction *trans)
 	 */
 	printf("\n[3/3] Configuring\n");
 	while ((obj = prop_object_iterator_next(trans->iter)) != NULL) {
-		prop_dictionary_get_cstring_nocopy(obj, "trans-action", &tract);
+		prop_dictionary_get_cstring_nocopy(obj, "transaction", &tract);
 		if (strcmp(tract, "remove") == 0)
 			continue;
 		prop_dictionary_get_cstring_nocopy(obj, "pkgname", &pkgname);
diff --git a/doc/xbps_transaction_dictionary.dot b/doc/xbps_transaction_dictionary.dot
index 0337a525..9c52e94f 100644
--- a/doc/xbps_transaction_dictionary.dot
+++ b/doc/xbps_transaction_dictionary.dot
@@ -54,7 +54,7 @@ digraph transaction_dictionary {
 	state_notinst [style=filled,fillcolor="yellowgreen",label="not-installed"];
 	state_unpacked [style=filled,fillcolor="yellowgreen",label="unpacked"];
 	dictionary -> trans_action [label="string"];
-	trans_action [label="trans-action"];
+	trans_action [label="transaction"];
 	trans_action -> tract_inst [label="value"];
 	trans_action -> tract_up [label="value"];
 	trans_action -> tract_cf [label="value"];
diff --git a/lib/package_replaces.c b/lib/package_replaces.c
index 6be1dd5b..330ddd06 100644
--- a/lib/package_replaces.c
+++ b/lib/package_replaces.c
@@ -84,7 +84,7 @@ xbps_repository_pkg_replaces(prop_dictionary_t transd,
 		 * as to be "removed".
 		 */
 		prop_dictionary_set_cstring_nocopy(instd,
-		    "trans-action", "remove");
+		    "transaction", "remove");
 		if (!xbps_add_obj_to_array(unsorted, instd)) {
 			prop_object_release(instd);
 			prop_object_iterator_release(iter);
diff --git a/lib/package_unpack.c b/lib/package_unpack.c
index 405da9dc..57d35ffc 100644
--- a/lib/package_unpack.c
+++ b/lib/package_unpack.c
@@ -189,7 +189,7 @@ unpack_archive(prop_dictionary_t pkg_repod,
 
 	prop_dictionary_get_bool(pkg_repod, "preserve", &preserve);
 	prop_dictionary_get_cstring_nocopy(pkg_repod,
-	    "trans-action", &transact);
+	    "transaction", &transact);
 	assert(transact != NULL);
 
 	if (strcmp(transact, "update") == 0)
diff --git a/lib/repository_finddeps.c b/lib/repository_finddeps.c
index e58c4c44..348a0cc1 100644
--- a/lib/repository_finddeps.c
+++ b/lib/repository_finddeps.c
@@ -297,7 +297,7 @@ find_repo_deps(prop_dictionary_t transd,	/* transaction dictionary */
 			}
 			/* Required pkgdep not installed */
 			prop_dictionary_set_cstring_nocopy(curpkgd,
-			    "trans-action", "install");
+			    "transaction", "install");
 			xbps_dbg_printf_append("not installed.\n");
 		} else {
 			/*
@@ -329,7 +329,7 @@ find_repo_deps(prop_dictionary_t transd,	/* transaction dictionary */
 				    "updating to `%s'...\n",
 				    pkgver_q, repopkgver);
 				prop_dictionary_set_cstring_nocopy(curpkgd,
-				    "trans-action", "update");
+				    "transaction", "update");
 			} else if (rv == 1) {
 				rv = 0;
 				if (state == XBPS_PKG_STATE_UNPACKED) {
@@ -339,7 +339,7 @@ find_repo_deps(prop_dictionary_t transd,	/* transaction dictionary */
 					 * mark pkg to be configured.
 					 */
 					prop_dictionary_set_cstring_nocopy(
-					    curpkgd, "trans-action",
+					    curpkgd, "transaction",
 					    "configure");
 					xbps_dbg_printf_append("installed `%s'"
 					    ", but needs to be configured...\n",
diff --git a/lib/repository_findpkg.c b/lib/repository_findpkg.c
index bb25e15d..95b460e5 100644
--- a/lib/repository_findpkg.c
+++ b/lib/repository_findpkg.c
@@ -168,10 +168,10 @@ repository_find_pkg(const char *pattern, const char *reason)
 		goto out;
 
 	/*
-	 * Set trans-action obj in pkg dictionary to "install" or "update".
+	 * Set transaction obj in pkg dictionary to "install" or "update".
 	 */
 	if (!prop_dictionary_set_cstring_nocopy(origin_pkgrd,
-	    "trans-action", reason)) {
+	    "transaction", reason)) {
 		rv = EINVAL;
 		goto out;
 	}
diff --git a/lib/transaction_dictionary.c b/lib/transaction_dictionary.c
index 03abbb61..1279b96c 100644
--- a/lib/transaction_dictionary.c
+++ b/lib/transaction_dictionary.c
@@ -114,7 +114,7 @@ compute_transaction_sizes(void)
 		return EINVAL;
 
 	while ((obj = prop_object_iterator_next(iter)) != NULL) {
-		prop_dictionary_get_cstring_nocopy(obj, "trans-action", &tract);
+		prop_dictionary_get_cstring_nocopy(obj, "transaction", &tract);
 		/*
 		 * Skip pkgs that need to be configured.
 		 */