diff --git a/lib/inspec/resources/apt.rb b/lib/inspec/resources/apt.rb index 0aba01efb..a6ded2907 100644 --- a/lib/inspec/resources/apt.rb +++ b/lib/inspec/resources/apt.rb @@ -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 diff --git a/test/fixtures/cmd/etc-apt b/test/fixtures/cmd/etc-apt index eb2f0df91..13c608c79 100644 --- a/test/fixtures/cmd/etc-apt +++ b/test/fixtures/cmd/etc-apt @@ -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