Class: Xezat::Command::Port
- Inherits:
-
Object
- Object
- Xezat::Command::Port
- Includes:
- Xezat
- Defined in:
- lib/xezat/command/port.rb
Constant Summary
Constants included from Xezat
Xezat::CONFIG_FILE, DATA_DIR, REPOSITORY_DIR, ROOT_DIR, TEMPLATE_DIR, VERSION
Instance Method Summary collapse
- #execute ⇒ Object
- #get_port_directory(options) ⇒ Object
-
#initialize(options, cygport) ⇒ Port
constructor
A new instance of Port.
Methods included from Xezat
#config, #packages, #print_yaml, #variables
Constructor Details
#initialize(options, cygport) ⇒ Port
Returns a new instance of Port.
16 17 18 19 |
# File 'lib/xezat/command/port.rb', line 16 def initialize(, cygport) @options = @cygport = cygport end |
Instance Method Details
#execute ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/xezat/command/port.rb', line 21 def execute Xezat.logger.debug('Start porting') vars = variables(@cygport) d = File.(File.join(get_port_directory(@options), vars[:PN])) cygport = File.(File.join(vars[:top], @cygport)) readme = File.(File.join(vars[:C], 'README')) src_patch = File.(File.join(vars[:patchdir], "#{vars[:PF]}.src.patch")) noop = @options[:noop] verbose = @options[:noop] || @options[:verbose] FileUtils.mkdir_p(d, noop:, verbose:) FileUtils.cp(cygport, d, noop:, verbose:) FileUtils.cp(readme, d, noop:, verbose:) FileUtils.cp(src_patch, d, noop:, verbose:) unless FileTest.empty?(src_patch) Xezat.logger.debug('End porting') end |
#get_port_directory(options) ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/xezat/command/port.rb', line 39 def get_port_directory() conf = config([:config]) port_dir = conf['xezat']['portdir'] || [:portdir] raise NoPortDirectoryError if port_dir.nil? Xezat.logger.debug(" Port directory: #{port_dir}") port_dir end |