Class: OBSOLETE

Inherits:
Object
  • Object
show all
Defined in:
lib/rbt/actions/individual_actions/installer/aggregate.rb

Instance Method Summary collapse

Instance Method Details

#invoke_extracter(i = program_path?, , extract_to_this_directory = extract_where_to?, , keep_the_old_directory_if_it_exists = false) ⇒ Object

#

invoke_extracter

Delegate towards class Extracter next.

#


8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/rbt/actions/individual_actions/installer/aggregate.rb', line 8

def invoke_extracter(
    i                                   = program_path?,
    extract_to_this_directory           = extract_where_to?,
    keep_the_old_directory_if_it_exists = false
  )
  
  case extract_to_this_directory
  when nil
    extract_to_this_directory = will_be_extracted_towards?
    @internal_hash[:extract_to_this_directory_as_specified_by_the_user] =
      extract_to_this_directory
    set_extract_to_this_directory(extract_to_this_directory)
  end
  yielded = nil
  case keep_the_old_directory_if_it_exists # case tag.
  # ======================================================================= #
  # === :do_keep_the_old_directory_if_it_exists,
  # ======================================================================= #
  when :do_keep_the_old_directory_if_it_exists,
       :keep_the_old_directory_if_it_exists
    keep_the_old_directory_if_it_exists = true
  end
  # ======================================================================= #
  # === Handle blocks given to this method next:
  # ======================================================================= #
  if block_given?
    yielded = yield
    case yielded
    # ===================================================================== #
    # === :keep_the_old_directory_if_it_exists
    # ===================================================================== #
    when :keep_the_old_directory_if_it_exists
      keep_the_old_directory_if_it_exists = true
    else
      # =================================================================== #
      # === Handle Hashes next
      # =================================================================== #
      if yielded.is_a? Hash
        # ================================================================= #
        # === :append_to_the_commandline
        # ================================================================= #
        if yielded.has_key? :append_to_the_commandline
          append_to_the_commandline << yielded[:append_to_the_commandline]
        end
      end
    end
  end
  unless skip_extracting?
    case extract_to_this_directory
    # ===================================================================== #
    # === :default
    # ===================================================================== #
    when :default
      extract_to_this_directory = will_be_extracted_towards?
    end
    # ===================================================================== #
    # Remove the extracted directory if it exists next. This will,
    # however had, NOT be done if we extract to another target
    # directory, such as when issuing a command like
    # "ry htop --extract-to=/opt/test".
    # ===================================================================== #
    # possibly_existing_old_extracted_archive = cookbooks_dataset_extracted_towards?
    # unless possibly_existing_old_extracted_archive.include? extract_to?
      # =================================================================== #
      # In this case we reasonably assume that the user has NOT given a
      # --extract-to value.
      #
      # Keep in mind that the user may specify another temp-directory,
      # which explains the check for user-input.
      # =================================================================== #
      if cookbooks_for? and !keep_the_old_directory_if_it_exists
        _ = will_be_extracted_towards?
        if @internal_hash.has_key?(:extract_to_this_directory_as_specified_by_the_user) and
           @internal_hash[:extract_to_this_directory_as_specified_by_the_user]
          _ = @internal_hash[:extract_to_this_directory_as_specified_by_the_user]
        end
        unless (_.squeeze('/').strip == '/') # Prevent erroneous removal of /.
          if File.directory?(_)
            _ = _.dup if _.frozen?
            if (_ == rbt_log_dir?)
              opnerror 'A problem was encountered, but this should never happen.'
              opnerror 'RBT::Action::SoftwareManager tried to remove the base directory at '+
                       sdir(rbt_log_dir?)
              opnerror 'which was the same as the passed directory `'+sdir(_)+'`.'
              e
              opnerror 'Something must be wrong in the information-chain, such as a'
              opnerror 'faulty .yml file. Please review the information shown above'
              opnerror 'and make sure that the used .yml file is correct.'
              e
              exit_program { :exit_no_matter_what }
            else
              _.strip!
              _.squeeze!('/')
              # =========================================================== #
              # Notify the user that we will remove the old directory next.
              # =========================================================== #
              notify_the_user_that_this_old_directory_will_be_removed_next(_)
              remove_directory(_)
            end
          end
        end
      end
    # end
  end
end

#parse_this_line_obtained_via_io_popen(line, use_colours = use_colours?, , use_inner_padding = false) ⇒ Object

#

parse_this_line_obtained_via_io_popen (io-open tag, sys tag)

This method is used to parse all output generated via IO.popen().

#


482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
# File 'lib/rbt/actions/individual_actions/installer/aggregate.rb', line 482

def parse_this_line_obtained_via_io_popen(
    line,
    use_colours       = use_colours?,
    use_inner_padding = false
  )
  case use_colours
  # ======================================================================= #
  # === :default
  # ======================================================================= #
  when :default
    use_colours = use_colours?
  end
  # ======================================================================= #
  # Delegate towards class ColourizeParser next.
  # ======================================================================= #
  cparser = @internal_hash[:colourize_parser]
  unless use_colours
    cparser.disable_colours
  end
  line.chomp!
  # ======================================================================= #
  # Feed towards module RBT::Errors::MapLineToASpecificError next:
  # ======================================================================= #
  RBT::Errors::MapLineToASpecificError.parse_this_line(line)
  # ======================================================================= #
  # Next, put the line towards ColourizeParser. The reason why this is
  # done after the error checking above is to simply keep the output
  # as it was originally, before changing it via colours and the like.
  # ======================================================================= #
  cparser.grab_this_line(line)
  line = cparser.line?.dup
  # ======================================================================= #
  # === A required package was not found
  #
  # Notify the user about this problem.
  # ======================================================================= #
  if line.include?('A required package was not found') and
     !RBT::Errors::MapLineToASpecificError.required_packages?.empty?
    name_of_the_package = RBT::Errors::MapLineToASpecificError.required_packages?.first.to_s
    # ===================================================================== #
    # That name may end with -4, such as "gtksourceview-4". This is not
    # good as we report this, but the user should really just use
    # "gtksourceview" instead - hence the following check.
    # ===================================================================== #
    if name_of_the_package.include?('-') and (name_of_the_package =~ /-\d{1,20}$/)
      name_of_the_package = name_of_the_package.split('-')[0 .. -2].join('-')
    end
    line << ' '+crimson("( → #{name_of_the_package} is missing)")
    line << "#{N}#{N}You can try to install it via:#{N}"
    line << "#{N}#{slateblue('  rbt '+name_of_the_package)}#{N}#{N}"
  end
  # ======================================================================= #
  # The reason we output the line here is so that we can still do
  # modifications to it, if we have to. This is the case e. g. for
  # when we wish to display which package is missing.
  # ======================================================================= #
  if use_inner_padding
    e
    e "  #{line}" # Output here.
    e
  else
    e line # Output here.
  end
  if line.include?('configure: No such file or directory')
    opne rev+'The '+crimson('above error message')+rev+
         ' most likely means '\
         'that no configure script could be found.'
  end
  @internal_hash[:array_sys_command_string] << line # We could also store the lines here.
end

#run_makeObject Also known as: run_make_command, considering_running_make_command_via_system

#

run_make (make tag, Makefile tag)

This is the wrapper method over “make”.

This method will, in the end, delegate towards RBT.colour_make, which in turn runs the command/binary called “make”.

The specific command that will be used, in this case “make”, can also be a different one, as defined by the respective .yml file for the given program at hand. Not all programs require “make” for their compilation.

The method will also have to ensure that a Makefile-file exists, but only for installation types that do happen to require a Makefile.

Some build systems, such as meson/ninja, may use ‘make’, but may also skip it and do “ninja install” instead.

#


629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
# File 'lib/rbt/actions/individual_actions/installer/aggregate.rb', line 629

def run_make
  if exit_before_make?
    opne "#{rev}Exiting now as instructed before "\
         "reaching the \"#{orange('make')}\" stage."
    exit_program
  end
  # ======================================================================= #
  # === Determine whether the Makefile has to be modified or not.
  # ======================================================================= #
  if modify_the_makefile?
    opne rev+'The Makefile will be modified next ('+
         steelblue('PREFIX')+' value will be changed).'
    do_use_this_makefile_here = "#{return_pwd}Makefile"
    # ======================================================================= #
    # Delegate towards RBT::ChangePrefix next.
    # ======================================================================= #
    RBT::ChangePrefix.new(
      use_this_makefile:          do_use_this_makefile_here,
      use_this_as_the_new_prefix: prefix?.to_s.dup
    )
  end
  if run_make?
    # ======================================================================= #
    # "make" is usually used, but we may also make use of "ninja" instead,
    # so we have to pass in this option towards RBT.colour_make.
    # ======================================================================= #
    if run_simulation?
      opne "#{rev}We are running a simulation, hence the following command"
      opne "#{rev}will not be run:"
      opnfancy "  #{make_command?}"
    else
      # =================================================================== #
      # Clear the old buffer first:
      # =================================================================== #
      reset_error_map_line_to_a_specific_error
      if has_to_be_compiled?
        consider_using_maximum_speed_for_compilation
      end
      # =================================================================== #
      # We will have to make a cd-operation to the configure base directory
      # if run_configure is no/false and if we use a build directory.
      #
      # This, however had, breaks cmake builds, so it was disabled in
      # February 2019. It may have to be changed at a later time
      # anyway.
      # =================================================================== #
      # if !run_configure? and use_build_directory?
      #   cd_to_the_configure_base_directory
      # end
      # =================================================================== #
      # Next consider running pre-make commands - but this must come
      # AFTER running GNU configure and similar build-style runs.
      # =================================================================== #
      consider_running_premake_instructions
      unless installation_steps?.empty?
        installation_steps?.each {|this_step|
          opne "Next doing this step: #{sfancy(this_step)}"
          esystem this_step
        }
      end
      # =================================================================== #
      # Delegate towards RBT.colour_make next:
      # =================================================================== #
      _ = use_which_system_command?
      case _
      # =================================================================== #
      # === :ioparser
      #
      # This is the more sophisticated ioparser variant.
      # =================================================================== #
      when :ioparser,
           :default
        RBT.colour_make {
          return_default_hash_to_be_passed_into_colour_make
        }
      # =================================================================== #
      # === :system
      #
      # This is the simple system-variant.
      # =================================================================== #
      when :system
        cmd = use_this_make_command?.to_s.dup
        hash = return_default_hash_to_be_passed_into_colour_make
        if hash.has_key? :append_these_options
          cmd << hash[:append_these_options].join(' ')
        end
        cmd = cmd.strip.squeeze(' ')
        coloured_and_padded_esystem(cmd)
      else
        e "Unknown system-command: #{steelblue(_.to_s)}"
      end
    end
    run_through_the_registered_problems_registered_errors_and_behaviour_changes
    reset_error_map_line_to_a_specific_error
    if automatically_create_package?
      if is_on_slackware?
        # =================================================================== #
        # Create a slackware-package in this case.
        # =================================================================== #
        opne rev+'Next trying to create a package for `'+
             royalblue('slackware')+rev+'`.'
        # The following subsection is incomplete. The path could be used
        # to find out whether things are put in their right position.
        # path = create_slackware_description_file
        RBT.run_makepkg_command(compile_which_program?, program_version?)
      end
    end
  end
end

#run_system_or_ioparser_command(i, use_colours = use_colours?, , use_padding = true, show_the_command_used = true, &block) ⇒ Object Also known as: run_this_sys_command, custom_system, run_this_system_command, run_this_command

#

run_system_or_ioparser_command (iopen tag)

This method will, by default, try to make use of IO.popen.

The alternatives, system() or backticks, are not as useful, in my opinion. However had, the user can use these others variants as well, since as of July 2020.

The current idea is to work on a line-by-line basis when IO.popen is used, and to also display what is done, so that the user has an idea what is happening.

There is also the possibility to use colours and colourize the input; this allows us to, for example, use specific colours for directories or for files or to indicate failures.

Usage example:

run_this_system_command_in_a_coloured_and_padded_manner(full_configure_command?) { :also_pad_via_cliner }
#


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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# File 'lib/rbt/actions/individual_actions/installer/aggregate.rb', line 136

def run_system_or_ioparser_command(
    i,
    use_colours           = use_colours?,
    use_padding           = true,
    show_the_command_used = true,
    &block
  )
  yielded = nil      
  if block_given?
    yielded = yield
  end
  case use_colours
  # ======================================================================= #
  # === :default
  # ======================================================================= #
  when :default
    use_colours = use_colours?
  end
  use_this_colour = :konsole_dodgerblue # ← dodgerblue
  set_pid(nil) # Reset the PID here.
  # ======================================================================= #
  # === The usere wants to do something with "make" past this point here
  #
  # I still do not quite understand the second argument. Either way,
  # I have determined that this works better.
  #
  #   ffmpeg = IO.popen(cmdline + " #{SHELL_ERROR_CODE}", "w+")
  #
  # ======================================================================= #
  if i and i.start_with?('make')
    unless is_make_available?
      # =================================================================== #
      # We need to inform the user that the "make" binary is not available.
      # =================================================================== #
      orev "The program \"#{sfancy('make')}\" #{rev}is "\
           "#{swarn('not available')}#{rev}, at the least not as  "\
           "part of the #{steelblue('$PATH')} #{rev}variable."
      orev "RBT::Action::SoftwareManager thus can not compile anything. You "\
           "may want to check the #{orange('$PATH')} variable."
      do_not_continue_and_do_not_compile(:be_quiet)
      return
    end
  end
  i = i.dup if i.frozen? # Work on a copy, just in case.
  i.strip!
  # ======================================================================= #
  # Next append shell-error-code, which is just ' 2>&1' really.
  # The user can disable this, though, via --do-not-append-no-error,
  # hence the following if-clause.
  # ======================================================================= #
  if append_shell_error_code?
    i << " #{SHELL_ERROR_CODE}" unless i.end_with? " #{SHELL_ERROR_CODE}"
  end
  # ======================================================================= #
  # We have to determine whether we will ultimately run a system()
  # variant or Ioparser
  # ======================================================================= #
  case use_which_system_command?
  # ======================================================================= #
  # === :ioparser
  # ======================================================================= #
  when :ioparser
    if show_the_command_used
      case yielded
      when :also_pad_via_cliner
        if use_colours?
          cliner(use_colour: use_this_colour)
        else
          cliner
        end
      end
      coloured_and_padded_e(i, :default, :inner_padding)
      case yielded
      when :also_pad_via_cliner
        if use_colours?
          cliner(use_colour: use_this_colour)
        else
          cliner
        end
      end
    end
    io_object = IO.popen(i, {:err => [:child, :out]})
    set_pid(io_object.pid)
    io_object.each { |line|
      # =================================================================== #
      # The next line will also display what has happened.
      # =================================================================== #
      parse_this_line_obtained_via_io_popen(line, use_colours)
    }
    io_object.close
    # ======================================================================= #
    # Right now only the io-parser above can handle the sys-command
    # strings.
    # ======================================================================= #
    # Next, we attempt to determine what some of the errors may be and
    # perhaps even how to resolve them.
    # ======================================================================= #
    # Handle "no configure file" next.
    # ======================================================================= #
    if array_sys_command_string? and
       array_sys_command_string?.any? {|line|
        line.include? 'sh: ./configure: No such file or directory'
      }
      problem_is :no_configure_file
    # ======================================================================= #
    # Handle missing headers next.
    # ======================================================================= #
    elsif array_sys_command_string?.any? {|line|
        line.include? 'headers are missing'
      }
      _ = array_sys_command_string?.select {|line|
        line.include? 'headers are missing'
      }
      problem_is _
    end
  # ======================================================================= #
  # === :simple_system
  #
  # This entry point is for simple system() calls.
  # ======================================================================= #
  when :simple_system,
       :system
    if use_padding and show_the_command_used
      case yielded
      when :also_pad_via_cliner
        if use_colours?
          cliner(use_colour: use_this_colour)
        else
          cliner
        end
      end
      coloured_and_padded_esystem "#{cmd}", :default, :inner_padding
      case yielded
      when :also_pad_via_cliner
        if use_colours?
          cliner(use_colour: use_this_colour)
        else
          cliner
        end
      end
    else
      if show_the_command_used
        case yielded
        when :also_pad_via_cliner
          if use_colours?
            cliner(use_colour: use_this_colour)
          else
            cliner
          end
        end
        colourized_and_padded_esystem(cmd)
        case yielded
        # ================================================================= #
        # === :also_pad_via_cliner
        # ================================================================= #
        when :also_pad_via_cliner
          if use_colours?
            cliner(use_colour: use_this_colour)
          else
            cliner
          end
        end
      else
        system(cmd)
      end
    end
  end
end

#set_install_these_programs(i = first_argument?, , consider_replacing_the_given_input = :honour_user_configuration_setting) ⇒ Object Also known as: set_compile_these_programs, set_array_compile_these_programs, compile_this=, determine_which_programs_to_compile, set_work_on_this_program

#

set_install_these_programs

This setter-method will designate which programs are to be installed/compiled.

The format for this will be an Array, such as:

['htop','ruby','php']

Note that this method will remove all ‘-’ tokens from the given input at hand, if the second argument given to this method allows this method to do so.

#


323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
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
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
# File 'lib/rbt/actions/individual_actions/installer/aggregate.rb', line 323

def set_install_these_programs(
    i                                  = first_argument?,
    consider_replacing_the_given_input = :honour_user_configuration_setting
  )
  if i.nil? or i.empty?
    i = DEFAULT_PROGRAM
  end
  i = i.dup if i and i.is_a?(String) and i.frozen?
  case consider_replacing_the_given_input
  # ======================================================================= #
  # === :default
  # ======================================================================= #
  when :default
    consider_replacing_the_given_input = true
  # ======================================================================= #
  # === :do_not_replace
  #
  # In this case we may not replace the given input.
  # ======================================================================= #
  when :do_not_replace
    consider_replacing_the_given_input = false
  # ======================================================================= #
  # === :honour_user_configuration_setting
  # ======================================================================= #
  when :honour_user_configuration_setting,
       :honour_user_settings
    if will_we_make_use_of_abbreviations?
      consider_replacing_the_given_input = 
        @internal_hash[:make_use_of_the_cookbook_aliases]
    else
      consider_replacing_the_given_input = false
    end
  end
  # ======================================================================= #
  # We may not replace anything in this case, as otherwise
  # "--lxqt" may become "--lxqtconfig" or just "lxqtconfig"
  # which is not desirable. But sometimes this is useful,
  # so ...
  # ======================================================================= #
  unless is_an_archive?(i)
    _ = i.to_s.dup.downcase.delete('/') # ← Get rid of some unwanted characters. But no longer of '-'.
    _replace_or_dont_replace = :honour_user_settings
    if _.start_with?('--')
      _replace_or_dont_replace = :do_not_replace
      # This is not yet in use ^^^.
    else
      i = remove_archive_at_the_end(File.basename(_))
    end
  end
  # ======================================================================= #
  # Next, look for chained-programs.
  # ======================================================================= #
  _ = dataset_from_the_file_cookbook_chained_programs?
  if _.has_key?(i) and
    !does_include?(i)
    i = _[i]
  end
  # ======================================================================= #
  # Past this point we don't want "--" entries.
  # ======================================================================= #
  i = [i].flatten.compact.reject {|entry|
    entry.start_with? '--'
  }
  i.map! {|entry|
    entry = entry.to_s.dup
    # ======================================================================= #
    # === Handle the possibility of replacing the given input at hand
    #
    # This clause is triggered when the user wishes to replace
    # the given input at hand.
    #
    # Invocation example:
    #
    #   trad libx
    #
    # ======================================================================= #
    if consider_replacing_the_given_input
      # =================================================================== #
      # First, check for .pc files directly. That way we can find the
      # real program at hand; and if not then the .pc suffix will be
      # dropped anyway.
      # =================================================================== #
      if entry.end_with? '.pc'
        _ = RBT.return_the_associated_program_of_this_pkgconfig_file(entry)
        unless _ == entry
          opne 'This .pc file is registered and points to '\
               'the program called '+steelblue(_)+'.'
          opne 'It will be used as input next.'
          entry = _
        end
        entry.delete_suffix!('.pc') if entry.end_with? '.pc'
      end
      entry.delete_suffix!('.yml') if entry.end_with? '.yml'
      entry.chop! if entry.end_with? ':','#' # Get rid of trailing ':' and '#'.
      # entry = entry.delete('-').downcase # All gets downcased. \o/
      # ^^^ removeing '-' can be problematic.
      entry = entry.downcase
      unless File.exist? entry
        if is_an_archive?(entry)
          entry = remove_archive_at_the_end(entry)
          if entry.include?('-') and (entry =~ /\d+/)
            # ============================================================= #
            # Assume entries such as this one here:
            #   mate-panel-1.21.3
            # ============================================================= #
            program_name     = ProgramInformation.return_name(entry)
            _program_version = ProgramInformation.return_version(entry)
            entry = program_name
          end
        end
      end
      entry = File.basename(entry) if entry.include? '/'
      unless RBT.is_this_program_registered?(entry)
        _ = action(:MapThisInputToThatRegisteredProgram, entry) { :be_quiet }
        new_entry = _.return_possible_match
        if new_entry and
          (new_entry.to_s != entry.to_s)
          type = _.type?
          a_or_an = a_or_an?(type)
          opne "#{rev}Replacing #{steelblue(entry)}"+
               rev+' with '+mediumslateblue(new_entry)+rev+
               ", as input. It is #{a_or_an} #{rev}"+
               mediumorchid(type.tr('_',' '))+"#{rev}."
          entry = new_entry
        end
      end unless entry.to_s.start_with? '--' # Exclude "--flag" options here.
    end
    entry
  }
  # ======================================================================= #
  # We will also initialize the cookbook_dataset for the first program,
  # if possible. We will also delete '.' characters since as of September
  # 2019, as some programs may be called e. g. "ruamel.yaml".
  # This was disabled in September 2022.
  # ======================================================================= #
  # original_first_program = RBT.compile_these_programs?.first.to_s
  # first_program = File.basename(
  #   original_first_program.downcase.delete('/.')
  # )
  # if first_program and RBT.is_this_program_included?(first_program)
  #   # ===================================================================== #
  #   # Set the initial seeds for the programs at hand.
  #   # ===================================================================== #
  #   set_compile_this_program(first_program)
  #   initialize_cookbook_dataset_for(first_program)
  # end
  ::RBT.set_install_these_programs(i) { :remove_underscore }
end

#set_install_this_program(i, &block) ⇒ Object Also known as: set_handle_this_program, set_compile_this_program, set_program_name

#

set_install_this_program

This method is called set_handle_this_program() in class RBT::Action::SoftwareManager.

#


558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
# File 'lib/rbt/actions/individual_actions/installer/aggregate.rb', line 558

def set_install_this_program(
    i,
    &block
  )
  return if i and
            i.respond_to?(:start_with?) and
            i.start_with?('--') # Ignore '--' entries.
  if i.is_a? Array # Only consider the first input argument here.
    i = i.first
  end
  i = i.to_s.dup
  # ======================================================================= #
  # === Ad-hox fix libtool files if given to RBT::Action::SoftwareManager next
  #
  # Invocation example:
  #
  #   rbt libgdk-3.la
  #
  # ======================================================================= #
  if i.respond_to?(:end_with?) and
     i.end_with?('.la') and
    !File.exist?(i)
    do_not_try_to_autofix
    opne "#{rev}Trying to autocorrect the libtool entry at "\
         "#{royalblue(i)}"
    try_to_autocorrect_this_erroneous_libtool_entry(i)
    return # And "exit" here.
  end
  # ======================================================================= #
  # Enable is-on-gobolinux if a certain .md file exists:
  # ======================================================================= #
  target_file = "#{log_dir?}is_on_gobolinux.md"
  if File.exist?(target_file) and
    !File.empty?(target_file)
    # ======================================================================= #
    # The above file must have been set on a GoboLinux system, when the
    # user did a rbt --auto before (or created the file manually).
    # ======================================================================= #
    enable_is_on_gobolinux
  end
  # ======================================================================= #
  # Keep track of the program we are compiling in the following variable;
  # after all that's the whole point of this method.
  # ======================================================================= #
  i = i.dup # Must be a String.
  @internal_hash[:install_this_program] = i
  return i # Return it here just in case.
end