hackmac 0.5.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e2851fee08cfaeb92db3644dbd04eecb12379c8410f10c75599601f9984d0333
4
- data.tar.gz: 6678f56e13c11dd0914091afc54328dc10c06546e04019e37a787a37175b4ce4
3
+ metadata.gz: e60de0cfd1893bbebe2b12c6f178e119a22c11df20db0dd820246e6c0871aa85
4
+ data.tar.gz: 45b5a00acf8685a38335a57c9262aba1fb871f47eff040038db0e417447115ff
5
5
  SHA512:
6
- metadata.gz: 1cb71be5755a5d04960cfaf09f16f6584026a0df680e1884b16c597558769b684deb0e546deeaa51ec51d61e4860cc56357012771f1bc05bc9d3761c95e63f87
7
- data.tar.gz: 3bc28aea413bdcbfcdf3eeb84dd31876c8d34d732a6ffa8be8daa81753214ec4b60c302bc92b6e1abb7b82be7db3bbc7ae59745798fa66313a45c4ecadbf5086
6
+ metadata.gz: 55d0fe323e378ca5d28fb7ff231e392c19776ff8688c4e493413d2f63813d88de979c93dcaf2b2c0307f31f49abdad905cf6e988bbe9fc3f3799ca3877d334ca
7
+ data.tar.gz: 6cea068e98c7fb0467ff90cf98bd10c563c838589a2b0d3157fc1b9dee2d0e48b015c8355410fc5846e320e71d5903e15a1d8d317c7ec66adfcf1a10de1c78ca
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0
1
+ 0.6.0
data/bin/efi CHANGED
@@ -63,6 +63,8 @@ def usage
63
63
 
64
64
  argument PATH to the kext
65
65
 
66
+ argument FORCE == 'force' => always upgrade
67
+
66
68
  kexts list kexts versions by clover
67
69
 
68
70
  argument DEVICE (defaults to #{default_dev})
@@ -70,6 +72,20 @@ def usage
70
72
  The EFI partion on DEVICE is used to find the clover kexts in
71
73
  subdirectory /Other.
72
74
 
75
+ diff EFI partition
76
+
77
+ argument DEVICE (defaults to #{default_dev})
78
+
79
+ Shows changes as a diff with git, passes arguments to diff command
80
+ after "--".
81
+
82
+ commit EFI partition
83
+
84
+ argument DEVICE (defaults to #{default_dev})
85
+
86
+ Commits changes with git, passes arguments to commit command
87
+ after "--".
88
+
73
89
  list shows boot disk information (which EFI partition was used)
74
90
 
75
91
  end
@@ -161,8 +177,9 @@ when 'kext'
161
177
  path = ARGV.shift or fail 'need kext dir'
162
178
  puts Kext.new(path: path)
163
179
  when 'kext_upgrade'
164
- path = ARGV.shift or fail 'need kext dir'
165
- Hackmac::KextUpgrader.new(path: path, config: $config).perform
180
+ path = ARGV.shift or fail 'need kext dir'
181
+ force = ARGV.shift == 'force'
182
+ Hackmac::KextUpgrader.new(path: path, config: $config, force: force).perform
166
183
  when 'list'
167
184
  disks = Disks.new
168
185
  efis = []
data/hackmac.gemspec CHANGED
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: hackmac 0.5.0 ruby lib
2
+ # stub: hackmac 0.6.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "hackmac".freeze
6
- s.version = "0.5.0"
6
+ s.version = "0.6.0"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
10
10
  s.authors = ["Florian Frank".freeze]
11
- s.date = "2020-03-05"
11
+ s.date = "2020-05-05"
12
12
  s.description = "This ruby gem provides some useful tools for working with a Hackintosh.".freeze
13
13
  s.email = "flori@ping.de".freeze
14
14
  s.executables = ["gfxmon".freeze, "usb".freeze, "efi".freeze]
data/lib/hackmac/kext.rb CHANGED
@@ -40,10 +40,11 @@ module Hackmac
40
40
  def remote_kext
41
41
  return @remote_kext if @remote_kext
42
42
  if @config
43
- if github = @config.kext.sources[name]&.github
43
+ if source = @config.kext.sources[name] and github = source&.github
44
44
  auth = [ @config.github.user, @config.github.access_token ].compact
45
45
  auth.empty? and auth = nil
46
- @remote_kext = Hackmac::KextSource.new(github, auth: auth)
46
+ suffix = source.debug? ? 'DEBUG' : 'RELEASE'
47
+ @remote_kext = Hackmac::KextSource.new(github, auth: auth, suffix: suffix)
47
48
  end
48
49
  end
49
50
  end
@@ -8,9 +8,10 @@ module Hackmac
8
8
 
9
9
  include Tins::StringVersion
10
10
 
11
- def initialize(github, auth: nil)
12
- @github = github
13
- @auth = auth
11
+ def initialize(github, auth: nil, suffix: nil)
12
+ @github = github
13
+ @auth = auth
14
+ @suffix = Regexp.quote(suffix || 'RELEASE')
14
15
  account, repo = github.split(?/)
15
16
  @name = repo
16
17
  releases = URI.open(
@@ -41,7 +42,7 @@ module Hackmac
41
42
 
42
43
  def download_asset
43
44
  @release or return
44
- asset = @release.assets.find { |a| a.name =~ /RELEASE.*zip/i } or return
45
+ asset = @release.assets.find { |a| a.name =~ /#@suffix.*\.zip\z/i } or return
45
46
  data = URI.open(
46
47
  (GITHUB_API_URL % github) + ("/assets/%s" % asset.id),
47
48
  'Accept' => 'application/octet-stream',
@@ -6,8 +6,8 @@ module Hackmac
6
6
  class KextUpgrader
7
7
  include FileUtils
8
8
 
9
- def initialize(path:, config:)
10
- @path, @config = path, config
9
+ def initialize(path:, config:, force: false)
10
+ @path, @config, @force = path, config, force
11
11
  end
12
12
 
13
13
  private
@@ -28,7 +28,7 @@ module Hackmac
28
28
  case
29
29
  when kext.remote_version.nil?
30
30
  puts "No source defined for #{kext}"
31
- when kext.remote_version > kext.version
31
+ when kext.remote_version > kext.version || @force
32
32
  name, data = kext.remote_kext.download_asset
33
33
  if name
34
34
  File.secure_write(name, data)
@@ -48,7 +48,6 @@ module Hackmac
48
48
  end
49
49
  end
50
50
  end
51
- p kext_pathes
52
51
  kext_pathes.each do |kext_path|
53
52
  old_path = (Pathname.new(@path).dirname + File.basename(kext_path)).to_s
54
53
  if ask("Really upgrade #{old_path.inspect} to version #{kext.remote_version}? (y/n) ")
@@ -1,6 +1,6 @@
1
1
  module Hackmac
2
2
  # Hackmac version
3
- VERSION = '0.5.0'
3
+ VERSION = '0.6.0'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hackmac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-05 00:00:00.000000000 Z
11
+ date: 2020-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar