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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1590 - (show annotations) (download)
Tue Jan 2 22:06:39 2007 UTC (7 years, 8 months ago) by flameeyes
File size: 3215 byte(s)
Remove old overlays that have moved in overlays.gentoo.org, and old m4s files that are pertinent no more.
1 # First check: scan all last and last-unmasked ebuilds
2 # to check if they use /bin/false in enewuser!
3
4 load "pmask.rb"
5 load "ebuild.rb"
6 load "package.rb"
7 load "categories.rb"
8 load "checks.rb"
9
10 unless ENV["PORTDIR"]
11 procdesc = IO.popen("portageq portdir")
12 ENV["PORTDIR"] = procdesc.readline.chomp
13 procdesc.close
14 end
15
16 File.unlin("logs") unless ! File.exists?("logs") or File.directory?("logs")
17 Dir.mkdir("logs") unless File.exists?("logs")
18
19 # Now load all the checks
20 checks = Array.new
21 checks << Check_regexp.new("logs/enewuser.log", /enewuser.*\/bin\/false/, "enewuser called with /bin/false")
22 checks << Check_regexp.new("logs/rootroot.log", /(chown|fowner).*root[:\.]root/, "chown or fowner called on root:root")
23 #checks << Check_regexp.new("logs/epatchdie.log", /epatch\s.*\|\|\sdie/, "die on failed epatch")
24 #checks << Check_regexp.new("logs/initdconfd.log", /(ins|exe)into\s\/etc\/(init|conf).d/, "Does not use doinitd|doconfd")
25 checks << Check_options.new("logs/cpoptions.log", "cp", ["a", "d"], "GNUish cp -<PARAM> call.")
26 #checks << Check_regexp.new("logs/copying.log", /dodoc.*(COPYING|INSTALL|ABOUT-NLS).*/, "Installs <PARAM> file")
27 checks << Check_regexp.new("logs/libtool.log", /elibtoolize.*([^e]libtoolize|aclocal|autoreconf|autoconf)/m, "elibtoolize called before autoretooling")
28 checks << Check_regexp.new("logs/libdl.log", /-ldl/, "Somehow refers to libdl")
29 checks << Check_regexp.new("logs/cpparents.log", /cp.*--parent.*/, "Tries to use cp --parents")
30 checks << Check_missingfunction.new("logs/seq.log", "seq", "portability", "Uses seq without portability eclass")
31 #checks << Check_regexp.new("logs/uclibctoolize.log", /uclibctoolize/, "uclibctoolize called")
32 checks << Check_regexp.new("logs/gnuld.log", /--with-gnu-ld/, "Assumes GNU ld")
33 checks << Check_regexp.new("logs/setXid.log", /-Wl,-z,now/, "Hardcodes -Wl,-z,now for setXid binaries")
34 #checks << Check_regexp.new("logs/autotools.log", /[^e\/](aclocal|autoconf|automake)/, "Don't use autotools eclass")
35 checks << Check_regexp.new("logs/fpic.log", /append-flags -fPIC/, "Appends -fPIC ")
36 checks << Check_regexp.new("logs/userland.log", /userland_|\${USERLAND}/, "Checks USERLAND")
37 checks << Check_regexp.new("logs/macospatches.log", /use ppc-macos && epatch/, "Conditional ppc-macos patch.")
38
39 Categories.List.each do |catname|
40 Category.new(catname).packages.each do |pkgname|
41 pkg = Package.new(pkgname)
42
43 last = Ebuild.new(pkg.versions.last).ebuild if pkg.versions.last and not pkg.versions.last.empty?
44 unmask = Ebuild.new(pkg.unmasked.last).ebuild if pkg.unmasked.last and not pkg.unmasked.last.empty? \
45 and pkg.versions.last != pkg.unmasked.last
46
47 if last then
48 ebcontent = IO.read("#{ENV["PORTDIR"]}/#{last}").gsub("\\\n", " ").gsub(/^\s*#.*/, "")
49 checks.each { |chk| chk.check(pkg, last.to_s, ebcontent) }
50 end
51
52 if unmask and last != unmask then
53 ebcontent = IO.read("#{ENV["PORTDIR"]}/#{unmask}").gsub("\\\n", " ").gsub(/^\s*#.*/, "")
54 checks.each { |chk| chk.check(pkg, unmask.to_s, ebcontent) }
55 end
56 end
57 end
58
59 checks.each { |chk| chk.summarize }
60
61 ## Kate modeline: leave at the end
62 # kate: indent-width 2; replace-trailing-space-save 1; space-indent 1; backspace-indents 1;

  ViewVC Help
Powered by ViewVC 1.1.20