summaryrefslogtreecommitdiff
path: root/build/files.c
diff options
context:
space:
mode:
authorElena Reshetova <elena.reshetova@intel.com>2013-01-04 13:46:32 +0200
committerAnas Nashif <anas.nashif@intel.com>2013-02-02 16:44:44 -0800
commite5571e11ba2a08eda4c0d3917511d36eab9e2777 (patch)
tree6d3d63a8af64dd866415e1997a7e807eb6b49e8d /build/files.c
parent844ffebd91a71bf139b6339d0cf2ea57af70d2ce (diff)
downloadlibrpm-tizen-e5571e11ba2a08eda4c0d3917511d36eab9e2777.tar.gz
librpm-tizen-e5571e11ba2a08eda4c0d3917511d36eab9e2777.tar.bz2
librpm-tizen-e5571e11ba2a08eda4c0d3917511d36eab9e2777.zip
Adding manifest support for rpmbuild
Diffstat (limited to 'build/files.c')
-rw-r--r--build/files.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/build/files.c b/build/files.c
index d12e3248f..63cac8bc3 100644
--- a/build/files.c
+++ b/build/files.c
@@ -826,6 +826,7 @@ static VFA_t const virtualAttrs[] = {
{ "%readme", RPMFILE_README },
{ "%license", RPMFILE_LICENSE },
{ "%pubkey", RPMFILE_PUBKEY },
+ { "%manifest", RPMFILE_SECMANIFEST },
{ NULL, 0 }
};
@@ -840,7 +841,7 @@ static rpmRC parseForSimple(char * buf, FileEntry cur, ARGV_t * fileNames)
{
char *s, *t;
rpmRC res = RPMRC_OK;
- int allow_relative = (RPMFILE_PUBKEY|RPMFILE_DOC|RPMFILE_LICENSE);
+ int allow_relative = (RPMFILE_PUBKEY|RPMFILE_DOC|RPMFILE_LICENSE|RPMFILE_SECMANIFEST);
t = buf;
while ((s = strtokWithQuotes(t, " \t\n")) != NULL) {
@@ -1554,6 +1555,15 @@ static rpmRC processMetadataFile(Package pkg, FileList fl,
apkt = pgpArmorWrap(PGPARMOR_PUBKEY, pkt, pktlen);
break;
}
+ case RPMTAG_SECMANIFEST: {
+ if ((xx = rpmioSlurp(fn, &pkt, &pktlen)) != 0 || pkt == NULL) {
+ rpmlog(RPMLOG_ERR, _("%s: Security manifest file read failed.\n"), fn);
+ goto exit;
+ }
+ apkt = rpmBase64Encode(pkt, pktlen, -1);
+ rpmlog(RPMLOG_INFO, _("Aptk: %s\n"), apkt);
+ break;
+ }
}
if (!apkt) {
@@ -1896,6 +1906,8 @@ static rpmRC processPackageFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
argvAdd(&(fl.docDirs), *fn);
} else if (fl.cur.attrFlags & RPMFILE_PUBKEY) {
(void) processMetadataFile(pkg, &fl, *fn, RPMTAG_PUBKEYS);
+ } else if (fl.cur.attrFlags & RPMFILE_SECMANIFEST) {
+ (void) processMetadataFile(pkg, &fl, *fn, RPMTAG_SECMANIFEST);
} else {
if (fl.cur.attrFlags & RPMFILE_DIR)
fl.cur.isDir = 1;