[Rpm-maint] [PATCH 03/12] Remove existing %policy directive

Steve Lawrence slawrence at tresys.com
Thu Oct 22 18:25:40 UTC 2009


Remove existing %policy directive, to be replaced with a new %policy
section with more configurable options
---
 build/files.c |   14 ++------------
 lib/rpmfi.h   |    1 -
 2 files changed, 2 insertions(+), 13 deletions(-)

diff --git a/build/files.c b/build/files.c
index 061494d..c60b670 100644
--- a/build/files.c
+++ b/build/files.c
@@ -841,7 +841,6 @@ static VFA_t virtualFileAttributes[] = {
 	{ "%readme",	0,	RPMFILE_README },
 	{ "%license",	0,	RPMFILE_LICENSE },
 	{ "%pubkey",	0,	RPMFILE_PUBKEY },
-	{ "%policy",	0,	RPMFILE_POLICY },
 	{ NULL, 0, 0 }
 };
 
@@ -909,7 +908,7 @@ static rpmRC parseForSimple(rpmSpec spec, Package pkg, char * buf,
 	    if (fl->currentFlags & RPMFILE_DOC) {
 		rstrscat(&specialDocBuf, " ", s, NULL);
 	    } else
-	    if (fl->currentFlags & (RPMFILE_POLICY|RPMFILE_PUBKEY))
+	    if (fl->currentFlags & RPMFILE_PUBKEY)
 	    {
 		*fileName = s;
 	    } else {
@@ -1588,7 +1587,7 @@ static rpmRC recurseDir(FileList fl, const char * diskPath)
 }
 
 /**
- * Add a pubkey/policy/icon to a binary package.
+ * Add a pubkey/icon to a binary package.
  * @param pkg
  * @param fl		package file tree walk data
  * @param fileName	path to file, relative is builddir, absolute buildroot.
@@ -1631,13 +1630,6 @@ static rpmRC processMetadataFile(Package pkg, FileList fl,
 	apkt = pgpArmorWrap(PGPARMOR_PUBKEY, pkt, pktlen);
 	break;
     }
-    case RPMTAG_POLICIES:
-	if ((xx = rpmioSlurp(fn, &pkt, &pktlen)) != 0 || pkt == NULL) {
-	    rpmlog(RPMLOG_ERR, _("%s: policy file read failed.\n"), fn);
-	    goto exit;
-	}
-	apkt = b64encode(pkt, pktlen, -1);
-	break;
     }
 
     if (!apkt) {
@@ -1893,8 +1885,6 @@ static rpmRC processPackageFiles(rpmSpec spec, Package pkg,
 	    dupAttrRec(&fl.cur_ar, specialDocAttrRec);
 	} else if (fl.currentFlags & RPMFILE_PUBKEY) {
 	    (void) processMetadataFile(pkg, &fl, fileName, RPMTAG_PUBKEYS);
-	} else if (fl.currentFlags & RPMFILE_POLICY) {
-	    (void) processMetadataFile(pkg, &fl, fileName, RPMTAG_POLICIES);
 	} else {
 	    (void) processBinaryFile(pkg, &fl, fileName);
 	}
diff --git a/lib/rpmfi.h b/lib/rpmfi.h
index b33efbf..78a519f 100644
--- a/lib/rpmfi.h
+++ b/lib/rpmfi.h
@@ -62,7 +62,6 @@ typedef	enum rpmfileAttrs_e {
     RPMFILE_EXCLUDE	= (1 <<  9),	/*!< from %%exclude, internal */
     RPMFILE_UNPATCHED	= (1 << 10),	/*!< placeholder (SuSE) */
     RPMFILE_PUBKEY	= (1 << 11),	/*!< from %%pubkey */
-    RPMFILE_POLICY	= (1 << 12)	/*!< from %%policy */
 } rpmfileAttrs;
 
 #define	RPMFILE_ALL	~(RPMFILE_NONE)
-- 
1.6.0.6



More information about the Rpm-maint mailing list