Class: Debian::Build::TarballSourceProvider::PackageRetriever
- Inherits:
-
Object
- Object
- Debian::Build::TarballSourceProvider::PackageRetriever
- Includes:
- HelperMethods, FileUtils
- Defined in:
- lib/debian/build/source_providers.rb
Instance Attribute Summary collapse
-
#package ⇒ Object
readonly
Returns the value of attribute package.
Instance Method Summary collapse
-
#initialize(url, package) ⇒ PackageRetriever
constructor
A new instance of PackageRetriever.
- #orig_tarball_name ⇒ Object
- #prepare_orig_tarball ⇒ Object
- #retrieve ⇒ Object
- #tarball_name ⇒ Object
- #tarball_url ⇒ Object
Methods included from HelperMethods
Constructor Details
#initialize(url, package) ⇒ PackageRetriever
Returns a new instance of PackageRetriever.
25 26 27 |
# File 'lib/debian/build/source_providers.rb', line 25 def initialize(url, package) @url, @package = url, package end |
Instance Attribute Details
#package ⇒ Object (readonly)
Returns the value of attribute package.
23 24 25 |
# File 'lib/debian/build/source_providers.rb', line 23 def package @package end |
Instance Method Details
#orig_tarball_name ⇒ Object
51 52 53 |
# File 'lib/debian/build/source_providers.rb', line 51 def orig_tarball_name package.orig_source_tarball_name end |
#prepare_orig_tarball ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/debian/build/source_providers.rb', line 35 def prepare_orig_tarball if tarball_name.match /bz2$/ sh "bunzip2 -c #{tarball_name} | gzip -c > #{orig_tarball_name}" unless File.exists?(orig_tarball_name) else sh "ln -fs #{tarball_name} #{orig_tarball_name}" end end |
#retrieve ⇒ Object
29 30 31 32 33 |
# File 'lib/debian/build/source_providers.rb', line 29 def retrieve get tarball_url uncompress tarball_name prepare_orig_tarball end |
#tarball_name ⇒ Object
47 48 49 |
# File 'lib/debian/build/source_providers.rb', line 47 def tarball_name File.basename URI.parse(tarball_url).path end |
#tarball_url ⇒ Object
43 44 45 |
# File 'lib/debian/build/source_providers.rb', line 43 def tarball_url @tarball_url ||= eval( '"' + @url + '"', package.get_binding) end |