RPM 4 code structure does not allow to map these macros so easily as done here in RPM 5,
so mapping new macros from RPM 4 to the old ones in RPM 5
Read comments in code about how it works!
... | ... | --- a/lib/rpmfc.c |
... | ... | +++ b/lib/rpmfc.c |
... | ... | @@ -1208,6 +1208,53 @@ rpmRC rpmfcApply(rpmfc fc) |
1208 | 1208 |
fc->Rnmire);
|
1209 | 1209 |
}
|
1210 | 1210 |
|
1211 |
/* Forward compatibility with rpm4
|
|
1212 |
* https://docs.fedoraproject.org/en-US/packaging-guidelines/AutoProvidesAndRequiresFiltering/
|
|
1213 |
* Mapping rpm4 macros to rpm5 ones (rpm4 -> rpm5):
|
|
1214 |
* %__requires_exclude -> %__noautoreq
|
|
1215 |
* %__provides_exclude -> %__noautoprov
|
|
1216 |
* %__requires_exclude_from -> %__noautoreqfiles
|
|
1217 |
* %__provides_exclude_from -> %__noautoprovfiles
|
|
1218 |
* If rpm5 macro was defined, a mappable to it rpm4 macro will not be processed,
|
|
1219 |
* e.g. if both %__noautoreq and %__requires_exclude are defined,
|
|
1220 |
* only %__noautoreq will be processed. This allows to make separate definitions
|
|
1221 |
* for rpm4 and rpm5 in one spec, RPM 4 will simply ignore %__noautoreq.
|
|
1222 |
* This also allows to define e.g. only %__requires_exclude which will
|
|
1223 |
* work in both rpm4 and rpm5.
|
|
1224 |
*/
|
|
1225 |
//noautoreq
|
|
1226 |
if (fc->Rnmire <= 0) {
|
|
1227 |
fc->Rmires = rpmfcExpandRegexps("%{?__requires_exclude}", &fc->Rnmire);
|
|
1228 |
if (fc->Rnmire > 0) {
|
|
1229 |
rpmlog(RPMLOG_DEBUG, D_("added %d %%__requires_exclude patterns.\n"),
|
|
1230 |
fc->Rnmire);
|
|
1231 |
}
|
|
1232 |
}
|
|
1233 |
//noautoprov
|
|
1234 |
if (fc->Pnmire <= 0) {
|
|
1235 |
fc->Pmires = rpmfcExpandRegexps("%{?__provides_exclude}", &fc->Pnmire);
|
|
1236 |
if (fc->Pnmire > 0) {
|
|
1237 |
rpmlog(RPMLOG_DEBUG, D_("added %d %%__provides_exclude patterns.\n"),
|
|
1238 |
fc->Pnmire);
|
|
1239 |
}
|
|
1240 |
}
|
|
1241 |
//noautoreqfiles
|
|
1242 |
if (fc->RFnmire <= 0) {
|
|
1243 |
fc->RFmires = rpmfcExpandRegexps("%{?__requires_exclude_from}", &fc->RFnmire);
|
|
1244 |
if (fc->RFnmire > 0) {
|
|
1245 |
rpmlog(RPMLOG_DEBUG, D_("added %d %%__requires_exclude_from patterns.\n"),
|
|
1246 |
fc->RFnmire);
|
|
1247 |
}
|
|
1248 |
}
|
|
1249 |
//noautoprovfiles
|
|
1250 |
if (fc->PFnmire <= 0) {
|
|
1251 |
fc->PFmires = rpmfcExpandRegexps("%{?__provides_exclude_from}", &fc->PFnmire);
|
|
1252 |
if (fc->PFnmire > 0) {
|
|
1253 |
rpmlog(RPMLOG_DEBUG, D_("added %d %%__provides_exclude_from patterns.\n"),
|
|
1254 |
fc->PFnmire);
|
|
1255 |
}
|
|
1256 |
}
|
|
1257 |
|
|
1211 | 1258 |
/* Make sure something didn't go wrong previously! */
|
1212 | 1259 |
assert(fc->fn != NULL);
|
1213 | 1260 |
/* Generate package and per-file dependencies. */
|
New comment