From: Panu Matilainen Date: Thu, 18 Feb 2010 10:44:05 +0000 (+0200) Subject: Classify .desktop files by just path X-Git-Tag: tznext/4.11.0.1.tizen20130304~2297 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6534fa920521ac954cc4f23b4b7981dfc27d5f3;p=tools%2Flibrpm-tizen.git Classify .desktop files by just path - Previously we required a file to be classified as text and have .desktop suffix, for now replace that with just a regex. We'll eventually want/need some extra qualifying logic to handle cases like these, eg "only apply path attributes if condition X is also true" --- diff --git a/build/rpmfc.c b/build/rpmfc.c index cf9ef29..9e248ab 100644 --- a/build/rpmfc.c +++ b/build/rpmfc.c @@ -539,6 +539,8 @@ static struct rpmfcPathTbl_s rpmfcPathTable[] = { "python" }, { "^%{_bindir}/python[[:digit:]]\\.[[:digit:]]$", "python" }, + { "^%{_datadir}/.*/.*\\.desktop$", + "desktop" }, { NULL, NULL }, }; @@ -800,7 +802,7 @@ static int rpmfcMISC(rpmfc fc) if (hasAttr(fattrs, "font")) { what = "font"; - } else if (hasAttr(fattrs, "text") && rpmFileHasSuffix(fn, ".desktop")) { + } else if (hasAttr(fattrs, "desktop")) { what = "desktop"; } @@ -823,7 +825,7 @@ static const struct rpmfcApplyTbl_s const rpmfcApplyTable[] = { { rpmfcELF, "elf" }, { rpmfcSCRIPT, "script" }, { rpmfcLANG, "perl,python,mono,ocaml,pkgconfig,libtool" }, - { rpmfcMISC, "font,text" }, + { rpmfcMISC, "font,desktop" }, { NULL, 0 } };