aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2008-07-30 18:34:39 +0000
committerRobin H. Johnson <robbat2@gentoo.org>2008-07-30 18:34:39 +0000
commit6ca3d871b2a4a7d8b82f24ab551413b9d4c46fa8 (patch)
tree14fda68481a973303eae084c03038a9081d4557d /gentoo-data.rb
parentSort the results, use an array since that's better and less hacky :) (diff)
downloadrbot-gentoo-6ca3d871b2a4a7d8b82f24ab551413b9d4c46fa8.tar.gz
rbot-gentoo-6ca3d871b2a4a7d8b82f24ab551413b9d4c46fa8.tar.bz2
rbot-gentoo-6ca3d871b2a4a7d8b82f24ab551413b9d4c46fa8.zip
Add tester for valid packages.
Diffstat (limited to 'gentoo-data.rb')
-rw-r--r--gentoo-data.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/gentoo-data.rb b/gentoo-data.rb
index 36c3b61..de77267 100644
--- a/gentoo-data.rb
+++ b/gentoo-data.rb
@@ -55,6 +55,13 @@ class GentooPlugin < Plugin
f = IO.popen("#{python} #{scriptdir}/metadata.py '#{cp}'")
m.reply "#{f.readlines}"
end
+
+ def validpkg(m, params)
+ icp = params[:pkg]
+ cp = validate_package(m, icp)
+ return if cp.nil?
+ m.reply "#{icp}/#{cp} is valid"
+ end
def meta_verbose(m, params)
cp = params[:pkg]
@@ -305,6 +312,13 @@ plugin.map 'meta :pkg',
:action => 'meta',
:auth_path => 'view'
+plugin.map 'validpkg :pkg',
+ :requirements => {
+ :pkg => REGEX_CP,
+ },
+ :action => 'validpkg',
+ :auth_path => 'view'
+
plugin.map 'changelog :pkg',
:requirements => {
:pkg => REGEX_CP,