class RBT::Cookbooks::Convert_PKGBUILD

Constants

ARRAY_ENTRIES_WITHOUT_CORRESPONDING_VERSIONS
#

The following entries have no corresponding version.

epoch is an integer value, specific to Arch Linux, representing what ‘lifetime’ to compare version numbers against. This value allows overrides of the normal version comparison rules for packages that have inconsistent version numbering, require a downgrade, change numbering schemes, etc. By default, packages are assumed to have an epoch value of 0. Do not use this unless you know what you are doing.

  • arch is an array of architectures that the PKGBUILD file is known

to build and work on. Currently, it should contain i686 or x86_64 or any for architecture-independent packages.

#
DEFAULT_FILE
#

DEFAULT_FILE

#
H
HASH_MAP_PKGBUILD_VARIABLE_TO_COOKBOOK_ENTRY
#

HASH_MAP_PKGBUILD_VARIABLE_TO_COOKBOOK_ENTRY

Use a mapping, to map from PKGBUILD variables to our specific Cookbook entries. This may have to be updated every now and then.

#

Public Class Methods

new( this_pkgbuild = DEFAULT_FILE, run_already = true ) click to toggle source
#

initialize

#
# File lib/rbt/utility_scripts/convert_pkgbuild.rb, line 73
def initialize(
    this_pkgbuild = DEFAULT_FILE,
    run_already   = true
  )
  reset
  read_data_from(this_pkgbuild)
  run if run_already
end

Public Instance Methods

hash()
Alias for: hash?
hash?() click to toggle source
#

hash?

#
# File lib/rbt/utility_scripts/convert_pkgbuild.rb, line 142
def hash?
  @hash
end
Also aliased as: hash
process_data() click to toggle source
#

process_data

We work through @data here.

#
# File lib/rbt/utility_scripts/convert_pkgbuild.rb, line 110
  def process_data
    @data.each { |line|
      case line
      when /^(pkgname)/, /^(pkgver)/, /^(pkgdesc)/,
           /^(url)/,/^(license)/,/^(depends)/,
           /^(makedepends)/
        @hash[ H[$1] ] = split(line)
      end
    }
    _ = action(:SanitizeCookbook, @hash['program_name']) { :fast }
    _.clear(false)
    _.merge(@hash)
    _.set_archive_type('.tar.gz') # hardcoded for now.
cliner
e
e tomato("DEBUG: STILL NOT FINISHED. SORRY.")
e
cliner
  end
read_data_from(i = DEFAULT_FILE) click to toggle source
#

read_data_from

Sets @data variable.

#
# File lib/rbt/utility_scripts/convert_pkgbuild.rb, line 101
def read_data_from(i = DEFAULT_FILE)
  @data = File.readlines(i).map(&:chomp)
end
reset() click to toggle source
#

reset

#
# File lib/rbt/utility_scripts/convert_pkgbuild.rb, line 85
def reset
  # ======================================================================= #
  # === @query
  # ======================================================================= #
  @query = nil
  # ======================================================================= #
  # === @hash
  # ======================================================================= #
  @hash = {}
end
run() click to toggle source
#

run

#
# File lib/rbt/utility_scripts/convert_pkgbuild.rb, line 149
def run
  process_data
end
split(i) click to toggle source
#

split

Easier to use this method to split at = characters found.

#
# File lib/rbt/utility_scripts/convert_pkgbuild.rb, line 135
def split(i)
  i.split('=')[1]
end