[Slackbuilds-users] sbopkg search tags
Alan Hicks
alan at lizella.net
Sat Jan 31 02:55:15 UTC 2009
On Fri, 30 Jan 2009 11:06:10 +0100
Aleksandar Samardzic <asamardzic at matf.bg.ac.yu> wrote:
> On the other side: wouldn't be possible (if not already implemented)
> for sbopkg to employ grep, or something alike to search through
> README/slack-desc files?
That should be doable, but I don't think it's a good idea. For
starters, I don't see it getting used too much; the slack-desc file is
just unlikely to have exactly what you're looking for. False-positives
and false-negatives would (I imagine) be pretty high. The code to do
it isn't too complex though.
# WARNING: The following code is completely untested and subject to
#result in death or dismemberment
echo -n "Enter search terms in regular
expression: "
readline GREP_REGEX
find . -type f -name "slack-desc" | (while read SD; do
APP=$(dirname "$SD" | cut -d '/' -f 2)
if grep "$GREP_REGEX" "$SD" >/dev/null 2>&1; then
# APP contains the regex
echo "$APP matches"
fi
done)
Of course, you'd want to eliminate the comments that often are at the
top of the slack-desc file, and it would be nice to concatenate all the
valid lines of the slack-desc file together without the annoying
PRGNAME: prepend to each of them. Oh yeah, you'd want to filter out
the handy ruler for perfection. In short, the slack-desc file just
doesn't lend itself well to these kind of searches, not least of all
because it might not include the same kind of information the package
tags contain.
--
It is better to hear the rebuke of the wise,
Than for a man to hear the song of fools.
Ecclesiastes 7:5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20090130/3dea7d03/attachment-0001.asc>
More information about the SlackBuilds-users
mailing list