/[gentoo-alt]/trunk/ruby-checker/categories.rb
Gentoo

Contents of /trunk/ruby-checker/categories.rb

Parent Directory Parent Directory | Revision Log Revision Log


Revision 793 - (show annotations) (download)
Sun Oct 2 13:43:15 2005 UTC (9 years, 2 months ago) by flameeyes
File size: 732 byte(s)
Aded ruby script to run checks on the portage tree.
1 # Simple category lister
2
3 class Category
4 def initialize(name)
5 @name = name
6 end
7
8 def packages
9 list = Array.new
10 Dir.foreach("#{ENV["PORTDIR"]}/#{@name}") do |pkg|
11 fullpkg="#{ENV["PORTDIR"]}/#{@name}/#{pkg}"
12 list << "#{@name}/#{pkg}" if File.directory?(fullpkg) and pkg[0].chr != "." and pkg != "CVS"
13 end
14 return list
15 end
16 end
17
18 class Categories
19 def Categories.List
20 list = Array.new
21 IO.foreach("#{ENV["PORTDIR"]}/profiles/categories") do |line|
22 line =~ /^(.*)\n/
23 cat = $1
24 list << cat unless cat == "virtual"
25 end
26 return list
27 end
28 end
29
30 ## Kate modeline: leave at the end
31 # kate: indent-width 2; replace-trailing-space-save 1; space-indent 1; backspace-indents 1;

  ViewVC Help
Powered by ViewVC 1.1.20