Module: RBT::CompileBaseModule

Included in:
Action::SoftwareManager, Actions::Configure, CompileBase
Defined in:
lib/rbt/compile_base/compile_base_module.rb

Overview

RBT::CompileBaseModule

Constant Summary collapse

FILE_AUTOGEN =
#

FILE_AUTOGEN

#
'autogen.sh'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.make_command?Boolean

#

RBT::Base.make_command?

#

Returns:

  • (Boolean)


765
766
767
# File 'lib/rbt/compile_base/compile_base_module.rb', line 765

def self.make_command?
  RBT.configuration?.make_command # The Configuration object has our make command.
end

Instance Method Details

#always_show_dependencies?Boolean

#

always_show_dependencies?

If this setting is true then we will always show the dependencies on the commandline.

#

Returns:

  • (Boolean)


676
677
678
# File 'lib/rbt/compile_base/compile_base_module.rb', line 676

def always_show_dependencies?
  RBT.configuration?.always_show_dependencies
end

#capitalize_program_names?Boolean Also known as: do_capitalize?

#

capitalize_program_names?

#

Returns:

  • (Boolean)


758
759
760
# File 'lib/rbt/compile_base/compile_base_module.rb', line 758

def capitalize_program_names?
  RBT.configuration?.capitalize_program_names
end

#cflags?Boolean

#

cflags?

#

Returns:

  • (Boolean)


647
648
649
# File 'lib/rbt/compile_base/compile_base_module.rb', line 647

def cflags?
  ENV['CFLAGS']
end

#check_whether_we_will_install_only_programs_from_the_bin_subdirectoryObject

#

check_whether_we_will_install_only_programs_from_the_bin_subdirectory

#


309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'lib/rbt/compile_base/compile_base_module.rb', line 309

def check_whether_we_will_install_only_programs_from_the_bin_subdirectory
  if install_only_binaries?
    opne 'We will only retain the '+sdir('bin/')+' subdirectory.'
    delete_these_directories = Dir[return_proper_prefix?.to_s+'*'].select {|entry|
      File.directory? entry
    }
    delete_these_directories.reject! {|entry| entry.end_with? 'bin' }
    unless delete_these_directories.empty?
      opne 'We will now delete several directories that we did find.'
      remove(delete_these_directories)
    end
  end
end

#cleanup_system_tag_directoryObject

#

cleanup_system_tag_directory

#


803
804
805
806
807
808
# File 'lib/rbt/compile_base/compile_base_module.rb', line 803

def cleanup_system_tag_directory
  # ======================================================================= #
  # Be quiet - and only report when a stray symlink is removed.
  # ======================================================================= #
  action(:CleanupSystemTags) { :be_quiet }
end

#config?Boolean

#

config?

#

Returns:

  • (Boolean)


737
738
739
# File 'lib/rbt/compile_base/compile_base_module.rb', line 737

def config?
  RBT.configuration?
end

#consider_removing_libtool_la_filesObject

#

consider_removing_libtool_la_files

To test this, try:

ry apr ntrad
#


59
60
61
62
63
64
65
66
67
68
69
70
71
72
# File 'lib/rbt/compile_base/compile_base_module.rb', line 59

def consider_removing_libtool_la_files
  # ======================================================================= #
  # Must check for two conditions:
  #
  #   (a) the user specifically wants to delete libtool files, due
  #       to setting a configuration value
  #   (b) the program at hand uses an appdir-like prefix
  #
  # ======================================================================= #
  if delete_libtool_files?
    prefix_to_the_libtool_files = rds("#{prefix?.to_s}/lib/")
    action(:remove_libtool_files, prefix_to_the_libtool_files)
  end
end

#consider_symlinking_cmake_modulesObject

#

consider_symlinking_cmake_modules

Prior to entering this method, there is already a check whether we are using an AppDir-like prefix. Only if this is the case, will this method here be entered at all.

This method will normally be called from the method consider_performing_postinstall_actions().

#


364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
# File 'lib/rbt/compile_base/compile_base_module.rb', line 364

def consider_symlinking_cmake_modules
  # ======================================================================= #
  # We must first check whether there are any cmake modules in the
  # first place.
  # ======================================================================= #
  target_cmake_dir = "#{prefix?}lib64/cmake/"
  if File.directory? target_cmake_dir
    # ===================================================================== #
    # But we must also check whether a cmake directory exists at a
    # /usr hierarchy.
    # ===================================================================== #
    if File.directory? '/usr/lib/cmake/'
      opne "#{rev}Symlinking from #{sdir(target_cmake_dir)} #{rev}into "\
           "#{sdir('/usr/lib/cmake/')}"
      # =================================================================== #
      # Symlink only directories.
      # =================================================================== #
      all_dirs = Dir["#{target_cmake_dir}*"].select {|entry| File.directory? entry }
      all_dirs.each {|this_directory|
        basename = File.basename(this_directory)
        target_in_usr_lib_cmake = "/usr/lib/cmake/#{basename}"
        # ================================================================= #
        # Only on roebe-like systems will we also remove the target
        # directory.
        # ================================================================= #
        if is_on_roebe?
          if File.exist?(target_in_usr_lib_cmake) and
             File.directory?(target_in_usr_lib_cmake) and
            !File.symlink?(target_in_usr_lib_cmake)
            remove_directory(target_in_usr_lib_cmake)
          end
        end
        symlink(this_directory, target_in_usr_lib_cmake)
      }
    end
  end
end

#consider_symlinking_header_files_into_the_usr_include_hierarchy(i = compile_which_program?, , shall_we_symlink_the_header_files_into_the_usr_include_hierarchy = shall_we_symlink_the_header_files_into_the_usr_include_hierarchy? ) ⇒ Object

#

consider_symlinking_header_files_into_the_usr_include_hierarchy

This method can be called if you wish to symlink any .h files or directories within the AppDir at hand, into the /usr/include/ hierarchy.

#


330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
# File 'lib/rbt/compile_base/compile_base_module.rb', line 330

def consider_symlinking_header_files_into_the_usr_include_hierarchy(
    i                                                                = compile_which_program?,
    shall_we_symlink_the_header_files_into_the_usr_include_hierarchy =
      shall_we_symlink_the_header_files_into_the_usr_include_hierarchy?
  )
  if shall_we_symlink_the_header_files_into_the_usr_include_hierarchy
    # ===================================================================== #
    # Delegate into class RBT::SymlinkHeaders next.
    # ===================================================================== #
    opne "#{rev}Next attempting to symlink all #{royalblue('.h')} #{rev}files "\
         "into the #{sdir('/usr/include/')} #{rev}hierarchy."
    opne "#{rev}In order for this to work, #{royalblue('.h')}"\
         " #{rev}files have to exist in the AppDir directory."
    RBT::SymlinkHeaders.new(i) { :do_not_notify_if_there_were_no_header_files }
  end
end

#consider_symlinking_lib64_into_lib(shall_we_symlink = cookbook_dataset_autosymlink_lib64? ) ⇒ Object

#

consider_symlinking_lib64_into_lib

This method will symlink lib64/ into lib/. Only invoke this method if you have an AppDir versioned directory though.

#


247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# File 'lib/rbt/compile_base/compile_base_module.rb', line 247

def consider_symlinking_lib64_into_lib(
    shall_we_symlink = cookbook_dataset_autosymlink_lib64?
  )
  if shall_we_symlink
    old_dir = Dir.pwd # Keep a reference to the old directory.
    cd prefix?.to_s # cd into the AppDir prefix.
    opne 'Next trying to symlink '+sdir('lib64/')+' into '+
         sdir('lib/')+' from the directory '+sdir(return_pwd)+':'
    symlink('lib64','lib')
    # ===================================================================== #
    # Next check whether the operation was a success, so that we can
    # inform the user about this.
    # ===================================================================== #
    if File.symlink?('lib') and
       File.directory?('lib')
      opne 'Success!'
    else
      opne swarn('Failed to symlink `')+sdir('lib64/')+
           swarn('` towards `')+sdir('lib/')+swarn('`.')
    end
    cd old_dir # And go back again.
  end
end
#
#

Returns:

  • (Boolean)


274
275
276
# File 'lib/rbt/compile_base/compile_base_module.rb', line 274

def cookbook_dataset_autosymlink_lib64?
  cookbook_dataset?.autosymlink_lib64?
end

#cookbook_dataset_program_version?Boolean

#

cookbook_dataset_program_version?

Obtain the version string of the program at hand through this method. This method is quite reliable and can ideally be used whenever we need to determine the version of a program.

#

Returns:

  • (Boolean)


409
410
411
412
413
414
# File 'lib/rbt/compile_base/compile_base_module.rb', line 409

def cookbook_dataset_program_version?
  if cookbook_dataset?
    return cookbook_dataset?.program_version?
  end
  nil
end
#
#


543
544
545
546
547
548
549
550
# File 'lib/rbt/compile_base/compile_base_module.rb', line 543

def create_a_new_current_symlink_here(i)
  target = "#{File.dirname(i)}/Current"
  if File.symlink? target
    remove_symlink(target)
  end
  e "#{rev}Creating a symlink at #{slateblue(i)}#{rev}."
  symlink(i, target)
end

#create_architecture_file(create_where = prefix?.to_s, can_we_create_the_architecture_file = is_on_gobolinux? ) ⇒ Object

#

create_architecture_file

This method here will create a file called “Architecture”.

The first argument, ‘create_where`, should be the AppDir path to the program in question, such as /Programs/Htop/Current.

#


286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
# File 'lib/rbt/compile_base/compile_base_module.rb', line 286

def create_architecture_file(
    create_where                        = prefix?.to_s,
    can_we_create_the_architecture_file = is_on_gobolinux?
  )
  if can_we_create_the_architecture_file
    this_architecture = `uname -m`
    resources_directory = rds("#{create_where}/Resources/")
    # ===================================================================== #
    # Point to the new target that will hold the file Architecture:
    # ===================================================================== #
    file_location = rds("#{resources_directory}Architecture")
    mkdir(resources_directory) unless File.directory? resources_directory
    # ===================================================================== #
    # Remove the old file it if already exists.
    # ===================================================================== #
    remove_file(file_location) if File.exist? file_location
    write_what_into(this_architecture, file_location)
  end
end
#

This will either use the RBT-internal class called RBT::SymlinkProgram; or it will, on GoboLinux, make use of SymlinkProgram instead.

#


593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
# File 'lib/rbt/compile_base/compile_base_module.rb', line 593

def do_invoke_symlink_program(
    i                        = compile_which_program?,
    use_this_program_version = program_version?
  )
  if use_gobolinux_symlinkprogram?
    # ================================================================= #
    # === Delegate onto GoboLinux next
    #
    # In this case, use the GoboLinux program called 'SymlinkProgram.'
    #
    # This program then requires two arguments:
    #
    #   (1) the program name, and
    #   (2) the program_version
    #
    # ================================================================= #
    # We should also check via 'NamingConventions'.
    # ================================================================= #
    _ = "SymlinkProgram #{compile_which_program?} #{use_this_program_version}"
    esystem _
  else
    symlink_program?.run
    # ================================================================= #
    # Since as of September 2022 we will use an action here. The
    # second argument must be the appdir-prefix to the corresponding
    # bin/ directory. We will, however had, also supply sbin/, for
    # compatibility reasons mostly - thus why an Array is passed.
    # ================================================================= #
    action(
      :symlink_into_the_usr_bin_hierarchy,
      [
        "#{prefix?}bin/",
        "#{prefix?}sbin/"
      ]
    )
  end
end

#do_play_song(song_location = '/home/x/songs/YoonDohyun_Dolgo.mp3', use_this_player = 'mpv') ⇒ Object Also known as: play_song

#

play_song

Play a song when the compilation phase has finished. This can be disabled via the configuration file, in the entry called play_song. Please call CONFIG.play_song before calling this method. We will play the audio file only if it exists, otherwise we will be silent.

#


208
209
210
211
212
213
214
215
# File 'lib/rbt/compile_base/compile_base_module.rb', line 208

def do_play_song(
    song_location =
      '/home/x/songs/YoonDohyun_Dolgo.mp3',
    use_this_player = 'mpv'
  )
  _ = "#{use_this_player} #{song_location} -endpos 4"
  esystem(_) if File.exist? song_location
end

#editor_to_use?Boolean

#

editor_to_use?

#

Returns:

  • (Boolean)


772
773
774
775
776
777
778
# File 'lib/rbt/compile_base/compile_base_module.rb', line 772

def editor_to_use?
  _ = ENV['EDITOR']
  if _.nil? or _.empty?
    _ = 'bluefish'
  end
  return _
end

#email?Boolean

#

email?

#

Returns:

  • (Boolean)


690
691
692
# File 'lib/rbt/compile_base/compile_base_module.rb', line 690

def email?
  RBT.configuration?.email.to_s
end

#exit_on_unregistered_cookbook_entries?Boolean

#

exit_on_unregistered_cookbook_entries?

#

Returns:

  • (Boolean)


744
745
746
# File 'lib/rbt/compile_base/compile_base_module.rb', line 744

def exit_on_unregistered_cookbook_entries?
  RBT.configuration?.exit_on_unregistered_cookbook_entries
end

#has_an_error_occurred?Boolean

#

has_an_error_occurred?

#

Returns:

  • (Boolean)


515
516
517
# File 'lib/rbt/compile_base/compile_base_module.rb', line 515

def has_an_error_occurred?
  RBT.has_an_error_occurred?
end

#host_cpu?Boolean

#

host_cpu?

#

Returns:

  • (Boolean)


529
530
531
# File 'lib/rbt/compile_base/compile_base_module.rb', line 529

def host_cpu?
  ::RBT.host_cpu?
end

#install_only_binaries?Boolean

#

install_only_binaries?

#

Returns:

  • (Boolean)


77
78
79
# File 'lib/rbt/compile_base/compile_base_module.rb', line 77

def install_only_binaries?
  @internal_hash[:install_only_binaries]
end

#installer_constant?Boolean

#

installer_constant?

#

Returns:

  • (Boolean)


827
828
829
# File 'lib/rbt/compile_base/compile_base_module.rb', line 827

def installer_constant?
  RBT::Action::SoftwareManager
end

#no_error_has_occurred?Boolean

#

no_error_has_occurred?

#

Returns:

  • (Boolean)


419
420
421
# File 'lib/rbt/compile_base/compile_base_module.rb', line 419

def no_error_has_occurred?
  !has_an_error_occurred?
end

#play_song?Boolean

#

play_song?

Query over as to whether we will play a song or not, after compilation has finished.

#

Returns:

  • (Boolean)


723
724
725
# File 'lib/rbt/compile_base/compile_base_module.rb', line 723

def play_song?
  RBT.configuration?.play_song
end

#recipes_dir?Boolean

#

recipes_dir?

#

Returns:

  • (Boolean)


730
731
732
# File 'lib/rbt/compile_base/compile_base_module.rb', line 730

def recipes_dir?
  RBT.configuration?.recipes_dir
end

#register_program(this_program = compile_which_program?, , can_we_register_the_program = RBT.register_program_files_into_yaml_database?) ⇒ Object

#

register_program

This method will register the program files into a yaml “database”.

The first argument to this method may be an AppDir (String) such as ‘/home/Programs/Libfontenc/1.1.5/’.

The second argument to this method can be used to determine whether we will really register the program at hand.

#


563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
# File 'lib/rbt/compile_base/compile_base_module.rb', line 563

def register_program(
    this_program                = compile_which_program?,
    can_we_register_the_program = RBT.register_program_files_into_yaml_database?
  )
  if can_we_register_the_program
    require 'rbt/utility_scripts/register_program_files_into_yaml_database.rb'
    if this_program.include?('/')
      # In this case assume a target such as
      # "/home/Programs/Libfontenc/1.1.5/"
      appdir_prefix_of_this_program = this_program.dup
    else # else we have to determine the AppDir on our own
      appdir_prefix_of_this_program = static_appdir_prefix_of?(this_program)
    end
    # ===================================================================== #
    # Next we will delegate towards class
    # RBT::RegisterProgramFilesIntoYamlDatabase, but this can be
    # controlled via the above flag.
    # ===================================================================== #
    RBT::RegisterProgramFilesIntoYamlDatabase.new(
      appdir_prefix_of_this_program
    ) # bl RegisterProgramFilesIntoYamlDatabase
  end
end

#remove_compiling_is_in_progress(this_file = 'COMPILING_IS_IN_PROGRESS.md') ⇒ Object

#

remove_compiling_is_in_progress

We must get rid of special files. Right now only of a file called “COMPILING_IS_IN_PROGRESS” - this file will be created when we start compiling.

#


224
225
226
227
228
# File 'lib/rbt/compile_base/compile_base_module.rb', line 224

def remove_compiling_is_in_progress(
    this_file = 'COMPILING_IS_IN_PROGRESS.md'
  )
  remove_file(this_file) if File.exist? this_file
end

#report_to_developers(this_email = RBT.configuration?.email) ⇒ Object

#

report_to_developers

Feedback information to the user so that he can report useful information to the project lead.

#


786
787
788
789
790
791
792
793
794
795
796
797
798
# File 'lib/rbt/compile_base/compile_base_module.rb', line 786

def report_to_developers(
    this_email = RBT.configuration?.email
  )
  ewarn 'To report to the developer(s) of RBT, use this '\
        'email address:'
  opnn; efancy "  #{this_email}"
  opnwarn 'You can also use this URL:'
  opnn; efancy "  #{RBT_HOMEPAGE_URL}"
  if RBT_HOMEPAGE_URL.include? 'rbt'
    opnn; efancy '  https://rubygems.org/profiles/58718/'
  end
  opne
end

#reset_the_moduleObject

#

reset_the_module

#


41
42
43
44
45
46
47
48
49
# File 'lib/rbt/compile_base/compile_base_module.rb', line 41

def reset_the_module
  # ======================================================================= #
  # === :silent_redirection
  #
  # The following instance-variable can be used to determine whether we
  # will silently redirect the output-stream or whether we will not.
  # ======================================================================= #
  @internal_hash[:silent_redirection] = false
end

#return_build_typeObject

#

return_build_type

#


654
655
656
# File 'lib/rbt/compile_base/compile_base_module.rb', line 654

def return_build_type
  return ::RBT.build_type?
end

#return_chained_programsObject

#

return_chained_programs

#


488
489
490
# File 'lib/rbt/compile_base/compile_base_module.rb', line 488

def return_chained_programs
  ::RBT.chained_programs?
end

#return_files_from_the_profiles_directory(target_directory = DIRECTORY_RBT_PROFILES) ⇒ Object

#

return_files_from_the_profiles_directory

This method will return all .md files from the RBT profiles directory.

#


235
236
237
238
239
# File 'lib/rbt/compile_base/compile_base_module.rb', line 235

def return_files_from_the_profiles_directory(
    target_directory = DIRECTORY_RBT_PROFILES
  )
  Dir["#{target_directory}*.md"]
end

#return_these_programs(i) ⇒ Object

#

return_these_programs

This method will essentially return the information stored in the file ‘chained_programs.yml’.

#


481
482
483
# File 'lib/rbt/compile_base/compile_base_module.rb', line 481

def return_these_programs(i)
  return return_chained_programs[i.to_s]
end

#run_ldconfig?Boolean Also known as: use_ldconfig?

#

run_ldconfig?

#

Returns:

  • (Boolean)


751
752
753
# File 'lib/rbt/compile_base/compile_base_module.rb', line 751

def run_ldconfig?
  RBT.configuration?.run_ldconfig
end
#
#

Returns:

  • (Boolean)


84
85
86
# File 'lib/rbt/compile_base/compile_base_module.rb', line 84

def shall_we_symlink_the_header_files_into_the_usr_include_hierarchy?
  @internal_hash[:shall_we_symlink_the_header_files_into_the_usr_include_hierarchy]
end

#store_full_configure_command_into_resources_directoryObject

#

store_full_configure_command_into_resources_directory

We will store the full configure command into:

/Programs/Name/Version/Resources/full_configure_command
#


431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
# File 'lib/rbt/compile_base/compile_base_module.rb', line 431

def store_full_configure_command_into_resources_directory
  what = full_configure_command?
  unless what.strip.empty?
    # ===================================================================== #
    # Designate the file into where to store this:
    # ===================================================================== #
    into = real_prefix?.to_s.dup
    into << '/Resources/full_configure_command.md'
    unless File.directory? File.dirname(into)
      mkdir(File.dirname(into))
    end
    # ===================================================================== #
    # Remove old files at that position first.
    # ===================================================================== #
    delete_file(into) if File.exist? into
    append_what_into(what, into)
  end
end
#

Use this method if you want to symlink into /System/Tags/*

The first argument to this method is the name of the program at hand.

The second argument to this method is target_directory, which may either be an AppDir, or another (non-AppDir) prefix.

If there are no entries under the bin/ subdirectory, or not registered as binary for that program, then this method will not symlink anything at all.

#


103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# File 'lib/rbt/compile_base/compile_base_module.rb', line 103

def symlink_into_tags(
    compile_this_program = compile_which_program?,
    target_directory     = real_prefix?.to_s,
    dataset_to_use       = cookbook_dataset?,
    use_tags             = use_tags?
  )
  # ======================================================================= #
  # Handle tags only when we have specified so via the configuration
  # file "use_tags.yml". The following check ensures exactly that.
  # ======================================================================= #
  if use_tags
    # ===================================================================== #
    # So the next job is to obtain the tags.
    # ===================================================================== #
    tags = [dataset_to_use.tags?].flatten.compact
    if tags and !tags.empty? # Ok, we found tags here - and they are not empty.
      tags.each {|this_tag|
        # case this_tag # A bit sanitizing.
        # when 'game' # From game to games.
        #   this_tag = 'games'
        # end # <- No longer allowed since as of Feb 2017. Will be
        # removed past the middle of 2019 or so; perhaps a bit later
        # than that, but eventually it will be gone.
        # ================================================================= #
        # If you wish to CamelCase directory names, then the
        # following line will achieve precisely this. We will
        # CamelCase these tags.
        # ================================================================= #
        if this_tag.include? '_'
          this_tag = this_tag.split('_').map {|e| e.capitalize }.join
        end
        this_tag[0,1] = this_tag[0,1].upcase # Nicer to have capitalized directories.
        # ================================================================= #
        # We have to ensure that the relevant /System/Tags/* subdirectory does
        # actually exist. And if not, then we must create it.
        # ================================================================= #
        target_directory_for_the_system_tags = "#{system_tags?}#{this_tag}/"
        unless File.directory? target_directory_for_the_system_tags
          create_directory(target_directory_for_the_system_tags) # <- Create the subdirectory here.
        end
        # ================================================================= #
        # Next, obtain all binaries of the given program. This will include
        # both bin/ and sbin/ subdirectories. However had, the code here
        # will only work if we have compiled something as an AppDir. For
        # non-appdir programs we have to fetch the binaries that are
        # registered for that particular program.
        # ================================================================= #
        if uses_an_appdir_prefix?(target_directory)
          all_binaries = Dir["#{target_directory}bin/*"]
          if File.directory? "#{target_directory}sbin/"
            all_binaries << Dir["#{target_directory}sbin/*"] # <- Add sbin/ entries here.
            all_binaries.flatten!
          end
        else
          all_binaries = dataset_to_use.binaries?
          # =============================================================== #
          # And cd to the target directory, aka, the prefix.
          # =============================================================== #
          cd target_directory
        end
        unless all_binaries.empty?
          opne "We will next symlink the various tags into the `"\
               "#{sdir(target_directory_for_the_system_tags)}#{rev}` "\
               "hierarchy."
          all_binaries.each { |binary|
            # ============================================================= #
            # We must find the target next:
            # ============================================================= #
            _ = target_directory_for_the_system_tags+File.basename(binary)
            if File.exist? "bin/#{binary}"
              binary = return_pwd+'bin/'+binary
            elsif File.exist? 'sbin/'+binary
              binary = return_pwd+'sbin/'+binary
            end
            # ============================================================= #
            # We have to check if the target already exists. The current
            # behaviour (Oct 2018) is to delete the old target, if it is
            # a symlink. This will also get rid of symlinks that are
            # invalid - e. g. no longer point at a correct target.
            # ============================================================= #
            if File.symlink?(_)
              if is_on_roebe?
                opne "Deleting the old symlink at `#{royalblue(_)}`."
              end
              delete_symlink(_) # <- Get rid of the old symlink finally.
            end
            symlink(
              from: binary,
              to:   _
            )
          }
        end
      }
    end
  end
end
#
#

Returns:

  • (Boolean)


350
351
352
# File 'lib/rbt/compile_base/compile_base_module.rb', line 350

def symlink_into_usr_lib_dir?
  @internal_hash[:symlink_into_usr_lib_dir]
end
#

The various .m4 macros usually reside within the share/ subdirectory.

So in order to symlink them, we need to enter that directory.

This method is called from do_postinstall_actions().

#


501
502
503
504
505
506
507
508
509
510
# File 'lib/rbt/compile_base/compile_base_module.rb', line 501

def symlink_m4_macros(
    i, do_run_fetch_all_m4_macros = do_run_fetch_all_m4_macros?
  )
  if do_run_fetch_all_m4_macros
    # ===================================================================== #
    # Delegate the job to class RBT::FetchAllM4Macros
    # ===================================================================== #
    RBT::FetchAllM4Macros.new(i) { :do_not_report_anything_if_there_were_no_matches }
  end
end
#
#


634
635
636
637
638
639
640
641
642
# File 'lib/rbt/compile_base/compile_base_module.rb', line 634

def symlink_program(this_program)
  unless RBT.const_defined? :SymlinFromToCurrent
    begin
      require 'rbt/requires/require_symlink_this_program.rb'
    rescue LoadError
    end
  end
  RBT::SymlinkFromToCurrent.new(this_program)
end
#
#

Returns:

  • (Boolean)


536
537
538
# File 'lib/rbt/compile_base/compile_base_module.rb', line 536

def symlink_program?
  @internal_hash[:symlink_program]
end

#update_kde_appsObject

#

update_kde_apps

#


813
814
815
# File 'lib/rbt/compile_base/compile_base_module.rb', line 813

def update_kde_apps
  action(:UpdateKdeApplications)
end

#use_ccache?Boolean

#

use_ccache?

Whether we will make use of ccache or whether we don’t, by default.

#

Returns:

  • (Boolean)


699
700
701
# File 'lib/rbt/compile_base/compile_base_module.rb', line 699

def use_ccache?
  RBT.configuration?.use_ccache
end

#use_gobolinux_symlinkprogram?Boolean

#

use_gobolinux_symlinkprogram?

#

Returns:

  • (Boolean)


522
523
524
# File 'lib/rbt/compile_base/compile_base_module.rb', line 522

def use_gobolinux_symlinkprogram?
  @internal_hash[:use_gobolinux_symlinkprogram]
end

#use_mrxvt?Boolean

#

use_mrxvt?

#

Returns:

  • (Boolean)


706
707
708
# File 'lib/rbt/compile_base/compile_base_module.rb', line 706

def use_mrxvt?
  RBT.configuration?.use_mrxvt
end

#use_porg?Boolean

#

use_porg?

Whether we will use porg for installation or whether we will not.

Most users probably do not need/want this, so this is mostly for my home system, but also those users who may wish to use porg.

#

Returns:

  • (Boolean)


666
667
668
# File 'lib/rbt/compile_base/compile_base_module.rb', line 666

def use_porg?
  RBT.configuration?.use_porg
end

#use_stow?Boolean

#

use_stow?

#

Returns:

  • (Boolean)


683
684
685
# File 'lib/rbt/compile_base/compile_base_module.rb', line 683

def use_stow?
  RBT.configuration?.use_stow
end

#use_tags?Boolean

#

use_tags?

#

Returns:

  • (Boolean)


713
714
715
# File 'lib/rbt/compile_base/compile_base_module.rb', line 713

def use_tags?
  RBT.configuration?.use_tags
end

#uses_appdir_prefix?(use_this_as_prefix = prefix?.to_s, use_this_as_cookbook_dataset = cookbook_dataset? ) ⇒ Boolean Also known as: is_installed_in_an_appdir_like_fashion?, is_an_appdir_program?, is_appdir_compilation_style?, is_an_appdir_installation?, uses_an_appdir_prefix?, use_appdir_prefix?, appdir_prefix?, uses_appdir_approach?, did_we_use_an_appdir_prefix?

#

uses_appdir_prefix?

This method will return true if the program at hand is compiled in an AppDir-like fashion (e. g. having a prefix including the String “/Programs/” directory), and false otherwise.

#

Returns:

  • (Boolean)


457
458
459
460
461
462
463
464
465
# File 'lib/rbt/compile_base/compile_base_module.rb', line 457

def uses_appdir_prefix?(
    use_this_as_prefix           = prefix?.to_s,
    use_this_as_cookbook_dataset = cookbook_dataset?
  )
  if use_this_as_cookbook_dataset.nil?
    ensure_dataset_for_this_program(compile_which_program?)
  end
  use_this_as_prefix.to_s.include? programs_dir?
end

#validate_the_cookbook_aliasesObject

#

validate_the_cookbook_aliases

#


820
821
822
# File 'lib/rbt/compile_base/compile_base_module.rb', line 820

def validate_the_cookbook_aliases
  action(:ValidateCookbookAliases) # bl $RUBY_COOKBOOKS/lib/cookbooks/validate_cookbook_aliases.rb
end