From b8d876fc8e8ce96edef842257998d0570566205e Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Mon, 20 Feb 2012 01:40:02 +0000 Subject: Handle output that does not contain any herds. --- gentoo-data.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gentoo-data.rb b/gentoo-data.rb index f4e10d1..e1b8800 100644 --- a/gentoo-data.rb +++ b/gentoo-data.rb @@ -82,7 +82,10 @@ class GentooPlugin < Plugin output = f.readlines f.close m.reply "#{output}" - herds = output[0].gsub(/^.* Herd: ([^ ]+) .*$/, '\1').strip.split(/[, ]+/).map { |s| s.strip }.flatten + herds = [] + output[0].gsub!(/(Maintainer:|Description:).*/,'') + mre = /Herd: +([-[:alnum:], ]+) .*/.match(output[0]) + herds = mre[1].strip.split(/[, ]+/).map { |s| s.strip }.flatten if mre and mre[1] herds.each { |h| debug("meta -v calling herd for #{h}") p = params.clone -- cgit v1.2.3-65-gdbad