Browse Source

Fix missing files

tags/devuan/0.15.2+devuan4
nextime 5 years ago
parent
commit
f5d7e6af01
2 changed files with 44 additions and 0 deletions
  1. +7
    -0
      debian/jenkins-debian-glue.lintian-overrides
  2. +37
    -0
      tap/shellcheck_tap

+ 7
- 0
debian/jenkins-debian-glue.lintian-overrides View File

@@ -0,0 +1,7 @@
jenkins-debian-glue: ruby-script-but-no-ruby-dep usr/bin/adtsummary_tap
jenkins-debian-glue: ruby-script-but-no-ruby-dep usr/bin/checkbashism_tap
jenkins-debian-glue: ruby-script-but-no-ruby-dep usr/bin/lintian-junit-report
jenkins-debian-glue: ruby-script-but-no-ruby-dep usr/bin/pep8_tap
jenkins-debian-glue: ruby-script-but-no-ruby-dep usr/bin/perlcritic_tap
jenkins-debian-glue: ruby-script-but-no-ruby-dep usr/bin/piuparts_tap
jenkins-debian-glue: ruby-script-but-no-ruby-dep usr/bin/shellcheck_tap

+ 37
- 0
tap/shellcheck_tap View File

@@ -0,0 +1,37 @@
#!/usr/bin/env ruby

if ARGV[0].nil?
$stderr.puts "Usage: #{File.basename $0} <file>"
exit 1
end

if not system "which shellcheck >/dev/null 2>&1"
$stderr.puts "Error: program shellcheck does not exist."
exit 1
end

file = ARGV[0]

if not File.exists? file
$stderr.puts "Error: file #{file} could not be read."
exit 1
end

# Make sure we're looking at sh code.
mimetype = `file -b -i --keep-going #{file}`.gsub(/\n/,"")
if not /.*x-shellscript/i.match(mimetype)
$stderr.puts "File #{file} doesn't look like sh code [#{mimetype}]. Ignoring."
exit 0
end

output = %x{shellcheck --format=gcc #{file} 2>&1}

num_lines = output.lines.count
counter = 1

# output result in TAP format
puts "1..#{num_lines}"
output.each_line do |critic|
puts "not ok #{counter} #{critic}"
counter += 1
end

Loading…
Cancel
Save