From aedbf1d63f94cee312b283503c8deb1ede1895a1 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 27 Jun 2011 12:41:39 +0300 Subject: [PATCH] Remove ugly isDir recurse prevention hack on build - We know if we're already fts-walking by the way addFile() gets called, dont corrupt fl->isDir for no good reason. --- build/files.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/build/files.c b/build/files.c index beddc52..f679b93 100644 --- a/build/files.c +++ b/build/files.c @@ -1391,8 +1391,8 @@ static rpmRC addFile(FileList fl, const char * diskPath, } } - if ((! fl->isDir) && S_ISDIR(statp->st_mode)) { -/* FIX: fl->buildRoot may be NULL */ + /* Don't recurse into explicit %dir, don't double-recurse from fts */ + if ((fl->isDir != 1) && (statp == &statbuf) && S_ISDIR(statp->st_mode)) { return recurseDir(fl, diskPath); } @@ -1498,8 +1498,6 @@ static rpmRC recurseDir(FileList fl, const char * diskPath) int myFtsOpts = (FTS_COMFOLLOW | FTS_NOCHDIR | FTS_PHYSICAL); rpmRC rc = RPMRC_FAIL; - fl->isDir = 1; /* Keep it from following myftw() again */ - ftsSet[0] = (char *) diskPath; ftsSet[1] = NULL; ftsp = Fts_open(ftsSet, myFtsOpts, NULL); @@ -1532,8 +1530,6 @@ static rpmRC recurseDir(FileList fl, const char * diskPath) } (void) Fts_close(ftsp); - fl->isDir = 0; - return rc; } -- 2.7.4