commit 31819876ac11f88e71cd777cf039611e096aa4d4
Author: =Rakesh Pandit <rakesh@fedoraproject.org>
Date:   Tue Dec 2 11:16:48 2008 +0530

    - Merge rpmInstallInterfaceFlags_e and rpmEraseInterfaceFlags_e to rpmCliInterfaceFlags_e.
    - Renamed (UN)?INSTALL_* to RPMCLI_* and all corresponding changes in different interface related files.

diff --git a/lib/poptI.c b/lib/poptI.c
index 9aff685..6d9cdb4 100644
--- a/lib/poptI.c
+++ b/lib/poptI.c
@@ -46,7 +46,7 @@ static void installArgCallback( poptContext con,
     switch (opt->val) {
 
     case 'i':
-	ia->installInterfaceFlags |= INSTALL_INSTALL;
+	ia->installInterfaceFlags |= RPMCLI_INSTALL;
 	break;
 
     case POPT_EXCLUDEPATH:
@@ -131,7 +131,7 @@ struct poptOption rpmInstallPoptTable[] = {
   N_("install all files, even configurations which might otherwise be skipped"),
 	NULL},
  { "allmatches", '\0', POPT_BIT_SET,
-	&rpmIArgs.eraseInterfaceFlags, UNINSTALL_ALLMATCHES,
+	&rpmIArgs.eraseInterfaceFlags, RPMCLI_ALLMATCHES,
 	N_("remove all packages which match <package> (normally an error is generated if <package> specified multiple packages)"),
 	NULL},
 
@@ -149,7 +149,7 @@ struct poptOption rpmInstallPoptTable[] = {
 	N_("print dependency loops as warning"), NULL},
 
  { "erase", 'e', POPT_BIT_SET,
-	&rpmIArgs.installInterfaceFlags, INSTALL_ERASE,
+	&rpmIArgs.installInterfaceFlags, RPMCLI_ERASE,
 	N_("erase (uninstall) package"), N_("<package>+") },
  { "excludeconfigs", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN,
 	&rpmIArgs.transFlags, RPMTRANS_FLAG_NOCONFIGS,
@@ -168,10 +168,10 @@ struct poptOption rpmInstallPoptTable[] = {
 	N_("short hand for --replacepkgs --replacefiles"), NULL},
 
  { "freshen", 'F', POPT_BIT_SET, &rpmIArgs.installInterfaceFlags,
-	(INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_INSTALL),
+	(RPMCLI_UPGRADE|RPMCLI_FRESHEN|RPMCLI_INSTALL),
 	N_("upgrade package(s) if already installed"),
 	N_("<packagefile>+") },
- { "hash", 'h', POPT_BIT_SET, &rpmIArgs.installInterfaceFlags, INSTALL_HASH,
+ { "hash", 'h', POPT_BIT_SET, &rpmIArgs.installInterfaceFlags, RPMCLI_HASH,
 	N_("print hash marks as package installs (good with -v)"), NULL},
  { "ignorearch", '\0', POPT_BIT_SET,
 	&rpmIArgs.probFilter, RPMPROB_FILTER_IGNOREARCH,
@@ -206,7 +206,7 @@ struct poptOption rpmInstallPoptTable[] = {
 	N_("don't install file security contexts"), NULL},
 
  { "noorder", '\0', POPT_BIT_SET,
-	&rpmIArgs.installInterfaceFlags, INSTALL_NOORDER,
+	&rpmIArgs.installInterfaceFlags, RPMCLI_NOORDER,
 	N_("do not reorder package installation to satisfy dependencies"),
 	NULL},
 
@@ -257,7 +257,7 @@ struct poptOption rpmInstallPoptTable[] = {
 	N_("upgrade to an old version of the package (--force on upgrades does this automatically)"),
 	NULL},
  { "percent", '\0', POPT_BIT_SET,
-	&rpmIArgs.installInterfaceFlags, INSTALL_PERCENT,
+	&rpmIArgs.installInterfaceFlags, RPMCLI_PERCENT,
 	N_("print percentages as package installs"), NULL},
  { "prefix", '\0', POPT_ARG_STRING, &rpmIArgs.prefix, 0,
 	N_("relocate the package to <dir>, if relocatable"),
@@ -274,7 +274,7 @@ struct poptOption rpmInstallPoptTable[] = {
  { "test", '\0', POPT_BIT_SET, &rpmIArgs.transFlags, RPMTRANS_FLAG_TEST,
 	N_("don't install, but tell if it would work or not"), NULL},
  { "upgrade", 'U', POPT_BIT_SET,
-	&rpmIArgs.installInterfaceFlags, (INSTALL_UPGRADE|INSTALL_INSTALL),
+	&rpmIArgs.installInterfaceFlags, (RPMCLI_UPGRADE|RPMCLI_INSTALL),
 	N_("upgrade package(s)"),
 	N_("<packagefile>+") },
 
diff --git a/lib/rpmcli.h b/lib/rpmcli.h
index 0754629..1dab3f7 100644
--- a/lib/rpmcli.h
+++ b/lib/rpmcli.h
@@ -345,29 +345,21 @@ extern struct poptOption		rpmBuildPoptTable[];
 /* --- install/upgrade/erase modes */
 
 /** \ingroup rpmcli
- * Bit(s) to control rpmInstall() operation.
- */
-typedef enum rpmInstallInterfaceFlags_e {
-    INSTALL_NONE	= 0,
-    INSTALL_PERCENT	= (1 << 0),	/*!< from --percent */
-    INSTALL_HASH	= (1 << 1),	/*!< from --hash */
-    INSTALL_NODEPS	= (1 << 2),	/*!< from --nodeps */
-    INSTALL_NOORDER	= (1 << 3),	/*!< from --noorder */
-    INSTALL_LABEL	= (1 << 4),	/*!< from --verbose (notify) */
-    INSTALL_UPGRADE	= (1 << 5),	/*!< from --upgrade */
-    INSTALL_FRESHEN	= (1 << 6),	/*!< from --freshen */
-    INSTALL_INSTALL	= (1 << 7),	/*!< from --install */
-    INSTALL_ERASE	= (1 << 8)	/*!< from --erase */
-} rpmInstallInterfaceFlags;
-
-/** \ingroup rpmcli
- * Bit(s) to control rpmErase() operation.
- */
-typedef enum rpmEraseInterfaceFlags_e {
-    UNINSTALL_NONE	= 0,
-    UNINSTALL_NODEPS	= (1 << 0),	/*!< from --nodeps */
-    UNINSTALL_ALLMATCHES= (1 << 1)	/*!< from --allmatches */
-} rpmEraseInterfaceFlags;
+ * Bit(s) to control rpmInstall() and rpmErase() operation.
+ */
+typedef enum rpmCliInterfaceFlags_e {
+    RPMCLI_NONE	= 0,
+    RPMCLI_PERCENT	= (1 << 0),	/*!< from --percent */
+    RPMCLI_HASH	= (1 << 1),	/*!< from --hash */
+    RPMCLI_NODEPS	= (1 << 2),	/*!< from --nodeps */
+    RPMCLI_NOORDER	= (1 << 3),	/*!< from --noorder */
+    RPMCLI_LABEL	= (1 << 4),	/*!< from --verbose (notify) */
+    RPMCLI_UPGRADE	= (1 << 5),	/*!< from --upgrade */
+    RPMCLI_FRESHEN	= (1 << 6),	/*!< from --freshen */
+    RPMCLI_INSTALL	= (1 << 7),	/*!< from --install */
+    RPMCLI_ERASE	= (1 << 8),	/*!< from --erase */
+    RPMCLI_ALLMATCHES  = (1 << 9)	/*!< from --allmatches */
+} rpmCliInterfaceFlags;
 
 extern int rpmcliPackagesTotal;
 extern int rpmcliHashesCurrent;
@@ -415,8 +407,8 @@ int rpmInstallSource(rpmts ts, const char * arg,
 struct rpmInstallArguments_s {
     rpmtransFlags transFlags;
     rpmprobFilterFlags probFilter;
-    rpmInstallInterfaceFlags installInterfaceFlags;
-    rpmEraseInterfaceFlags eraseInterfaceFlags;
+    rpmCliInterfaceFlags installInterfaceFlags;
+    rpmCliInterfaceFlags eraseInterfaceFlags;
     rpmQueryFlags qva_flags;	/*!< from --nodigest/--nosignature */
     int numRelocations;
     int noDeps;
diff --git a/lib/rpminstall.c b/lib/rpminstall.c
index 2fa23db..3d65593 100644
--- a/lib/rpminstall.c
+++ b/lib/rpminstall.c
@@ -115,10 +115,10 @@ void * rpmShowProgress(const void * arg,
 
     case RPMCALLBACK_INST_START:
 	rpmcliHashesCurrent = 0;
-	if (h == NULL || !(flags & INSTALL_LABEL))
+	if (h == NULL || !(flags & RPMCLI_LABEL))
 	    break;
 	/* @todo Remove headerFormat() on a progress callback. */
-	if (flags & INSTALL_HASH) {
+	if (flags & RPMCLI_HASH) {
 	    s = headerFormat(h, "%{NAME}", NULL);
 	    if (isatty (STDOUT_FILENO))
 		fprintf(stdout, "%4d:%-23.23s", rpmcliProgressCurrent + 1, s);
@@ -136,11 +136,11 @@ void * rpmShowProgress(const void * arg,
 
     case RPMCALLBACK_TRANS_PROGRESS:
     case RPMCALLBACK_INST_PROGRESS:
-	if (flags & INSTALL_PERCENT)
+	if (flags & RPMCLI_PERCENT)
 	    fprintf(stdout, "%%%% %f\n", (double) (total
 				? ((((float) amount) / total) * 100)
 				: 100.0));
-	else if (flags & INSTALL_HASH)
+	else if (flags & RPMCLI_HASH)
 	    printHash(amount, total);
 	(void) fflush(stdout);
 	break;
@@ -149,9 +149,9 @@ void * rpmShowProgress(const void * arg,
 	rpmcliHashesCurrent = 0;
 	rpmcliProgressTotal = 1;
 	rpmcliProgressCurrent = 0;
-	if (!(flags & INSTALL_LABEL))
+	if (!(flags & RPMCLI_LABEL))
 	    break;
-	if (flags & INSTALL_HASH)
+	if (flags & RPMCLI_HASH)
 	    fprintf(stdout, "%-28s", _("Preparing..."));
 	else
 	    fprintf(stdout, "%s\n", _("Preparing packages for installation..."));
@@ -159,7 +159,7 @@ void * rpmShowProgress(const void * arg,
 	break;
 
     case RPMCALLBACK_TRANS_STOP:
-	if (flags & INSTALL_HASH)
+	if (flags & RPMCLI_HASH)
 	    printHash(1, 1);	/* Fixes "preparing..." progress bar */
 	rpmcliProgressTotal = rpmcliPackagesTotal;
 	rpmcliProgressCurrent = 0;
@@ -228,7 +228,7 @@ int rpmInstall(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_t fileArgv)
     probFilter = ia->probFilter;
     relocations = ia->relocations;
 
-    if (ia->installInterfaceFlags & INSTALL_UPGRADE)
+    if (ia->installInterfaceFlags & RPMCLI_UPGRADE)
 	vsflags = rpmExpandNumeric("%{?_vsflags_erase}");
     else
 	vsflags = rpmExpandNumeric("%{?_vsflags_install}");
@@ -241,7 +241,7 @@ int rpmInstall(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_t fileArgv)
     ovsflags = rpmtsSetVSFlags(ts, (vsflags | RPMVSF_NEEDPAYLOAD));
 
     {	int notifyFlags;
-	notifyFlags = ia->installInterfaceFlags | (rpmIsVerbose() ? INSTALL_LABEL : 0 );
+	notifyFlags = ia->installInterfaceFlags | (rpmIsVerbose() ? RPMCLI_LABEL : 0 );
 	xx = rpmtsSetNotifyCallback(ts,
 			rpmShowProgress, (void *) ((long)notifyFlags));
     }
@@ -415,7 +415,7 @@ restart:
 	}
 
 	/* On --freshen, verify package is installed and newer */
-	if (ia->installInterfaceFlags & INSTALL_FRESHEN) {
+	if (ia->installInterfaceFlags & RPMCLI_FRESHEN) {
 	    rpmdbMatchIterator mi;
 	    const char * name;
 	    Header oldH;
@@ -440,7 +440,7 @@ restart:
 	}
 
 	rc = rpmtsAddInstallElement(ts, eiu->h, (fnpyKey)fileName,
-			(ia->installInterfaceFlags & INSTALL_UPGRADE) != 0,
+			(ia->installInterfaceFlags & RPMCLI_UPGRADE) != 0,
 			relocations);
 
 	/* XXX reference held by transaction set */
@@ -513,7 +513,7 @@ maybe_manifest:
 
     if (eiu->numFailed) goto exit;
 
-    if (eiu->numRPMS && !(ia->installInterfaceFlags & INSTALL_NODEPS)) {
+    if (eiu->numRPMS && !(ia->installInterfaceFlags & RPMCLI_NODEPS)) {
 
 	if (rpmtsCheck(ts)) {
 	    eiu->numFailed = eiu->numPkgs;
@@ -530,7 +530,7 @@ maybe_manifest:
 	ps = rpmpsFree(ps);
     }
 
-    if (eiu->numRPMS && !(ia->installInterfaceFlags & INSTALL_NOORDER)) {
+    if (eiu->numRPMS && !(ia->installInterfaceFlags & RPMCLI_NOORDER)) {
 	if (rpmtsOrder(ts)) {
 	    eiu->numFailed = eiu->numPkgs;
 	    stopInstall = 1;
@@ -632,7 +632,7 @@ int rpmErase(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_const_t argv)
 
 #ifdef	NOTYET	/* XXX no callbacks on erase yet */
     {	int notifyFlags, xx;
-	notifyFlags = ia->eraseInterfaceFlags | (rpmIsVerbose() ? INSTALL_LABEL : 0 );
+	notifyFlags = ia->eraseInterfaceFlags | (rpmIsVerbose() ? RPMCLI_LABEL : 0 );
 	xx = rpmtsSetNotifyCallback(ts,
 			rpmShowProgress, (void *) ((long)notifyFlags));
     }
@@ -658,7 +658,7 @@ int rpmErase(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_const_t argv)
 	    Header h;	/* XXX iterator owns the reference */
 
 	    if (matches > 1 && 
-		!(ia->eraseInterfaceFlags & UNINSTALL_ALLMATCHES)) {
+		!(ia->eraseInterfaceFlags & RPMCLI_ALLMATCHES)) {
 		rpmlog(RPMLOG_ERR, _("\"%s\" specifies multiple packages:\n"),
 			*arg);
 		numFailed++;
@@ -683,7 +683,7 @@ int rpmErase(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_const_t argv)
 
     if (numFailed) goto exit;
 
-    if (!(ia->eraseInterfaceFlags & UNINSTALL_NODEPS)) {
+    if (!(ia->eraseInterfaceFlags & RPMCLI_NODEPS)) {
 
 	if (rpmtsCheck(ts)) {
 	    numFailed = numPackages;
@@ -700,7 +700,7 @@ int rpmErase(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_const_t argv)
 	ps = rpmpsFree(ps);
     }
 
-    if (!stopUninstall && !(ia->installInterfaceFlags & INSTALL_NOORDER)) {
+    if (!stopUninstall && !(ia->installInterfaceFlags & RPMCLI_NOORDER)) {
 	if (rpmtsOrder(ts)) {
 	    numFailed += numPackages;
 	    stopUninstall = 1;
diff --git a/rpmqv.c b/rpmqv.c
index 895d88c..867e23d 100644
--- a/rpmqv.c
+++ b/rpmqv.c
@@ -358,8 +358,8 @@ int main(int argc, char *argv[])
 #ifdef	IAM_RPMEIU
   if (bigMode == MODE_UNKNOWN || (bigMode & MODES_IE))
     {	int iflags = (ia->installInterfaceFlags &
-		(INSTALL_UPGRADE|INSTALL_FRESHEN|INSTALL_INSTALL));
-	int eflags = (ia->installInterfaceFlags & INSTALL_ERASE);
+		(RPMCLI_UPGRADE|RPMCLI_FRESHEN|RPMCLI_INSTALL));
+	int eflags = (ia->installInterfaceFlags & RPMCLI_ERASE);
 
 	if (iflags & eflags)
 	    argerror(_("only one major mode may be specified"));
@@ -410,11 +410,11 @@ int main(int argc, char *argv[])
     if (ia->prefix && ia->prefix[0] != '/') 
 	argerror(_("arguments to --prefix must begin with a /"));
 
-    if (bigMode != MODE_INSTALL && (ia->installInterfaceFlags & INSTALL_HASH))
+    if (bigMode != MODE_INSTALL && (ia->installInterfaceFlags & RPMCLI_HASH))
 	argerror(_("--hash (-h) may only be specified during package "
 			"installation"));
 
-    if (bigMode != MODE_INSTALL && (ia->installInterfaceFlags & INSTALL_PERCENT))
+    if (bigMode != MODE_INSTALL && (ia->installInterfaceFlags & RPMCLI_PERCENT))
 	argerror(_("--percent may only be specified during package "
 			"installation"));
 
@@ -447,7 +447,7 @@ int main(int argc, char *argv[])
 	argerror(_("--ignoresize may only be specified during package "
 		   "installation"));
 
-    if ((ia->eraseInterfaceFlags & UNINSTALL_ALLMATCHES) && bigMode != MODE_ERASE)
+    if ((ia->eraseInterfaceFlags & RPMCLI_ALLMATCHES) && bigMode != MODE_ERASE)
 	argerror(_("--allmatches may only be specified during package "
 		   "erasure"));
 
@@ -711,7 +711,7 @@ int main(int argc, char *argv[])
 
 #ifdef	IAM_RPMEIU
     case MODE_ERASE:
-	if (ia->noDeps) ia->eraseInterfaceFlags |= UNINSTALL_NODEPS;
+	if (ia->noDeps) ia->eraseInterfaceFlags |= RPMCLI_NODEPS;
 
 	if (!poptPeekArg(optCon)) {
 	    argerror(_("no packages given for erase"));
@@ -731,7 +731,7 @@ int main(int argc, char *argv[])
 		ia->transFlags |= RPMTRANS_FLAG_NODOCS;
 	}
 
-	if (ia->noDeps) ia->installInterfaceFlags |= INSTALL_NODEPS;
+	if (ia->noDeps) ia->installInterfaceFlags |= RPMCLI_NODEPS;
 
 	/* we've already ensured !(!ia->prefix && !ia->relocations) */
 	if (ia->prefix) {
