From b7eb7e48f0c149db5580fb90afc75cfa0b4afaeb Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sun, 22 Jul 2018 21:23:10 +0200 Subject: [PATCH] Remove `Hbc::Container::Gpg`. --- Library/Homebrew/cask/lib/hbc/container.rb | 2 - .../Homebrew/cask/lib/hbc/container/gpg.rb | 43 ------------------- 2 files changed, 45 deletions(-) delete mode 100644 Library/Homebrew/cask/lib/hbc/container/gpg.rb diff --git a/Library/Homebrew/cask/lib/hbc/container.rb b/Library/Homebrew/cask/lib/hbc/container.rb index e42e02f7fc..8c5d2b4018 100644 --- a/Library/Homebrew/cask/lib/hbc/container.rb +++ b/Library/Homebrew/cask/lib/hbc/container.rb @@ -8,7 +8,6 @@ require "hbc/container/dmg" require "hbc/container/self_extracting_executable" require "hbc/container/executable" require "hbc/container/generic_unar" -require "hbc/container/gpg" require "hbc/container/gzip" require "hbc/container/lzma" require "hbc/container/naked" @@ -45,7 +44,6 @@ module Hbc Gzip, # pure gzip Lzma, # pure lzma Xz, # pure xz - Gpg, # GnuPG signed data Executable, SvnRepository, ] diff --git a/Library/Homebrew/cask/lib/hbc/container/gpg.rb b/Library/Homebrew/cask/lib/hbc/container/gpg.rb deleted file mode 100644 index af99d69e63..0000000000 --- a/Library/Homebrew/cask/lib/hbc/container/gpg.rb +++ /dev/null @@ -1,43 +0,0 @@ -require "hbc/container/base" - -module Hbc - class Container - class Gpg < Base - def self.can_extract?(path:, magic_number:) - path.extname == ".gpg" - end - - def import_key - if @cask.gpg.nil? - raise CaskError, "Expected to find gpg public key in formula. Cask '#{@cask}' must add: 'gpg :embedded, key_id: [Public Key ID]' or 'gpg :embedded, key_url: [Public Key URL]'" - end - - args = if @cask.gpg.key_id - ["--recv-keys", @cask.gpg.key_id] - elsif @cask.gpg.key_url - ["--fetch-key", @cask.gpg.key_url.to_s] - end - - @command.run!("gpg", - args: args, - env: { "PATH" => PATH.new(Formula["gnupg"].opt_bin, ENV["PATH"]) }) - end - - def extract_to_dir(unpack_dir, basename:, verbose:) - import_key - - Dir.mktmpdir do |tmp_unpack_dir| - @command.run!("gpg", - args: ["--batch", "--yes", "--output", Pathname(tmp_unpack_dir).join(basename.basename(".gpg")), "--decrypt", path], - env: { "PATH" => PATH.new(Formula["gnupg"].opt_bin, ENV["PATH"]) }) - - extract_nested_inside(tmp_unpack_dir, to: unpack_dir) - end - end - - def dependencies - @dependencies ||= [Formula["gnupg"]] - end - end - end -end