From: Martin Vidner Date: Wed, 13 Sep 2006 19:51:22 +0000 (+0000) Subject: Use RPM_ENHANCESNAME only if detected at configure time. X-Git-Tag: BASE-SuSE-SLE-10-SP2-Branch~377 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8753a010a05dce2ab76aedcaafca95a266b931a;p=platform%2Fupstream%2Flibzypp.git Use RPM_ENHANCESNAME only if detected at configure time. (allows compilation with older rpm) --- diff --git a/configure.ac b/configure.ac index 885606c..c0a0501 100644 --- a/configure.ac +++ b/configure.ac @@ -195,6 +195,17 @@ AM_GNU_GETTEXT dnl ================================================== dnl checks for typedefs + +AH_TEMPLATE([HAVE_RPM_ENHANCES], [the new enhances dependency]) +AC_MSG_CHECKING([for librpm features]) +hre=no +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([#include "librpm.h"], + [int i = RPMTAG_ENHANCESNAME;])], + [AC_DEFINE([HAVE_RPM_ENHANCES]) hre=yes] +) +AC_MSG_RESULT([$hre]) + dnl ================================================== dnl checks for structures dnl ================================================== diff --git a/zypp/target/rpm/RpmHeader.cc b/zypp/target/rpm/RpmHeader.cc index 313064c..853df27 100644 --- a/zypp/target/rpm/RpmHeader.cc +++ b/zypp/target/rpm/RpmHeader.cc @@ -291,10 +291,12 @@ namespace zypp { kindFlags = RPMTAG_CONFLICTFLAGS; kindVersion = RPMTAG_CONFLICTVERSION; break; +#ifdef HAVE_RPM_ENHANCES case RPMTAG_ENHANCESNAME: kindFlags = RPMTAG_ENHANCESFLAGS; kindVersion = RPMTAG_ENHANCESVERSION; break; +#endif #warning NEEDS RPMTAG_SUPPLEMENTSNAME #if 0 case RPMTAG_SUPPLEMENTSNAME: @@ -452,7 +454,11 @@ namespace zypp { // CapSet RpmHeader::tag_enhances( set * freq_r ) const { +#ifdef HAVE_RPM_ENHANCES return PkgRelList_val( RPMTAG_ENHANCESNAME, false, freq_r ); +#else + return CapSet(); +#endif } ///////////////////////////////////////////////////////////////////