Class: FPM::Fry::Source::Patched::Cache
- Inherits:
-
Struct
- Object
- Struct
- FPM::Fry::Source::Patched::Cache
- Extended by:
- Forwardable
- Defined in:
- lib/fpm/fry/source/patched.rb
Instance Attribute Summary collapse
-
#inner ⇒ Object
readonly
Returns the value of attribute inner.
-
#package ⇒ Object
Returns the value of attribute package.
-
#tmpdir ⇒ Object
Returns the value of attribute tmpdir.
Instance Method Summary collapse
- #cachekey ⇒ Object
-
#initialize(*_) ⇒ Cache
constructor
A new instance of Cache.
- #tar_io ⇒ Object
- #unpacked_tmpdir ⇒ Object
Constructor Details
#initialize(*_) ⇒ Cache
Returns a new instance of Cache.
15 16 17 18 19 |
# File 'lib/fpm/fry/source/patched.rb', line 15 def initialize(*_) @updated = false super @inner = package.inner.build_cache(tmpdir) end |
Instance Attribute Details
#inner ⇒ Object (readonly)
Returns the value of attribute inner.
13 14 15 |
# File 'lib/fpm/fry/source/patched.rb', line 13 def inner @inner end |
#package ⇒ Object
Returns the value of attribute package
7 8 9 |
# File 'lib/fpm/fry/source/patched.rb', line 7 def package @package end |
#tmpdir ⇒ Object
Returns the value of attribute tmpdir
7 8 9 |
# File 'lib/fpm/fry/source/patched.rb', line 7 def tmpdir @tmpdir end |
Instance Method Details
#cachekey ⇒ Object
88 89 90 91 92 93 94 95 96 |
# File 'lib/fpm/fry/source/patched.rb', line 88 def cachekey dig = Digest::SHA2.new dig << inner.cachekey << "\x00" package.patches.each do |patch| dig.file(patch[:file]) dig << "\x00" end return dig.hexdigest end |
#tar_io ⇒ Object
83 84 85 86 |
# File 'lib/fpm/fry/source/patched.rb', line 83 def tar_io update! return Exec::popen('tar','-c','.',chdir: unpacked_tmpdir, logger: logger) end |
#unpacked_tmpdir ⇒ Object
98 99 100 |
# File 'lib/fpm/fry/source/patched.rb', line 98 def unpacked_tmpdir File.join(tmpdir, cachekey) end |