class RBT::RemoveProgram

Constants

DEFAULT_PROGRAM
#

DEFAULT_PROGRAM

#

Public Class Methods

new( this_program = DEFAULT_PROGRAM, run_already = true ) click to toggle source
#

initialize

@install_type may be of these two values:

:fhs
:app_dir

The default is :app_dir. This means to check under the /Programs/ hierarchy.

#
# File lib/rbt/utility_scripts/remove_program.rb, line 39
def initialize(
    this_program = DEFAULT_PROGRAM,
    run_already  = true
  )
  reset
  set_this_program(this_program)
  run if run_already
end

Public Instance Methods

remove_program( this_program = @remove_this_program ) click to toggle source
#

remove_program

This is the actual powerhorse of this script.

#
# File lib/rbt/utility_scripts/remove_program.rb, line 111
def remove_program(
    this_program = @remove_this_program
  )
  _ = @install_type
  case _ # case tag
  # ======================================================================= #
  # === remove_program evince
  # ======================================================================= #
  when :app_dir,
       :gobo,
       :gobolinux_mode
    set_program_path(rds(programs_dir?))
    base_dir = @program_path+this_program
    @this_dir = "#{base_dir}/Current/"
    opne 'Removing program `'+sdir(@this_dir)+'` now' # Tell the user what to do.
    # ===================================================================== #
    # First, clean-up any stray symlinks into the /usr/include
    # hierarchy.
    # ===================================================================== #
    try_to_remove_stray_symlinks_from_the_usr_include_hierarchy(
      @this_dir+'include/'
    )
    remove_directory(@this_dir)
    # ===================================================================== #
    # Next, we get rid of the symlinks and the current link.
    # ===================================================================== #
    remove_broken_symlinks # Remove all broken Symlinks.
    remove_current_link    # And remove the 'Current' symlink as well.
  # ======================================================================= #
  # === :fhs
  # ======================================================================= #
  when :fhs
    # ===================================================================== #
    # Currently not implemented.
    # ===================================================================== #
  else
    e "Unregistered Type (#{sfancy(_)})."
  end
  run_ldconfig
end
reset() click to toggle source
#

reset

#
Calls superclass method RBT::Base#reset
# File lib/rbt/utility_scripts/remove_program.rb, line 51
def reset
  super()
  infer_the_namespace
  # ======================================================================= #
  # === @install_type
  # ======================================================================= #
  @install_type = :app_dir
end
run() click to toggle source
#

run (run tag)

#
# File lib/rbt/utility_scripts/remove_program.rb, line 189
def run
  remove_program
end
run_ldconfig() click to toggle source
#

run_ldconfig

#
# File lib/rbt/utility_scripts/remove_program.rb, line 182
def run_ldconfig
  system 'ldconfig' if RBT.configuration?.run_ldconfig
end
set_program_path( i = rds(programs_dir?) ) click to toggle source
#

set_program_path

#
# File lib/rbt/utility_scripts/remove_program.rb, line 75
def set_program_path(
    i = rds(programs_dir?)
  )
  @program_path = i
end
set_this_program(i = DEFAULT_PROGRAM) click to toggle source
#

set_this_program

This will simply set the variable @remove_this_program.

#
# File lib/rbt/utility_scripts/remove_program.rb, line 65
def set_this_program(i = DEFAULT_PROGRAM)
  i = i.first if i.is_a? Array
  i = DEFAULT_PROGRAM if i.nil?
  i = i.capitalize
  @remove_this_program = i
end