diff options
author | Michael Schroeder <mls@suse.de> | 2011-05-19 14:55:55 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2011-05-19 14:57:30 +0300 |
commit | f17e10f870aa9f2bf6b9e2408088dfd6b2372644 (patch) | |
tree | 245d3ffcbe691c9f27fd968b4185bda1c3c25e97 | |
parent | e0213a13dff02f54e071d22b07356ee459bf1a27 (diff) | |
download | librpm-tizen-f17e10f870aa9f2bf6b9e2408088dfd6b2372644.tar.gz librpm-tizen-f17e10f870aa9f2bf6b9e2408088dfd6b2372644.tar.bz2 librpm-tizen-f17e10f870aa9f2bf6b9e2408088dfd6b2372644.zip |
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>
-rw-r--r-- | build/rpmfc.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/build/rpmfc.c b/build/rpmfc.c index fe8a25489..cea2f82d5 100644 --- a/build/rpmfc.c +++ b/build/rpmfc.c @@ -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); + } } } |