Class: Vanagon::Platform::RPM::WRL

Inherits:
Vanagon::Platform::RPM show all
Defined in:
lib/vanagon/platform/rpm/wrl.rb

Overview

This platform definition was created to account for oddities with the RPM available on WindRiver Linux based systems. WRL uses RPMv5 and some of the WRL-based OS platforms we support (e.g, HuaweiOS) do not have package repo systems or support for installing remote RPMs via urls

Constant Summary

Constants inherited from Vanagon::Platform

PLATFORM_REGEX, VERSION_REGEX

Instance Attribute Summary

Attributes inherited from Vanagon::Platform

#abs_resource_name, #architecture, #aws_ami, #aws_instance_type, #aws_key, #aws_key_name, #aws_region, #aws_shutdown_behavior, #aws_subnet_id, #aws_user_data, #aws_vpc_id, #build_dependencies, #build_hosts, #cflags, #codename, #copy, #cross_compiled, #defaultdir, #dist, #docker_image, #docker_run_args, #environment, #find, #install, #ldflags, #make, #mktemp, #name, #num_cores, #os_name, #os_version, #output_dir, #package_type, #patch, #platform_triple, #provisioning, #rpmbuild, #sed, #servicedir, #servicetype, #servicetypes, #settings, #shasum, #shell, #sort, #source_output_dir, #ssh_port, #tar, #target_user, #use_docker_exec, #valid_operators, #vmpooler_template

Instance Method Summary collapse

Methods inherited from Vanagon::Platform::RPM

#add_repository, #generate_package, #generate_packaging_artifacts, #initialize, #output_dir, #package_name, #package_override, #rpm_defines, #source_output_dir

Methods inherited from Vanagon::Platform

#[], #add_build_repository, #add_group, #add_user, #generate_compiled_archive, #get_service_dir, #get_service_types, #initialize, #is_aix?, #is_cisco_wrlinux?, #is_cross_compiled?, #is_cross_compiled_linux?, #is_deb?, #is_debian?, #is_el8?, #is_el?, #is_eos?, #is_fedora?, #is_fips?, #is_huaweios?, #is_linux?, #is_macos?, #is_osx?, #is_rpm?, #is_sles?, #is_solaris?, #is_ubuntu?, #is_unix?, #is_windows?, load_platform, #package_override, #provision_with, #validate_operator, #version_munger

Methods included from HashableAttributes

#to_hash, #to_json

Methods included from Utilities

#erb_file, #erb_string, #ex, #find_program_on_path, #get_md5sum, #get_sum, #http_request, #http_request_code, #http_request_generic, #local_command, #remote_ssh_command, #retry_with_timeout, #rsync_from, #rsync_to, #ssh_command

Constructor Details

This class inherits a constructor from Vanagon::Platform::RPM

Instance Method Details

#install_build_dependencies(build_dependencies) ⇒ String

Some WRL RPM platforms (e.g, HuaweiOS) don’t allow you to install remote packages via url, so we’ll do a dance to download them via curl and then perform the installs locally. This method generates a shell script to be executed on the system to do this.

Parameters:

  • build_dependencies (Array)

    list of all build dependencies to install

Returns:

  • (String)

    a command to install all of the build dependencies



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/vanagon/platform/rpm/wrl.rb', line 18

def install_build_dependencies(build_dependencies)
  commands = []
  unless build_dependencies.empty?
    commands << "tmpdir=$(#{mktemp})"
    commands << "cd ${tmpdir}"
    build_dependencies.each do |build_dependency|
      if build_dependency =~ /^http.*\.rpm$/
        # We're downloading each package individually so
        # failures are easier to troubleshoot
        commands << %(curl --remote-name --location --fail --silent #{build_dependency} && echo "Successfully downloaded #{build_dependency}")
      end
    end
    # Install the downloaded packages
    commands << "rpm -Uvh --nodeps --replacepkgs ${tmpdir}/*.rpm"
  end

  commands.join(' && ')
end