diff options
author | 2008-06-05 18:52:06 +0000 | |
---|---|---|
committer | 2008-06-05 18:52:06 +0000 | |
commit | e66448a1ac0bb08843a2e1ad9afc218ec446173e (patch) | |
tree | f60f9290981a7c17bb3b2b1e084e5de9f028d036 | |
parent | Include some toplevel documentation. (diff) | |
download | rbot-gentoo-e66448a1ac0bb08843a2e1ad9afc218ec446173e.tar.gz rbot-gentoo-e66448a1ac0bb08843a2e1ad9afc218ec446173e.tar.bz2 rbot-gentoo-e66448a1ac0bb08843a2e1ad9afc218ec446173e.zip |
Implement earch.
-rw-r--r-- | gentoo-data.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gentoo-data.rb b/gentoo-data.rb index 3f1f797..6e44d0c 100644 --- a/gentoo-data.rb +++ b/gentoo-data.rb @@ -127,7 +127,16 @@ class GentooPlugin < Plugin end def earch(m, params) - m.reply 'TODO' + f = IO.popen("/usr/bin/python #{scriptdir}/earch -c '#{params[:pkg]}'") + output = f.readlines + if output[0] =~ /^!!!/ + m.reply "#{response_prefix(m)}Unable to find package #{params[:pkg]}" + return + end + pn = params[:pkg].split('/')[-1] + cp = output[0].split("/#{pn}-")[0]+'/'+pn + output.map!{ |l| l.gsub(/^#{cp}-/,'').chomp } + m.reply "#{response_prefix(m)}#{cp} #{output.join(' ')}" end end |