-
Notifications
You must be signed in to change notification settings - Fork 13
/
run_to_check_dependencies.rb
37 lines (31 loc) · 1.2 KB
/
run_to_check_dependencies.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env ruby
out = STDOUT.clone
STDOUT.reopen "/dev/null"
STDERR.reopen "/dev/null"
$missing = []
def check(name, args, deb_package, expected = 0)
system("#{name} #{args}")
$missing << [name, args, deb_package] if $?.exitstatus != expected
end
check("antiword", "-h", "antiword", 0)
check("catdoc", "-h", "catdoc", 1)
check("catppt", "-h", "catdoc", 1)
check("dcraw", "-v", "dcraw", 1)
check("perl", "-e 'use Compress::Zlib'", "libcompress-zlib-perl", 0)
check("exiftool", "-v", "libimage-exiftool-perl", 0)
check("extract", "-v", "extract", 0)
check("lynx", "-help", "lynx", 0)
check("identify", "-version", "imagemagick", 0)
check("rsvg-convert", "--help", "librsvg2-bin", 0)
check("md5sum", "--help", "coreutils", 0)
check("mplayer", "-v", "mplayer", 0)
check("pdfinfo", "-v", "poppler-utils", 99)
check("pdftotext", "-v", "poppler-utils", 99)
check("pstotext", "-v", "pstotext", 1)
check("sha1sum", "--help", "coreutils", 0)
check("wc", "--help", "coreutils", 0)
check("xls2csv", "-h", "catdoc", 1)
check("zcat", "-h", "gzip", 0)
$missing.each{|name, args, pkg| out.puts "Missing package #{pkg} (needed for `#{name} #{args}`)" }
out.puts "All dependencies found." if $missing.empty?
exit($missing.empty?)