From 3e42bc6410171ddfc966cfdd8c40476fe04d2c8a Mon Sep 17 00:00:00 2001
From: Juan RP <xtraeme@gmail.com>
Date: Tue, 11 Aug 2009 14:01:28 +0200
Subject: [PATCH] Flags are named XBPS_FLAG_XXX, add XBPS_FLAG_FORCE.

--HG--
extra : convert_revision : 4f7ad37910303a87788b2daac9b4ba11bf39becd
---
 bin/xbps-bin/main.c |  2 +-
 include/xbps_api.h  |  3 ++-
 lib/remove.c        | 16 ++++++++--------
 lib/unpack.c        |  4 ++--
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/bin/xbps-bin/main.c b/bin/xbps-bin/main.c
index 0feee5e6c0f..1fb47372c1e 100644
--- a/bin/xbps-bin/main.c
+++ b/bin/xbps-bin/main.c
@@ -113,7 +113,7 @@ main(int argc, char **argv)
 			break;
 		case 'v':
 			verbose = true;
-			flags |= XBPS_VERBOSE;
+			flags |= XBPS_FLAG_VERBOSE;
 			break;
 		case '?':
 		default:
diff --git a/include/xbps_api.h b/include/xbps_api.h
index a4b8d065c48..b3c9eba61f2 100644
--- a/include/xbps_api.h
+++ b/include/xbps_api.h
@@ -58,7 +58,8 @@
 #define XBPS_PKGINDEX_VERSION	"1.0"
 
 /* Verbose messages */
-#define XBPS_VERBOSE		0x00000001
+#define XBPS_FLAG_VERBOSE	0x00000001
+#define XBPS_FLAG_FORCE		0x00000002
 
 #define ARCHIVE_READ_BLOCKSIZE	10240
 
diff --git a/lib/remove.c b/lib/remove.c
index 81a1b611456..67a0cf09bbf 100644
--- a/lib/remove.c
+++ b/lib/remove.c
@@ -97,7 +97,7 @@ remove_pkg_metadir(const char *pkgname)
 		}
 
 		if ((rv = unlink(path)) == -1) {
-			if (flags & XBPS_VERBOSE)
+			if (flags & XBPS_FLAG_VERBOSE)
 				printf("WARNING: can't remove %s (%s)\n",
 				    pkgname, strerror(errno));
 		}
@@ -144,13 +144,13 @@ remove_pkg_files(prop_dictionary_t dict)
 			return EINVAL;
 		}
 		if ((rv = remove(path)) == -1) {
-			if (flags & XBPS_VERBOSE)
+			if (flags & XBPS_FLAG_VERBOSE)
 				printf("WARNING: can't remove link %s (%s)\n",
 				    file, strerror(errno));
 			free(path);
 			continue;
 		}
-		if (flags & XBPS_VERBOSE)
+		if (flags & XBPS_FLAG_VERBOSE)
 			printf("Removed link: %s\n", file);
 
 		free(path);
@@ -199,7 +199,7 @@ files:
 				free(path);
 				continue;
 			} else if (rv == ERANGE) {
-				if (flags & XBPS_VERBOSE)
+				if (flags & XBPS_FLAG_VERBOSE)
 					printf("WARNING: SHA256 doesn't match "
 					    "for %s %s, ignoring...\n",
 					    curftype, file);
@@ -211,14 +211,14 @@ files:
 				return rv;
 			}
 			if ((rv = remove(path)) == -1) {
-				if (flags & XBPS_VERBOSE)
+				if (flags & XBPS_FLAG_VERBOSE)
 					printf("WARNING: can't remove "
 					    "%s %s (%s)\n", curftype, file,
 					    strerror(errno));
 				free(path);
 				continue;
 			}
-			if (flags & XBPS_VERBOSE)
+			if (flags & XBPS_FLAG_VERBOSE)
 				printf("Removed %s: %s\n", curftype, file);
 
 			free(path);
@@ -256,7 +256,7 @@ dirs:
 				free(path);
 				continue;
 			}
-			if (flags & XBPS_VERBOSE) {
+			if (flags & XBPS_FLAG_VERBOSE) {
 				printf("WARNING: can't remove "
 				    "directory %s (%s)\n", file,
 				    strerror(errno));
@@ -264,7 +264,7 @@ dirs:
 				continue;
 			}
 		}
-		if (flags & XBPS_VERBOSE)
+		if (flags & XBPS_FLAG_VERBOSE)
 			printf("Removed directory: %s\n", file);
 
 		free(path);
diff --git a/lib/unpack.c b/lib/unpack.c
index 36a34ff93ca..a196337ce3a 100644
--- a/lib/unpack.c
+++ b/lib/unpack.c
@@ -232,7 +232,7 @@ unpack_archive_fini(struct archive *ar, prop_dictionary_t pkg,
 				    archive_error_string(ar));
 				return rv;;
 			} else if (rv == EEXIST) {
-				if (flags & XBPS_VERBOSE) {
+				if (flags & XBPS_FLAG_VERBOSE) {
 					printf("WARNING: ignoring existent "
 					    "path: %s\n",
 					    archive_entry_pathname(entry));
@@ -241,7 +241,7 @@ unpack_archive_fini(struct archive *ar, prop_dictionary_t pkg,
 				continue;
 			}
 		}
-		if (flags & XBPS_VERBOSE) {
+		if (flags & XBPS_FLAG_VERBOSE) {
 			printf(" %s\n", archive_entry_pathname(entry));
 			(void)fflush(stdout);
 		}