Modify eu-strip option to perform strip in post script of rpm package & add option...
[platform/upstream/rpm.git] / rpmqv.c
diff --git a/rpmqv.c b/rpmqv.c
index e68fb75..da5f2ca 100644 (file)
--- a/rpmqv.c
+++ b/rpmqv.c
@@ -117,7 +117,7 @@ int main(int argc, char *argv[])
     }
 
     if (qva->qva_sourceCount) {
-       if (qva->qva_sourceCount > 2)
+       if (qva->qva_sourceCount > 1)
            argerror(_("one type of query/verify may be performed at a "
                        "time"));
     }
@@ -150,7 +150,7 @@ int main(int argc, char *argv[])
 #if defined(IAM_RPMEIU)
     if (!( bigMode == MODE_INSTALL ) &&
 (ia->probFilter & (RPMPROB_FILTER_REPLACEPKG | RPMPROB_FILTER_OLDPACKAGE)))
-       argerror(_("only installation, upgrading, rmsource and rmspec may be forced"));
+       argerror(_("only installation and upgrading may be forced"));
     if (bigMode != MODE_INSTALL && (ia->probFilter & RPMPROB_FILTER_FORCERELOCATE))
        argerror(_("files may only be relocated during package installation"));
 
@@ -166,13 +166,13 @@ 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 & MODES_IE) && (ia->installInterfaceFlags & INSTALL_HASH))
        argerror(_("--hash (-h) may only be specified during package "
-                       "installation"));
+                       "installation and erasure"));
 
-    if (bigMode != MODE_INSTALL && (ia->installInterfaceFlags & INSTALL_PERCENT))
+    if (!(bigMode & MODES_IE) && (ia->installInterfaceFlags & INSTALL_PERCENT))
        argerror(_("--percent may only be specified during package "
-                       "installation"));
+                       "installation and erasure"));
 
     if (bigMode != MODE_INSTALL && (ia->probFilter & RPMPROB_FILTER_REPLACEPKG))
        argerror(_("--replacepkgs may only be specified during package "
@@ -228,12 +228,11 @@ int main(int argc, char *argv[])
 
     if (ia->noDeps & (bigMode & ~MODES_FOR_NODEPS))
        argerror(_("--nodeps may only be specified during package "
-                  "building, rebuilding, recompilation, installation,"
-                  "erasure, and verification"));
+                  "installation, erasure, and verification"));
 
     if ((ia->transFlags & RPMTRANS_FLAG_TEST) && (bigMode & ~MODES_FOR_TEST))
-       argerror(_("--test may only be specified during package installation, "
-                "erasure, and building"));
+       argerror(_("--test may only be specified during package installation "
+                "and erasure"));
 #endif /* IAM_RPMEIU */
 
     if (rpmcliRootDir && rpmcliRootDir[0] != '/') {
@@ -333,18 +332,20 @@ int main(int argc, char *argv[])
        break;
     }
 
-    ts = rpmtsFree(ts);
-    finishPipe();
+    rpmtsFree(ts);
+    if (finishPipe())
+       ec = EXIT_FAILURE;
 
 #ifdef IAM_RPMQV
-    qva->qva_queryFormat = _free(qva->qva_queryFormat);
+    free(qva->qva_queryFormat);
 #endif
 
 #ifdef IAM_RPMEIU
-    if (ia->relocations != NULL)
-    for (i = 0; i < ia->numRelocations; i++)
-       ia->relocations[i].oldPath = _free(ia->relocations[i].oldPath);
-    ia->relocations = _free(ia->relocations);
+    if (ia->relocations != NULL) {
+       for (i = 0; i < ia->numRelocations; i++)
+           free(ia->relocations[i].oldPath);
+       free(ia->relocations);
+    }
 #endif
 
     rpmcliFini(optCon);