mirror of
https://github.com/inspec/inspec
synced 2024-11-10 15:14:23 +00:00
skip apt-cdrom repos in apt resource when parsing lists
Signed-off-by: Jon Beilke <Jonathan.Beilke@windlogics.com>
This commit is contained in:
parent
4c99130bb2
commit
bedef776a6
2 changed files with 3 additions and 0 deletions
|
@ -90,12 +90,14 @@ module Inspec::Resources
|
|||
# deb "http://archive.ubuntu.com/ubuntu/" wily main restricted ...
|
||||
# deb http://archive.ubuntu.com/ubuntu/ wily main restricted ...
|
||||
# deb [trusted=yes] http://archive.ubuntu.com/ubuntu/ wily main restricted ...
|
||||
# deb cdrom:[Ubuntu 15.10 _Wily Werewolf_ - Release amd64 (20151021)]/ wily main restricted ...
|
||||
|
||||
words = line.split
|
||||
words.delete_at 1 if words[1] && words[1].start_with?("[")
|
||||
type, url, distro, *components = words
|
||||
url = url.delete('"') if url
|
||||
|
||||
next if words[1] && words[1].start_with?("cdrom:") # skip unsupported apt-cdrom repos
|
||||
next if components.empty?
|
||||
next unless URI::HTTP === URI.parse(url)
|
||||
next unless %w{deb deb-src}.include? type
|
||||
|
|
1
test/fixtures/cmd/etc-apt
vendored
1
test/fixtures/cmd/etc-apt
vendored
|
@ -7,3 +7,4 @@ deb http://archive.ubuntu.com/ubuntu/ wily main restricted
|
|||
deb "http://archive.ubuntu.com/ubuntu/" wily main restricted
|
||||
deb [arch=amd64] "http://archive.ubuntu.com/ubuntu/" wily main restricted
|
||||
deb-src http://archive.ubuntu.com/ubuntu/ wily main restricted
|
||||
deb cdrom:[Ubuntu 15.10 _Wily Werewolf_ - Release amd64 (20151021)]/ wily main restricted
|
||||
|
|
Loading…
Reference in a new issue