From: Panu Matilainen Date: Mon, 1 Mar 2010 13:52:46 +0000 (+0200) Subject: Lose ancient prefix remnants from build code X-Git-Tag: tznext/4.11.0.1.tizen20130304~2258 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d46f752c399730e3c75ecc6786c2599b8922031b;p=tools%2Flibrpm-tizen.git Lose ancient prefix remnants from build code - since commit 840599e3d92e29e8e1c1cf7ecf4ad5c37d3bf021 in 1998, nothing has set RPMTAG_DEFAULTPREFIX meaning fl.prefix is always NULL... --- diff --git a/build/files.c b/build/files.c index be2bc27..fb26b5f 100644 --- a/build/files.c +++ b/build/files.c @@ -96,7 +96,6 @@ static StringBuf check_fileList = NULL; */ typedef struct FileList_s { char * buildRoot; - char * prefix; int fileCount; int processingFailed; @@ -1082,8 +1081,6 @@ static void genCpioListAndHeader(FileList fl, /* Generate the header. */ if (! isSrc) { skipLen = 1; - if (fl->prefix) - skipLen += strlen(fl->prefix); } for (i = 0, flp = fl->fileList; i < fl->fileListRecsUsed; i++, flp++) { @@ -1369,22 +1366,6 @@ static rpmRC addFile(FileList fl, const char * diskPath, if (*cpioPath == '\0') cpioPath = "/"; - /* If we are using a prefix, validate the file */ - if (!fl->inFtw && fl->prefix) { - const char *prefixPtr = fl->prefix; - - while (*prefixPtr && *cpioPath && (*cpioPath == *prefixPtr)) { - prefixPtr++; - cpioPath++; - } - if (*prefixPtr || (*cpioPath && *cpioPath != '/')) { - rpmlog(RPMLOG_ERR, _("File doesn't match prefix (%s): %s\n"), - fl->prefix, cpioPath); - fl->processingFailed = 1; - return RPMRC_FAIL; - } - } - if (statp == NULL) { time_t now = time(NULL); statp = &statbuf; @@ -1790,8 +1771,6 @@ static rpmRC processPackageFiles(rpmSpec spec, Package pkg, /* XXX spec->buildRoot == NULL, then xstrdup("") is returned */ fl.buildRoot = rpmGenPath(spec->rootDir, spec->buildRoot, NULL); - fl.prefix = headerGetAsString(pkg->header, RPMTAG_DEFAULTPREFIX); - fl.fileCount = 0; fl.processingFailed = 0; @@ -1958,7 +1937,6 @@ static rpmRC processPackageFiles(rpmSpec spec, Package pkg, exit: fl.buildRoot = _free(fl.buildRoot); - fl.prefix = _free(fl.prefix); freeAttrRec(&fl.cur_ar); freeAttrRec(&fl.def_ar); @@ -2111,7 +2089,6 @@ int processSourceFiles(rpmSpec spec) fl.fileList = xcalloc((spec->numSources + 1), sizeof(*fl.fileList)); fl.processingFailed = 0; fl.fileListRecsUsed = 0; - fl.prefix = NULL; fl.buildRoot = NULL; s = getStringBuf(sourceFiles);