class RBT::PostinstallationStep
Public Class Methods
[](i = ARGV)
click to toggle source
new( hash = {}, run_already = true ) { || ... }
click to toggle source
#¶ ↑
initialize¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 29 def initialize( hash = {}, run_already = true ) reset # ======================================================================= # # Append onto the main hash next, which will contain the full dataset. # ======================================================================= # if hash.is_a? String hash = { compile_which_program: hash } end append_onto_the_internal_hash( hash ) # ======================================================================= # # === Handle blocks given to this class next # ======================================================================= # if block_given? yielded = yield if yielded.is_a? Hash # =================================================================== # # === :use_opn # =================================================================== # if yielded.has_key?(:use_opn) and (yielded[:use_opn] == false) disable_opn end else case yielded # =================================================================== # # === :do_not_run_yet # =================================================================== # when :do_not_run_yet run_already = false end end end run if run_already end
Public Instance Methods
compile_which_program?()
click to toggle source
consider_symlinking_appdir_libraries_into_the_usr_lib_hierarchy()
click to toggle source
#¶ ↑
consider_symlinking_appdir_libraries_into_the_usr_lib_hierarchy
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 187 def consider_symlinking_appdir_libraries_into_the_usr_lib_hierarchy unless do_not_symlink? if is_on_roebe? and uses_appdir_approach? and no_error_has_occurred? target = prefix?+'lib/' RBT.symlink_appdir_libraries_into_usr_lib_directory(target) end end end
create_symlinks( i = compile_which_program?, shall_we_invoke_symlink_program = shall_we_invoke_symlink_program?, use_this_as_program_version = program_version? )
click to toggle source
#¶ ↑
create_symlinks
¶ ↑
This is only needed when the prefix is not traditional (i.e. Gobolinux
prefix). It will be called via the method do_postinstall_actions().
#¶ ↑
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 355 def create_symlinks( i = compile_which_program?, shall_we_invoke_symlink_program = shall_we_invoke_symlink_program?, use_this_as_program_version = program_version? ) if shall_we_invoke_symlink_program opne "Now running #{sfancy('RBT::SymlinkFromToCurrent')} "\ "to symlink the content of `#{sdir(i)}`." do_invoke_symlink_program(i, use_this_as_program_version) end end
dataset_to_use?()
click to toggle source
#¶ ↑
dataset_to_use?¶ ↑
Which dataset is to be used - this reader method returns that result.
#¶ ↑
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 83 def dataset_to_use? @internal_hash[:dataset_to_use] end
Also aliased as: cookbook_dataset?, dataset?
delete_libtool_files?()
click to toggle source
do_not_symlink?()
click to toggle source
do_register_the_program?()
click to toggle source
do_run_fetch_all_m4_macros?()
click to toggle source
ensure_that_useful_internal_values_exist()
click to toggle source
#¶ ↑
ensure_that_useful_internal_values_exist
(default tag, def tag)¶ ↑
This method will ensure that some default internal-values exist.
#¶ ↑
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 229 def ensure_that_useful_internal_values_exist # ======================================================================= # # === :use_tags # ======================================================================= # unless @internal_hash.has_key? :use_tags @internal_hash[:use_tags] = false end # ======================================================================= # # === :do_register_the_program # ======================================================================= # unless @internal_hash.has_key? :do_register_the_program @internal_hash[:do_register_the_program] = true # This is the default. end # ======================================================================= # # === :do_run_fetch_all_m4_macros # ======================================================================= # unless @internal_hash.has_key? :do_run_fetch_all_m4_macros @internal_hash[:do_run_fetch_all_m4_macros] = true # This is the default. end # ======================================================================= # # === :symlink_program # ======================================================================= # @internal_hash[:symlink_program] = RBT::SymlinkFromToCurrent.new { :do_not_run_yet } end
full_configure_command?()
click to toggle source
#¶ ↑
full_configure_command?¶ ↑
The @full_configure_command contains the full configure command that we will use. The advantage in using this is that we can easily copy/paste this at a later time, should we need to do so.
#¶ ↑
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 95 def full_configure_command? @internal_hash[:full_configure_command] end
Also aliased as: return_full_configure_command
postinstall?()
click to toggle source
prefix?()
click to toggle source
program_version?()
click to toggle source
#¶ ↑
program_version?¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 201 def program_version? _ = internal_hash? if _.has_key? :dataset_to_use _ = _[:dataset_to_use] end _ = _.internal_hash? # Query the internal method in this case. _['program_version'] end
reset()
click to toggle source
run()
click to toggle source
#¶ ↑
run (run tag)¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 257 def run ensure_that_useful_internal_values_exist prefix = real_prefix? # ======================================================================= # # Consider removing the libtool .la files next # ======================================================================= # if use_appdir_prefix? symlink_program?.set_prefix(prefix?) # ===================================================================== # # First we must create a new 'Current' symlink - this will # take a prefix such as "/home/Programs/Libfontenc/1.1.5/". # ===================================================================== # opnn; create_a_new_current_symlink_here(prefix.to_s) consider_removing_libtool_la_files # ← This will check whether we will remove .la files or not. consider_symlinking_cmake_modules if symlink_into_usr_lib_dir? RBT::SymlinkIntoUsrLibDirectory.new( rds("#{prefix}/lib/") ) end end run_post_install_class_unless_postinstall_is_empty # ======================================================================= # # Eliminate stray symlinks from the /System/Tags/ directory, should # this directory exist. # ======================================================================= # cleanup_system_tag_directory # ======================================================================= # # Next, consider symlinking the .h files into the "/usr/include/" # hierarchy. This is, by default, NOT done; only some programs # may do so, and it will only happen for programs that are # installed via an AppDir way. # ======================================================================= # consider_symlinking_header_files_into_the_usr_include_hierarchy # ======================================================================= # # === Check as to whether we will instally only programs from the # bin/ subdirectory. If so, we will delete the other files. # ======================================================================= # check_whether_we_will_install_only_programs_from_the_bin_subdirectory # ======================================================================= # # === The AppDir approach comes next # # If you need to tie actions related to the "/Programs/" directory # based installations, aka AppDirs, then this is the way to go. # ======================================================================= # if prefix.include? programs_directory? # ===================================================================== # # === Create the Architecture file on GoboLinux systems next # ===================================================================== # create_architecture_file create_symlinks(prefix) symlink_m4_macros(prefix) consider_symlinking_lib64_into_lib consider_symlinking_appdir_libraries_into_the_usr_lib_hierarchy register_program(prefix) # Register it into the AppDir-database. # ===================================================================== # # We next store into the "Resources/" directory, but only for # programs compiled via an AppDir prefix. This has to happen # after register_program() was called because we don't want to # keep track of these files in the database. # ===================================================================== # store_full_configure_command_into_resources_directory else # ===================================================================== # # Else we still may check for a few things, if we are on roebe that # is. For example, we will run the postinstallation step for bash # symlinking bin/bash towards bin/sh. # ===================================================================== # if is_on_roebe? and prefix.start_with?(home_dir?) run_post_install_class_unless_postinstall_is_empty end end # ======================================================================= # # Next, we symlink into /System/Tags. # ======================================================================= # symlink_into_tags( compile_which_program?, real_prefix?.to_s, cookbook_dataset?, use_tags? ) # ======================================================================= # # Cleanup: We must get rid of special files. # ======================================================================= # remove_compiling_is_in_progress # ======================================================================= # # We may play a song, irrespective over as to whether we have used # an AppDir installation or not. # ======================================================================= # play_song if play_song? end
run_post_install_class_unless_postinstall_is_empty()
click to toggle source
#¶ ↑
run_post_install_class_unless_postinstall_is_empty
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/postinstallation_step/postinstallation_step.rb, line 161 def run_post_install_class_unless_postinstall_is_empty unless postinstall?.empty? # ===================================================================== # # Delegate to class RBT::PostInstall next, but only if the # postinstall setting in the cookbook .yml file is NOT empty. # ===================================================================== # RBT::PostInstall.new(dataset?) {{ use_this_compile_prefix: real_prefix?.to_s }} end end
shall_we_invoke_symlink_program?()
click to toggle source
symlink_program?()
click to toggle source