Igor Gnatenko 53960f
From 90007b550cf585c9cb9427e1fd0b2d8f56c9c2b5 Mon Sep 17 00:00:00 2001
Igor Gnatenko 53960f
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Igor Gnatenko 53960f
Date: Fri, 28 Jul 2017 14:33:29 +0200
Igor Gnatenko 53960f
Subject: [PATCH] store path of excluded files
Igor Gnatenko 53960f
Igor Gnatenko 53960f
We will need this in next commit so we know which files
Igor Gnatenko 53960f
were excluded and we will exclude respective debug files.
Igor Gnatenko 53960f
Igor Gnatenko 53960f
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Igor Gnatenko 53960f
---
Igor Gnatenko 53960f
 build/files.c             | 6 +++++-
Igor Gnatenko 53960f
 build/rpmbuild_internal.h | 1 +
Igor Gnatenko 53960f
 build/spec.c              | 2 ++
Igor Gnatenko 53960f
 3 files changed, 8 insertions(+), 1 deletion(-)
Igor Gnatenko 53960f
Igor Gnatenko 53960f
diff --git a/build/files.c b/build/files.c
Igor Gnatenko 53960f
index 2238c2453..988b3b315 100644
Igor Gnatenko 53960f
--- a/build/files.c
Igor Gnatenko 53960f
+++ b/build/files.c
Igor Gnatenko 53960f
@@ -1060,7 +1060,11 @@ static void genCpioListAndHeader(FileList fl, Package pkg, int isSrc)
Igor Gnatenko 53960f
 	}
Igor Gnatenko 53960f
 
Igor Gnatenko 53960f
 	/* Skip files that were marked with %exclude. */
Igor Gnatenko 53960f
-	if (flp->flags & RPMFILE_EXCLUDE) continue;
Igor Gnatenko 53960f
+	if (flp->flags & RPMFILE_EXCLUDE)
Igor Gnatenko 53960f
+	{
Igor Gnatenko 53960f
+	    argvAdd(&pkg->fileExcludeList, flp->diskPath);
Igor Gnatenko 53960f
+	    continue;
Igor Gnatenko 53960f
+	}
Igor Gnatenko 53960f
 
Igor Gnatenko 53960f
 	/* Collect on-disk paths for archive creation */
Igor Gnatenko 53960f
 	pkg->dpaths[npaths++] = xstrdup(flp->diskPath);
Igor Gnatenko 53960f
diff --git a/build/rpmbuild_internal.h b/build/rpmbuild_internal.h
Igor Gnatenko 53960f
index 1c3332faf..5978a6d32 100644
Igor Gnatenko 53960f
--- a/build/rpmbuild_internal.h
Igor Gnatenko 53960f
+++ b/build/rpmbuild_internal.h
Igor Gnatenko 53960f
@@ -118,6 +118,7 @@ struct Package_s {
Igor Gnatenko 53960f
 
Igor Gnatenko 53960f
     ARGV_t fileFile;
Igor Gnatenko 53960f
     ARGV_t fileList;		/* If NULL, package will not be written */
Igor Gnatenko 53960f
+    ARGV_t fileExcludeList;
Igor Gnatenko 53960f
     ARGV_t removePostfixes;
Igor Gnatenko 53960f
     ARGV_t policyList;
Igor Gnatenko 53960f
 
Igor Gnatenko 53960f
diff --git a/build/spec.c b/build/spec.c
Igor Gnatenko 53960f
index 7cb264abd..c33cde7eb 100644
Igor Gnatenko 53960f
--- a/build/spec.c
Igor Gnatenko 53960f
+++ b/build/spec.c
Igor Gnatenko 53960f
@@ -101,6 +101,7 @@ Package newPackage(const char *name, rpmstrPool pool, Package *pkglist)
Igor Gnatenko 53960f
     p->autoProv = 1;
Igor Gnatenko 53960f
     p->autoReq = 1;
Igor Gnatenko 53960f
     p->fileList = NULL;
Igor Gnatenko 53960f
+    p->fileExcludeList = NULL;
Igor Gnatenko 53960f
     p->fileFile = NULL;
Igor Gnatenko 53960f
     p->policyList = NULL;
Igor Gnatenko 53960f
     p->pool = rpmstrPoolLink(pool);
Igor Gnatenko 53960f
@@ -143,6 +144,7 @@ static Package freePackage(Package pkg)
Igor Gnatenko 53960f
     }
Igor Gnatenko 53960f
 
Igor Gnatenko 53960f
     pkg->fileList = argvFree(pkg->fileList);
Igor Gnatenko 53960f
+    pkg->fileExcludeList = argvFree(pkg->fileExcludeList);
Igor Gnatenko 53960f
     pkg->fileFile = argvFree(pkg->fileFile);
Igor Gnatenko 53960f
     pkg->policyList = argvFree(pkg->policyList);
Igor Gnatenko 53960f
     pkg->removePostfixes = argvFree(pkg->removePostfixes);