Sha256: 953ce8149b25393dfa6b6fcf4861d4244a1ecd74f5ff6a9f9809a3a8878f8527

Contents?: true

Size: 806 Bytes

Versions: 2

Compression:

Stored size: 806 Bytes

Contents

require 'devinstall/utils'
## Work in progress
module Pkg
  module RpmWorking
#  @type=:rpm
    include Utils

    def get_info(pkg, type, env)
      config=Devinstall::Settings.instance
      folder=config.local(:folder, pkg: pkg, type: type, env: env)
      rpm_spec = File.expand_path "#{folder}/#{pkg}.rpm.spec"
      unless File.exists? rpm_spec
        exit! "No 'debian/changelog' found in specified :local:folder (#{folder})"
      end
      package_version = File.open(rpm_spec, 'r') { |f| f.gets.chomp.sub(/^.*\((.*)\).*$/, '\1') }
      package_release = config.build(pkg: pkg, type: type, env: env)[:arch]
      {version: package_version,
        files: {rpm: "#{pkg}.#{package_version}.#{package_release}.rpm"},
        to_install: [:rpm],
        to_upload:  [:rpm]
      }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
devinstall-1.2.3 lib/devinstall/package/pkg_rpm.rb
devinstall-1.2.2 lib/devinstall/pkg/pkg_rpm.rb