diff options
author | Thilo Bangert <bangert@gentoo.org> | 2009-12-07 14:10:00 +0000 |
---|---|---|
committer | Thilo Bangert <bangert@gentoo.org> | 2009-12-07 14:10:00 +0000 |
commit | 09bf30e848b4425ee53480cf4ebfd1d05f95ca57 (patch) | |
tree | 7e9eebcf5171f0e0cabbc7c68200e518fc5cd861 | |
parent | remove dracut - its now in portage (diff) | |
download | bangert-09bf30e848b4425ee53480cf4ebfd1d05f95ca57.tar.gz bangert-09bf30e848b4425ee53480cf4ebfd1d05f95ca57.tar.bz2 bangert-09bf30e848b4425ee53480cf4ebfd1d05f95ca57.zip |
beginnings of project metadata checker
svn path=/; revision=95
-rwxr-xr-x | scripts/check-metadata.rb | 5 | ||||
-rwxr-xr-x | scripts/project-checker.rb | 61 |
2 files changed, 65 insertions, 1 deletions
diff --git a/scripts/check-metadata.rb b/scripts/check-metadata.rb index 27064fd..6283c87 100755 --- a/scripts/check-metadata.rb +++ b/scripts/check-metadata.rb @@ -1,5 +1,8 @@ #!/usr/bin/ruby +#TODO +# - multiple maintainer tags in metadata.xml + require "rexml/document" PORTAGE_DIR="/usr/portage/" @@ -56,7 +59,7 @@ ct_ldesc_lang = 0 categories.map{ |x| -# puts "Category: #{x}" + puts "Category: #{x}" `ls -1 #{PORTAGE_DIR}/#{x}`.split().map{ |package| if package != "CVS" && package != "metadata.xml" diff --git a/scripts/project-checker.rb b/scripts/project-checker.rb new file mode 100755 index 0000000..169af73 --- /dev/null +++ b/scripts/project-checker.rb @@ -0,0 +1,61 @@ +#!/usr/bin/ruby +# +# +# + + +require "rexml/document" + +userxml = REXML::Document.new File.new( "/home/bangert/gentoo/gentoo/xml/htdocs/proj/en/devrel/roll-call/userinfo.xml" ) +developers = Hash::new(false) +userxml.elements.each("userlist/user") { |e| + dev = e.attributes["username"].strip.downcase + if e.elements["status"] && e.elements["status"].text == "retired" + developers[dev] = false + else + developers[dev] = true + end +} + +# takes a REXML::Document and checks project/dev elements against second +# argument hash +# +class ProjectChecker + def self.checkDevs rexml, developers, prefix + rexml.elements.each("project/dev") { |dev| + developer = dev.text.strip.downcase + if !developers.has_key?(developer) + puts prefix + ": unknown developer: #{developer}" + elsif !developers[developer] + puts prefix + ": retired devloper: #{developer}" + end + } + end + + def self.recursiveFullCheck developers + self.recursiveFullCheckWorker "/home/bangert/gentoo/gentoo/xml/htdocs/proj/en/metastructure/gentoo.xml" ,developers + end + + def self.recursiveFullCheckWorker xmlfile, developers + projectxml = REXML::Document.new File.new( xmlfile ) + name = projectxml.elements["project/name"].text + + ProjectChecker.checkDevs(projectxml, developers, name) + projectxml.elements.each("project/subproject") { |project| + projectfile = "/home/bangert/gentoo/gentoo/xml/htdocs" + project.attribute("ref").to_s + if (File.exists? projectfile) + self.recursiveFullCheckWorker projectfile, developers + else + #puts "ERROR: File not found: " + projectfile + puts "Project \"#{name}\" does not habe this subproject reference: " + project.attribute("ref").to_s + end + } + end + + +end + +ProjectChecker.recursiveFullCheck developers + + + |