mirror of
https://github.com/inspec/inspec
synced 2024-11-23 05:03:07 +00:00
Merge pull request #5138 from jrbeilke/bug-apt-cdrom
skip apt-cdrom repos in apt resource when parsing lists
This commit is contained in:
commit
934aa8d49a
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