Remove bogus const from rpmGenPath() temporary targets

This commit is contained in:
Panu Matilainen 2007-12-15 11:03:46 +02:00
parent b6a663ec0a
commit 1a0a12cf15
12 changed files with 24 additions and 23 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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);