Remove bogus const from rpmInstallSource*() parameters
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 18 Dec 2007 09:56:54 +0000 (11:56 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 18 Dec 2007 09:56:54 +0000 (11:56 +0200)
- spec and cookie are malloced and need to be freed by caller
- unconst various other rpmQVK arguments & friends, no api exists to
  free them so caller needs to handle anyway

lib/psm.c
lib/rpmcli.h
lib/rpminstall.c
lib/rpmlib.h
rpmqv.c

index 90a7abe..f4ce17b 100644 (file)
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -243,7 +243,7 @@ static rpmRC markReplacedFiles(const rpmpsm psm)
 }
 
 rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd,
-               const char ** specFilePtr, const char ** cookie)
+               char ** specFilePtr, char ** cookie)
 {
     int scareMem = 1;
     rpmfi fi = NULL;
index 15a10d3..49cd3b0 100644 (file)
@@ -241,7 +241,7 @@ struct rpmQVKArguments_s {
     QVF_t qva_showPackage;     /*!< Function to display iterator matches. */
     QSpecF_t qva_specQuery;    /*!< Function to query spec file. */
     int qva_verbose;           /*!< (unused) */
-    const char * qva_queryFormat;/*!< Format for headerSprintf(). */
+    char * qva_queryFormat;    /*!< Format for headerSprintf(). */
     int sign;                  /*!< Is a passphrase needed? */
     const char * passPhrase;   /*!< Pass phrase. */
     const char * qva_prefix;   /*!< Path to top of install tree. */
@@ -390,10 +390,10 @@ int rpmcliVerify(rpmts ts, QVA_t qva, const char ** argv);
 struct rpmBuildArguments_s {
     rpmQueryFlags qva_flags;   /*!< Bit(s) to control verification. */
     int buildAmount;           /*!< Bit(s) to control operation. */
-    const char * buildRootOverride; /*!< from --buildroot */
+    char * buildRootOverride;  /*!< from --buildroot */
     char * targets;            /*!< Target platform(s), comma separated. */
     const char * passPhrase;   /*!< Pass phrase. */
-    const char * cookie;       /*!< NULL for binary, ??? for source, rpm's */
+    char * cookie;             /*!< NULL for binary, ??? for source, rpm's */
     int force;                 /*!< from --force */
     int noBuild;               /*!< from --nobuild */
     int noDeps;                        /*!< from --nodeps */
@@ -483,8 +483,8 @@ void * rpmShowProgress(const void * arg,
  * @return             0 on success
  */
 int rpmInstallSource(rpmts ts, const char * arg,
-               const char ** specFilePtr,
-               const char ** cookie);
+               char ** specFilePtr,
+               char ** cookie);
 
 
 /** \ingroup rpmcli
index 0fd0eae..7759a33 100644 (file)
@@ -798,7 +798,7 @@ exit:
 }
 
 int rpmInstallSource(rpmts ts, const char * arg,
-               const char ** specFilePtr, const char ** cookie)
+               char ** specFilePtr, char ** cookie)
 {
     FD_t fd;
     int rc;
index f2cf38b..a8a330d 100644 (file)
@@ -332,8 +332,8 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd,
  * @return             rpmRC return code
  */
 rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd,
-                       const char ** specFilePtr,
-                       const char ** cookie);
+                       char ** specFilePtr,
+                       char ** cookie);
 
 /** \ingroup rpmtrans
  * Return copy of rpmlib internal provides.
diff --git a/rpmqv.c b/rpmqv.c
index b1bdf0f..4251b79 100644 (file)
--- a/rpmqv.c
+++ b/rpmqv.c
@@ -636,7 +636,7 @@ int main(int argc, char *argv[])
        }
 
        while ((pkg = poptGetArg(optCon))) {
-           const char * specFile = NULL;
+           char * specFile = NULL;
 
            ba->cookie = NULL;
            ec = rpmInstallSource(ts, pkg, &specFile, &ba->cookie);