iesd 1.0.1 → 1.0.2

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
  SHA1:
3
- metadata.gz: 83ac285ba6d8e68745e95ab7aaf7fe67bcec32cb
4
- data.tar.gz: bf8acf88c5566b7c4b64a606d72f889a9e9bda42
3
+ metadata.gz: 64881b06a382ac55aa98e0cae658a8873433591d
4
+ data.tar.gz: 5c6f83c95e0aedff81585b30b9dc025cf35ae6f6
5
5
  SHA512:
6
- metadata.gz: 0661aea24b29fc5afb5da83b91c06619a95924898172fd7eb507a4d113547fe58dd1102246686f38ebcd04c2b92f29f6f14be4d0cc7cbd377afafa3c7b6df866
7
- data.tar.gz: dd631ca752031ed39edc3cf168b386e964929de2ffbb6e6003bd2d45c566866bc365c6b7d8ddb40a6c5f6c85565c0092de9f663834fe42acefc45ad4ba9a1eb9
6
+ metadata.gz: a19c4bbea44fd3ce487ab40378fe5e7baee976c029fa837e8a895d02f667d4ce25c8692757253e48a0849afc32de58691878077632365e21ca8408155f3b9fdb
7
+ data.tar.gz: df4b8f3b605119ad2436f95bb938506541013c08940814926b9b6a2638dd4bef0936e14a6cd2fc80b88d769c4aadcc07598bd05fc3743f482b2539a40ae3de58
data/bin/iesd CHANGED
@@ -7,7 +7,7 @@ require 'optparse'
7
7
  require 'iesd'
8
8
 
9
9
  begin
10
- raise "This tool is only supported on OS X." unless Kernel.system('[ "$(/usr/bin/uname)" = "Darwin" ]')
10
+ raise "iESD is only supported on OS X." unless Kernel.system('[ "$(/usr/bin/uname)" = "Darwin" ]')
11
11
  rescue Exception => e
12
12
  opoo e.message
13
13
  abort
@@ -45,12 +45,7 @@ optparse = OptionParser.new do |opts|
45
45
 
46
46
  opts.on("-t", "--type type", [:BaseSystem, :InstallESD],
47
47
  "Specify type (BaseSystem, InstallESD)") do |type|
48
- case type
49
- when :BaseSystem
50
- options[:type] = :root
51
- when :InstallESD
52
- options[:type] = :container
53
- end
48
+ options[:type] = type
54
49
  end
55
50
 
56
51
  opts.on("--install-kexts x.kext,y.kext,z.kext", Array, "Specify list of kexts to install") do |list|
@@ -65,7 +60,7 @@ optparse = OptionParser.new do |opts|
65
60
  options[:extensions][:kextcache] = c
66
61
  end
67
62
 
68
- opts.on("--[no-]postinstall-kexts", "Patch OSInstall.pkg for post install") do |p|
63
+ opts.on("--[no-]postinstall-kexts", "Patch OSInstall.pkg for postinstall kexts") do |p|
69
64
  options[:extensions][:postinstall] = p
70
65
  end
71
66
 
@@ -117,6 +112,11 @@ begin
117
112
  raise "invalid kext: #{kext}" unless File.exist? File.join(kext, *%w{ Contents MacOS }, File.basename(kext, ".kext"))
118
113
  }
119
114
  if (iesd = IESD.new options[:input])
115
+ iesd_type = iesd.class.name.split("::").last
116
+ types = [nil, :BaseSystem, :InstallESD, :InstallOSX]
117
+ if types.index(options[:type]) > types.index(iesd_type.to_sym)
118
+ raise "invalid output type #{options[:type].to_s} for input type #{iesd_type}"
119
+ end
120
120
  iesd.export options
121
121
  puts "\xF0\x9F\x8D\xBA #{options[:output]}"
122
122
  else
data/iesd.gemspec CHANGED
@@ -2,7 +2,7 @@ Gem::Specification.new do |s|
2
2
  s.required_ruby_version = ">= 1.9.2"
3
3
 
4
4
  s.name = "iesd"
5
- s.version = "1.0.1"
5
+ s.version = "1.0.2"
6
6
  s.summary = "Customize OS X InstallESD."
7
7
  s.description = "Modify Extensions, Kextcache and Packages on InstallESD."
8
8
  s.authors = "なつき"
@@ -14,6 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.files = %w{
15
15
  README.md
16
16
  LICENSE.md
17
+ bin/iesd
17
18
  iesd.gemspec
18
- } + Dir["lib/**/*.rb"] + Dir["bin/iesd"]
19
+ } + Dir["lib/**/*.rb"]
19
20
  end
@@ -5,7 +5,7 @@ module IESD
5
5
 
6
6
  def export options, add_sectors = 0
7
7
  case options[:type]
8
- when :root, nil
8
+ when :BaseSystem, nil
9
9
  Dir.mktmpdir { |tmp|
10
10
  HDIUtil.write(@url, (tmpfile = File.join(tmp, File.basename(@url))), add_sectors) { |volume_root|
11
11
  options[:extensions][:up_to_date] = (options[:extensions][:remove].empty? and options[:extensions][:install].empty?)
@@ -5,7 +5,7 @@ module IESD
5
5
 
6
6
  def export options
7
7
  case options[:type]
8
- when :root
8
+ when :BaseSystem
9
9
  resize_limits = `#{Utility::HDIUTIL} resize -limits "#{@url}"`.chomp.split.map { |s| s.to_i }
10
10
  show { |installesd|
11
11
  IESD::DMG::BaseSystem.new(File.join(installesd, "BaseSystem.dmg")).export(options, resize_limits[0]) { |basesystem|
@@ -26,7 +26,7 @@ module IESD
26
26
  end
27
27
  }
28
28
  }
29
- when :container, nil
29
+ when :InstallESD, nil
30
30
  Dir.mktmpdir { |tmp|
31
31
  HDIUtil.write(@url, (tmpfile = File.join(tmp, File.basename(@url)))) { |installesd|
32
32
  options[:extensions][:up_to_date] = (options[:extensions][:remove].empty? and options[:extensions][:install].empty?)
@@ -58,14 +58,14 @@ module IESD
58
58
  system(Utility::CHFLAGS, "hidden", kextcache)
59
59
  puts "Updated: #{kextcache}"
60
60
  }
61
- else
62
- raise "invalid output type"
63
61
  end
64
62
 
65
63
  post_update installesd, options
66
64
  }
67
65
  system(Utility::MV, tmpfile, options[:output])
68
66
  }
67
+ else
68
+ raise "invalid output type"
69
69
  end
70
70
  end
71
71
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iesd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - "なつき"
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-03 00:00:00.000000000 Z
11
+ date: 2013-12-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Modify Extensions, Kextcache and Packages on InstallESD.
14
14
  email: i@ntk.me
@@ -19,6 +19,7 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - README.md
21
21
  - LICENSE.md
22
+ - bin/iesd
22
23
  - iesd.gemspec
23
24
  - lib/iesd/InstallESD/BaseSystem.dmg.rb
24
25
  - lib/iesd/InstallESD/Extensions.rb
@@ -47,7 +48,6 @@ files:
47
48
  - lib/iesd/utility/tty.rb
48
49
  - lib/iesd/utility.rb
49
50
  - lib/iesd.rb
50
- - bin/iesd
51
51
  homepage: https://github.com/ntkme/iesd
52
52
  licenses:
53
53
  - BSD-2-Clause