static int initAttrs(rpmfc fc)
{
ARGV_t files = NULL;
- char * attrPath = rpmExpand("%{_fileattrsdir}/*", NULL);
+ char * attrPath = rpmExpand("%{_fileattrsdir}/*.attr", NULL);
int nattrs = 0;
/* Discover known attributes from pathnames + initialize them */
nattrs = argvCount(files);
fc->atypes = xcalloc(nattrs + 1, sizeof(*fc->atypes));
for (int i = 0; i < nattrs; i++) {
- fc->atypes[i] = rpmfcAttrNew(basename(files[i]));
+ char *bn = basename(files[i]);
+ bn[strlen(bn)-strlen(".attr")] = '\0';
+ fc->atypes[i] = rpmfcAttrNew(bn);
}
fc->atypes[nattrs] = NULL;
argvFree(files);
fattrsdir = $(rpmconfigdir)/fileattrs
fattrs_DATA = \
- desktop elf font libtool perl perllib pkgconfig python \
- ocaml script
+ desktop.attr elf.attr font.attr libtool.attr perl.attr perllib.attr \
+ pkgconfig.attr python.attr ocaml.attr script.attr
EXTRA_DIST = $(fattrs_DATA)
if (!macrofiles) {
macrofiles = rstrscat(NULL, confdir, "/macros", ":",
confdir, "/platform/%{_target}/macros", ":",
- confdir, "/fileattrs/*", ":",
+ confdir, "/fileattrs/*.attr", ":",
confdir, "/" RPMCANONVENDOR "/macros", ":",
SYSCONFDIR "/rpm/macros.*", ":",
SYSCONFDIR "/rpm/macros", ":",