Support "magic_and_path" flag in fileattrs

- Allow "magic_and_path" flag to configure that files must
  match both regexpes to be sent to the dependency generator.

Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
This commit is contained in:
Michael Schroeder 2011-05-19 14:55:55 +03:00 committed by Panu Matilainen
parent e0213a13df
commit f17e10f870
1 changed files with 7 additions and 4 deletions

View File

@ -629,10 +629,13 @@ static void rpmfcAttributes(rpmfc fc, const char *ftype, const char *fullpath)
continue;
/* Add attributes on libmagic type & path pattern matches */
if (regMatch((*attr)->magic, ftype))
argvAddTokens(&fc->fattrs[fc->ix], (*attr)->name);
if (regMatch((*attr)->path, path))
argvAddTokens(&fc->fattrs[fc->ix], (*attr)->name);
if ((*attr)->magic && (*attr)->path && hasAttr((*attr)->flags, "magic_and_path")) {
if (regMatch((*attr)->magic, ftype) && regMatch((*attr)->path, path))
argvAddTokens(&fc->fattrs[fc->ix], (*attr)->name);
} else {
if (regMatch((*attr)->magic, ftype) || regMatch((*attr)->path, path))
argvAddTokens(&fc->fattrs[fc->ix], (*attr)->name);
}
}
}