Class: Pandler::Yumrepo
- Inherits:
-
Object
- Object
- Pandler::Yumrepo
- Defined in:
- lib/pandler/yumrepo.rb
Instance Attribute Summary collapse
-
#base_dir ⇒ Object
readonly
Returns the value of attribute base_dir.
-
#lockfile_path ⇒ Object
readonly
Returns the value of attribute lockfile_path.
-
#repo_dir ⇒ Object
readonly
Returns the value of attribute repo_dir.
-
#yumfile_path ⇒ Object
readonly
Returns the value of attribute yumfile_path.
Instance Method Summary collapse
- #createrepo ⇒ Object
-
#initialize(args = {}) ⇒ Yumrepo
constructor
A new instance of Yumrepo.
- #install_pkgs ⇒ Object
- #specs ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Yumrepo
Returns a new instance of Yumrepo.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/pandler/yumrepo.rb', line 19 def initialize(args = {}) @base_dir = args[:base_dir] || File.("pandler") @repo_dir = args[:repo_dir] || File.join(base_dir, "yumrepo") @yumfile_path = args[:yumfile_path] || File.("Yumfile") @lockfile_path = args[:lockfile_path] || yumfile_path + ".lock" @cache_dir = File.join(base_dir, "yumcache") @yum_log = File.join(@cache_dir, "/var/lib/yum/pandler.log") FileUtils.mkdir_p base_dir FileUtils.mkdir_p repo_dir FileUtils.mkdir_p @cache_dir @yumfile = Pandler::Yumfile.new(yumfile_path) @lockfile = read_lockfile end |
Instance Attribute Details
#base_dir ⇒ Object (readonly)
Returns the value of attribute base_dir.
18 19 20 |
# File 'lib/pandler/yumrepo.rb', line 18 def base_dir @base_dir end |
#lockfile_path ⇒ Object (readonly)
Returns the value of attribute lockfile_path.
18 19 20 |
# File 'lib/pandler/yumrepo.rb', line 18 def lockfile_path @lockfile_path end |
#repo_dir ⇒ Object (readonly)
Returns the value of attribute repo_dir.
18 19 20 |
# File 'lib/pandler/yumrepo.rb', line 18 def repo_dir @repo_dir end |
#yumfile_path ⇒ Object (readonly)
Returns the value of attribute yumfile_path.
18 19 20 |
# File 'lib/pandler/yumrepo.rb', line 18 def yumfile_path @yumfile_path end |
Instance Method Details
#createrepo ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/pandler/yumrepo.rb', line 35 def createrepo setup_dirs setup_files yum_download write_lockfile symlink_pkgs run_cmd("createrepo", "-v", repo_dir) end |
#install_pkgs ⇒ Object
44 45 46 |
# File 'lib/pandler/yumrepo.rb', line 44 def install_pkgs specs.sort_by { |package, spec| spec["name"] }.map { |package, spec| package } end |
#specs ⇒ Object
48 49 50 |
# File 'lib/pandler/yumrepo.rb', line 48 def specs @specs end |