From 084a00bf51a941ec85c094a436bda401fccf7d3a Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Sun, 23 Oct 2011 13:59:46 +0300 Subject: [PATCH] Warn but don't fail the build on missing excluded files (RhBug:745629) - If a file/directory is not to be packaged, there's not a whole lot point making the build fail if its missing. In case exclude is used to leave certain files to sub-packages, the sub-package file lists will catch out missing files that are really missing as a result of actual build failure or such (except perhaps for some glob cases but missing files can go unnoticed in those cases anyway) --- build/files.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/build/files.c b/build/files.c index 2243e0b..aeceed8 100644 --- a/build/files.c +++ b/build/files.c @@ -1373,10 +1373,15 @@ static rpmRC addFile(FileList fl, const char * diskPath, statp->st_mtime = now; statp->st_ctime = now; } else { + int lvl = RPMLOG_ERR; const char *msg = fl->isDir ? _("Directory not found: %s\n") : _("File not found: %s\n"); - rpmlog(RPMLOG_ERR, msg, diskPath); + if (fl->currentFlags & RPMFILE_EXCLUDE) { + lvl = RPMLOG_WARNING; + rc = RPMRC_OK; + } + rpmlog(lvl, msg, diskPath); goto exit; } } @@ -1670,11 +1675,15 @@ static rpmRC processBinaryFile(Package pkg, FileList fl, const char * fileName) } argvFree(argv); } else { + int lvl = RPMLOG_WARNING; const char *msg = (fl->isDir) ? _("Directory not found by glob: %s\n") : _("File not found by glob: %s\n"); - rpmlog(RPMLOG_ERR, msg, diskPath); - rc = RPMRC_FAIL; + if (!(fl->currentFlags & RPMFILE_EXCLUDE)) { + lvl = RPMLOG_ERR; + rc = RPMRC_FAIL; + } + rpmlog(lvl, msg, diskPath); goto exit; } } else { -- 2.7.4