summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-10-21 12:23:50 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-10-21 12:23:50 +0300
commit9fbaedd1ac655d978883d68a1f7d34df0d703363 (patch)
tree630ed16777180e905d0bdfa8cea8027d150b5225
parentb6cfb4399ca4c5f2335c9351a7599ccfdf28add6 (diff)
downloadlibrpm-tizen-9fbaedd1ac655d978883d68a1f7d34df0d703363.tar.gz
librpm-tizen-9fbaedd1ac655d978883d68a1f7d34df0d703363.tar.bz2
librpm-tizen-9fbaedd1ac655d978883d68a1f7d34df0d703363.zip
Ensure rpmlib() dependency sanity on build
- only requires on rpmlib(foo) are allowed - make sure any rpmlib() foo dependencies have RPMSENSE_RPMLIB bit set, rpmdeps as external dependency generator can create rpmlib() dependencies without the bit set, and also any manual rpmlib() deps wont have it
-rw-r--r--build/reqprov.c6
-rw-r--r--build/rpmbuild.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/build/reqprov.c b/build/reqprov.c
index a57c6ae6d..9c48b11c3 100644
--- a/build/reqprov.c
+++ b/build/reqprov.c
@@ -82,6 +82,12 @@ int addReqProv(rpmSpec spec, Header h, rpmTag tagN,
extra = Flags & _ALL_REQUIRES_MASK;
}
+ /* rpmlib() dependency sanity: only requires permitted, ensure sense bit */
+ if (rstreqn(N, "rpmlib(", sizeof("rpmlib(")-1)) {
+ if (nametag != RPMTAG_REQUIRENAME) return 1;
+ extra |= RPMSENSE_RPMLIB;
+ }
+
Flags = (Flags & RPMSENSE_SENSEMASK) | extra;
if (EVR == NULL)
diff --git a/build/rpmbuild.h b/build/rpmbuild.h
index 6b3d765d8..c7d0da357 100644
--- a/build/rpmbuild.h
+++ b/build/rpmbuild.h
@@ -343,7 +343,7 @@ Package freePackage(Package pkg);
* @param EVR (e.g. Requires: foo < 0:1.2-3, "0:1.2-3")
* @param Flags (e.g. Requires: foo < 0:1.2-3, both "Requires:" and "<")
* @param index (0 always)
- * @return 0 always
+ * @return 0 on success, 1 on error
*/
int addReqProv(rpmSpec spec, Header h, rpmTag tagN,
const char * N, const char * EVR, rpmsenseFlags Flags,