lib/vanagon/platform/rpm.rb
# The specific bits used to generate an rpm package for a given project
#
# @param project [Vanagon::Project] project to build an rpm package of
# @return [Array] list of commands required to build an rpm package for the given project from a tarball
The specific bits used to generate an rpm package for a given project
The specific bits used to generate an rpm package for a given project
def add_repository(definition)
        definition = URI.parse(definition)
        commands = ["rpm -q curl > /dev/null || yum -y install curl"]
        if definition.scheme =~ /^(http|ftp)/
          if File.extname(definition.path) == '.rpm'
            commands << "curl -o local.rpm '#{definition}'; rpm -Uvh local.rpm; rm -f local.rpm"
          else
            reponame = "#{SecureRandom.hex}-#{File.basename(definition.path)}"
            reponame = "#{reponame}.repo" if File.extname(reponame) != '.repo'
            if is_cisco_wrlinux?
              commands << "curl -o '/etc/yum/repos.d/#{reponame}' '#{definition}'"
            else
              commands << "curl -o '/etc/yum.repos.d/#{reponame}' '#{definition}'"
            end
          end
        end
        commands
      end
def add_repository ( definition ) definition = URI . parse ( definition ) commands = [ "rpm -q curl > /dev/null || yum -y install curl" ] if definition . scheme =~ / ^(http|ftp) / if File . extname ( definition . path ) == '.rpm' commands << "curl -o local.rpm '#{definition}'; rpm -Uvh local.rpm; rm -f local.rpm" else reponame = "#{SecureRandom.hex}-#{File.basename(definition.path)}" reponame = "#{reponame}.repo" if File . extname ( reponame ) != '.repo' if is_cisco_wrlinux? commands << "curl -o '/etc/yum/repos.d/#{reponame}' '#{definition}'" else commands << "curl -o '/etc/yum.repos.d/#{reponame}' '#{definition}'" end end end commands end
The specific bits used to generate an rpm package for a given project
The specific bits used to generate an rpm package for a given project
# repo definition is an rpm (like puppetlabs-release)
list of commands required to build an rpm package for the given project from a tarball
list of commands required to build an rpm package for the given project from a tarball
Array
definition
project
project to build an rpm package of
project to build an rpm package of