From 1a0a12cf159a05471be62016a318d0653ae30ff5 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Sat, 15 Dec 2007 11:03:46 +0200 Subject: [PATCH] Remove bogus const from rpmGenPath() temporary targets --- build.c | 2 +- build/build.c | 2 +- build/files.c | 13 +++++++------ build/parsePreamble.c | 4 ++-- build/parsePrep.c | 2 +- lib/psm.c | 4 ++-- lib/rpminstall.c | 2 +- lib/rpmlock.c | 2 +- rpmdb/db3.c | 8 ++++---- rpmdb/sqlite.c | 4 ++-- rpmio/rpmfileutil.c | 2 +- rpmio/rpmio.c | 2 +- 12 files changed, 24 insertions(+), 23 deletions(-) diff --git a/build.c b/build.c index 9c0cbf5..a7dbfa1 100644 --- a/build.c +++ b/build.c @@ -94,7 +94,7 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba) const char * passPhrase = ba->passPhrase; const char * cookie = ba->cookie; int buildAmount = ba->buildAmount; - const char * buildRootURL = NULL; + char * buildRootURL = NULL; const char * specFile; const char * specURL; int specut; diff --git a/build/build.c b/build/build.c index 7a6074c..fd3f37b 100644 --- a/build/build.c +++ b/build/build.c @@ -52,7 +52,7 @@ rpmRC doScript(rpmSpec spec, rpmBuildFlags what, const char *name, StringBuf sb, const char * rootURL = spec->rootURL; const char * rootDir; const char *scriptName = NULL; - const char * buildDirURL = rpmGenPath(rootURL, "%{_builddir}", ""); + char * buildDirURL = rpmGenPath(rootURL, "%{_builddir}", ""); const char * buildScript; const char * buildCmd = NULL; const char * buildTemplate = NULL; diff --git a/build/files.c b/build/files.c index 206ada4..e8a16bd 100644 --- a/build/files.c +++ b/build/files.c @@ -1624,7 +1624,8 @@ static rpmRC processMetadataFile(Package pkg, FileList fl, const char * fileURL, rpm_tag_t tag) { const char * buildURL = "%{_builddir}/%{?buildsubdir}/"; - const char * fn = NULL; + const char * urlfn = NULL; + char * fn = NULL; const char * apkt = NULL; uint8_t * pkt = NULL; ssize_t pktlen = 0; @@ -1632,12 +1633,12 @@ static rpmRC processMetadataFile(Package pkg, FileList fl, const char * fileURL, int rc = RPMRC_FAIL; int xx; - (void) urlPath(fileURL, &fn); - if (*fn == '/') { - fn = rpmGenPath(fl->buildRootURL, NULL, fn); + (void) urlPath(fileURL, &urlfn); + if (*urlfn == '/') { + fn = rpmGenPath(fl->buildRootURL, NULL, urlfn); absolute = 1; } else - fn = rpmGenPath(buildURL, NULL, fn); + fn = rpmGenPath(buildURL, NULL, urlfn); switch (tag) { default: @@ -1700,7 +1701,7 @@ static rpmRC processBinaryFile(Package pkg, FileList fl, { int quote = 1; /* XXX permit quoted glob characters. */ int doGlob; - const char *diskURL = NULL; + char *diskURL = NULL; int rc = RPMRC_OK; doGlob = glob_pattern_p(fileURL, quote); diff --git a/build/parsePreamble.c b/build/parsePreamble.c index 9f4c6b6..37855f8 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -501,7 +501,7 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpm_tag_t tag, case RPMTAG_BUILDROOT: SINGLE_TOKEN_ONLY; { const char * buildRoot = NULL; - const char * buildRootURL = spec->buildRootURL; + char * buildRootURL; /* * Note: rpmGenPath should guarantee a "canonical" path. That means @@ -510,7 +510,7 @@ static int handlePreambleTag(rpmSpec spec, Package pkg, rpm_tag_t tag, * //usr//bin/ * /.././../usr/../bin//./sh */ - if (buildRootURL == NULL) { + if (spec->buildRootURL == NULL) { buildRootURL = rpmGenPath(NULL, "%{?buildroot:%{buildroot}}", NULL); if (strcmp(buildRootURL, "/")) { spec->buildRootURL = buildRootURL; diff --git a/build/parsePrep.c b/build/parsePrep.c index 5306ec9..c511426 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -353,7 +353,7 @@ static int doSetupMacro(rpmSpec spec, char *line) argv = _free(argv); /* cd to the build dir */ - { const char * buildDirURL = rpmGenPath(spec->rootURL, "%{_builddir}", ""); + { char * buildDirURL = rpmGenPath(spec->rootURL, "%{_builddir}", ""); const char *buildDir; (void) urlPath(buildDirURL, &buildDir); diff --git a/lib/psm.c b/lib/psm.c index ea797d5..18ecad0 100644 --- a/lib/psm.c +++ b/lib/psm.c @@ -211,8 +211,8 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, { int scareMem = 1; rpmfi fi = NULL; - const char * _sourcedir = NULL; - const char * _specdir = NULL; + char * _sourcedir = NULL; + char * _specdir = NULL; const char * specFile = NULL; HGE_t hge; HFD_t hfd; diff --git a/lib/rpminstall.c b/lib/rpminstall.c index 04761f3..76d0c6c 100644 --- a/lib/rpminstall.c +++ b/lib/rpminstall.c @@ -362,7 +362,7 @@ if (fileURL[0] == '=') { case URL_IS_HTTPS: case URL_IS_HTTP: case URL_IS_FTP: - { const char *tfn; + { char *tfn; if (rpmIsVerbose()) fprintf(stdout, _("Retrieving %s\n"), fileURL); diff --git a/lib/rpmlock.c b/lib/rpmlock.c index 83664d6..808f496 100644 --- a/lib/rpmlock.c +++ b/lib/rpmlock.c @@ -34,7 +34,7 @@ static rpmlock rpmlock_new(const char *rootdir) /* XXX oneshot to determine path for fcntl lock. */ if (rpmlock_path == NULL) { - const char * t = rpmGenPath(rootdir, rpmlock_path_default, NULL); + char * t = rpmGenPath(rootdir, rpmlock_path_default, NULL); if (t == NULL || *t == '\0' || *t == '%') t = strdup(RPMLOCK_PATH); rpmlock_path = xstrdup(t); diff --git a/rpmdb/db3.c b/rpmdb/db3.c index b741e62..085bd28 100644 --- a/rpmdb/db3.c +++ b/rpmdb/db3.c @@ -319,7 +319,7 @@ static int db_init(dbiIndex dbi, const char * dbhome, } if (dbi->dbi_tmpdir) { const char * root; - const char * tmpdir; + char * tmpdir; root = (dbi->dbi_root ? dbi->dbi_root : rpmdb->db_root); if ((root[0] == '/' && root[1] == '\0') || rpmdb->db_chrootDone) @@ -633,7 +633,7 @@ assert(db != NULL); static int db3close(dbiIndex dbi, unsigned int flags) { rpmdb rpmdb = dbi->dbi_rpmdb; - const char * urlfn = NULL; + char * urlfn = NULL; const char * root; const char * home; const char * dbhome; @@ -715,7 +715,7 @@ static int db3close(dbiIndex dbi, unsigned int flags) (dbi->dbi_verbose & DB_VERB_WAITSFOR)); if (dbi->dbi_tmpdir) { - const char * tmpdir = rpmGenPath(root, dbi->dbi_tmpdir, NULL); + char * tmpdir = rpmGenPath(root, dbi->dbi_tmpdir, NULL); rc = dbenv->set_tmp_dir(dbenv, tmpdir); rc = cvtdberr(dbi, "dbenv->set_tmp_dir", rc, _debug); tmpdir = _free(tmpdir); @@ -765,7 +765,7 @@ exit: static int db3open(rpmdb rpmdb, rpm_tag_t rpmtag, dbiIndex * dbip) { extern struct _dbiVec db3vec; - const char * urlfn = NULL; + char * urlfn = NULL; const char * root; const char * home; const char * dbhome; diff --git a/rpmdb/sqlite.c b/rpmdb/sqlite.c index 5e52ae0..f7cf853 100644 --- a/rpmdb/sqlite.c +++ b/rpmdb/sqlite.c @@ -770,12 +770,12 @@ static int sql_open(rpmdb rpmdb, rpm_tag_t rpmtag, dbiIndex * dbip) { extern struct _dbiVec sqlitevec; - const char * urlfn = NULL; + char * urlfn = NULL; const char * root; const char * home; const char * dbhome; const char * dbfile; - const char * dbfname; + char * dbfname; const char * sql_errcode; dbiIndex dbi; SQL_DB * sqldb; diff --git a/rpmio/rpmfileutil.c b/rpmio/rpmfileutil.c index 3722809..9e33852 100644 --- a/rpmio/rpmfileutil.c +++ b/rpmio/rpmfileutil.c @@ -223,7 +223,7 @@ exit: int rpmMkTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr) { const char * tpmacro = "%{?_tmppath:%{_tmppath}}%{!?_tmppath:" LOCALSTATEDIR "/tmp}"; - const char * tempfn = NULL; + char * tempfn = NULL; const char * tfn = NULL; static int _initialized = 0; int temput; diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index 17b8d9e..66aa6a8 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -739,7 +739,7 @@ static FD_t urlOpen(const char * url, int flags, mode_t mode) urlhelper = rpmExpand("%{?_urlhelper}", NULL); - dest = (char *) rpmGenPath(NULL, "%{_tmppath}/", "rpm-transfer.XXXXXX"); + dest = rpmGenPath(NULL, "%{_tmppath}/", "rpm-transfer.XXXXXX"); close(mkstemp(dest)); sprintf(cmd, "%s %s %s\n", urlhelper, dest, url); urlhelper = _free(urlhelper); -- 2.7.4