Class: RBT::Libtool
- Inherits:
-
Base
show all
- Defined in:
- lib/rbt/libtool/reset.rb,
lib/rbt/libtool/run.rb,
lib/rbt/libtool/help.rb,
lib/rbt/libtool/libtool.rb,
lib/rbt/libtool/constants.rb,
lib/rbt/libtool/class_methods/class_methods.rb,
lib/rbt/libtool/search_in_these_directories.rb,
lib/rbt/libtool/class_methods/use_this_directory.rb,
lib/rbt/libtool/class_methods/return_every_la_file.rb,
lib/rbt/libtool/class_methods/autocorrect_this_file.rb,
lib/rbt/libtool/remove_libtool_files/remove_libtool_files.rb,
lib/rbt/libtool/class_methods/return_all_la_files_from_this_directory.rb,
lib/rbt/libtool/class_methods/append_this_directory_to_the_list_of_directories_to_search_for.rb
Overview
Defined Under Namespace
Classes: RemoveLibtoolFiles
Constant Summary
collapse
- FILE_SEARCH_IN_THESE_DIRECTORIES =
#
FILE_SEARCH_IN_THESE_DIRECTORIES
#
"#{RBT.project_yaml_dir?}search_in_these_directories/search_in_these_directories.yml"
- ULIB_LIBRARIES =
'/usr/lib/'
- ULIB64_LIBRARIES =
'/usr/lib64/'
- SYSTEM_LIBRARIES =
#
SYSTEM_LIBRARIES
In modern GoboLinux variants, this is pointing towards /System/Index/lib.
#
'/System/Index/lib/'
- REGEX_TO_DISCOVER_PROGRAMS_ENTRIES_IN_DEPENDENCY_LIBS =
#
REGEX_TO_DISCOVER_PROGRAMS_ENTRIES_IN_DEPENDENCY_LIBS
Rubular example at:
http://rubular.com/r/E8jSpNAMcX
#
/(.*\/Programs\/[A-Za-z]+\d*[a-z]*\/.+\d\/)/
RBT::LeanPrototype::ALL_COLOUR_METHODS, RBT::LeanPrototype::ARRAY_KDE_KONSOLE_COLOURS_IN_USE, RBT::LeanPrototype::DAY_NAMES, RBT::LeanPrototype::NAMESPACE, RBT::LeanPrototype::SILENT_REDIRECTION
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#cat, #cd_back_to_the_current_working_directory, #consider_reporting_how_many_programs_are_registered, #cookbook_files?, #copy_recursively, #delete_code_of_conduct?, #determine_appdir_prefix_from_this_input, #directory_validation?, #do_not_show_names, #fast_return_file_size_of_this_program, #file_last_symlinked_program?, #file_programs_version_url, #gem_version, #is_a_64bit_system?, #is_ccache_available?, #is_porg_available?, #is_this_binary_registered?, #is_this_program_included?, #make_command?, #make_install_command?, #new_cookbook_instance_for, #program_exists?, #publish_list_of_all_programs_version, #rcp, registered_binaries?, #remove_symlink, #rename_kde_konsole_tab, #repackage, #report_n_programs, #report_working_directory, #return_compile_time_statistics, #return_n_random_characters, #return_version_of_this_program, #run_make_then_make_install, #sanitize_url1_entry, #set_source_directory, #show_overview_over_available_utility_scripts, #symlink_all_files_from_this_directory_to_that_directory, #system_tags?, #upload_list_of_all_programs_version, #use_yaml_database_for_tags?, #warn_and_exit, #wget
#a_or_an?, #abbreviations?, #absolute_path, #action, #add_to_the_commandline_arguments, #all_binaries?, #all_files_from, #all_libraries?, #allowed_cookbook_entries?, #appdir_location_of?, #append_onto_the_internal_hash, #append_what_into, #archive_type_of?, #available_programs?, #be_quiet?, #be_verbose?, #begins_with_a_comment?, #capitalize_first_alphabetical_character, #cd_to_the_log_directory, #cd_to_the_temp_directory, #change_directory, #change_permission, #cheering_person?, #chmod, #chop_off_archive, #clear_commandline_arguments, #cliner, #coloured_and_padded_e, #coloured_and_padded_esystem, #coloured_esystem, #colourize_directory_for_system_results, #colourize_this_error, #colourize_this_file_path, #colourize_this_warning, #commandline_arguments?, #commandline_arguments_without_hyphens?, #comment, #convert_dd_mm_yyyy_to_its_long_variant, #convert_env_variable, #copy_directory, #copy_files, #cpr, #create_directory, #current_hour?, #dd_mmm_yyy, #debug, #debug?, #directory_expanded_cookbooks?, #disable_colours, #display_md5sum?, #do_not_debug, #does_the_cookbook_include_this_program?, #does_this_expanded_cookbook_file_exist_for_this_program?, #does_this_file_exist?, #does_this_file_exist_and_is_it_a_file?, #e, #eblue, #ecomment, #ecrimson, #edir, #editor?, #efancy, #eimp, #enable_colours, #enable_debug, #ensure_main_encoding_for, #eparse, #esystem, #esystem_gold, #etomato, #ewarn, #exit_program, #expanded_cookbooks_directory_exists?, #extract_this_archive, #extract_to?, #file_compiled_programs?, #file_dirname_retaining_trailing_slash, #file_predefined_installation_instructions?, #file_specification_of_registered_cookbook_entries, #find_cookbook_alias_for, #find_this_yaml_file, #first_argument?, #first_non_hyphen_argument?, #get_all_directories_from, #get_all_files_from, #get_all_programs, #get_date, #get_extended_date, #get_files_and_directories_from, #go_to_base_dir, #home_dir?, #host_system?, #infer_the_namespace, #internal_hash?, #internal_hash_set_commandline_arguments, #is_an_archive?, #is_directory?, #is_file?, #is_github_url?, #is_make_available?, #is_meson_installed?, #is_on_gobolinux?, #is_on_windows?, #is_roebe?, #is_superuser?, #is_symlink?, #is_this_a_header?, #is_this_a_library?, #is_this_program_included?, #iso_encoding?, #load_dataset_from_this_expanded_cookbook, #load_yaml, #load_yaml_file_from_the_cookbook_directory_for_this_program, #log_directory?, #main_encoding?, #meson_build_file_exists?, #months?, #move_file, #n_programs_are_available?, #n_programs_available?, #namespace?, #no_directory_exists_at, #no_directory_was_found_at, #no_opn, #no_such_file_exists, #open_in_browser, #open_in_editor, #opncomment, #opne, #opnef, #opnerev, #opnerror, #opnesystem, #opnewarn, #opnfancy, #opnn, #otomato, #packages_directory?, #path_to_this_expanded_cookbooks_dataset, #pkgconfig_directory?, #populate_the_internal_hash_with_default_values, #predefined_installation_instructions?, #prepend_this_commandline_argument, #program_version_of?, #project_base_directory?, #project_yaml_directory?, #query_path?, #rarrow?, #read_file, #read_file_in_default_encoding, #read_file_with_default_encoding, #readlines, #readlines_with_proper_encoding, #register_sigint, #registered_cookbook_entries?, #remove, #remove_archive_from_the_end, #remove_comments_from_each_line, #remove_directory, #remove_double_slashes, #remove_file, #remove_newlines, #remove_parens, #remove_symlink, #remove_the_first_commandline_argument, #remove_this_commandline_argument, #remove_this_entry_from_the_commandline_arguments, #remove_trailing_ANSII_escape_code, #remove_unnecessary_data_from_url, #rename, #report_pwd, #require_the_rbt_aliases, #reset_the_internal_hash, #return_all_archives_from_this_directory, #return_appdir_prefix, #return_commandline_arguments_with_leading_hyphens, #return_current_hour_minutes_second, #return_date, #return_day_of_the_month_based_on_utc, #return_full_time, #return_hours_minutes_seconds_based_on_utc, #return_location_to_this_programs_yaml_file, #return_month_based_on_this_number, #return_month_based_on_utc, #return_opnn, #return_program_name, #return_program_name_for_gobolinux_systems, #return_program_name_via_program_information, #return_pwd, #return_unicode_warning_symbol_or_empty_string, #return_utc, #return_utc_time_in_a_format_similar_to_slackware, #return_weekday_based_on_utc, #return_year_based_on_utc, #rev, #rpn, #run_simulation=, #run_simulation?, #sdir, #sdir_return_pwd, #set_be_silent, #set_be_verbose, #set_first_commandline_argument, #set_namespace, #set_use_colours, #set_use_opn, #set_xorg_buffer, #sfancy, #sfile, #silent_redirection?, #silently_create_this_directory_if_it_does_not_yet_exist, #simp, #source_base_directory?, #ssym, #stderr, #store_into_this_directory?, #string_right_arrow?, #swarn, #symlink, #sysbin_directory?, #sysetc_directory?, #sysinclude_directory?, #syslib_directory?, #sysshare_directory?, #system_directory?, #temp_directory?, #to_bool, #to_camelcase, #to_iso_encoding, #to_unicode, #today?, #touch, #try_to_require_beautiful_url, #try_to_require_the_environment_information_gem, #try_to_require_the_extracter_gem, #try_to_require_the_open_gem, #try_to_require_the_xorg_buffer, #try_to_require_wget, #try_to_return_a_special_compile_component, #unicode_cliner, #unicode_middle_cliner, #use_colours=, #use_colours?, #use_opn=, #use_opn?, #utf_encoding?, #verbose_truth, #word_wrap, #write_what_into, #write_what_into_via_unicode, #yes_or_no
Constructor Details
#initialize(i = ARGV, run_already = true) ⇒ Libtool
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
# File 'lib/rbt/libtool/libtool.rb', line 34
def initialize(
i = ARGV,
run_already = true
)
reset
case i
when :do_not_run_yet
else set_commandline_arguments(i)
run if run_already
end
end
|
Class Method Details
.[](i = ARGV) ⇒ Object
479
480
481
|
# File 'lib/rbt/libtool/libtool.rb', line 479
def self.[](i = ARGV)
new(i)
end
|
.append_this_directory_to_the_list_of_directories_to_search_for(i = ARGV) ⇒ Object
#
This should be used on the commandline.
It will permanently set to use a new directory to search for.
#
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
|
# File 'lib/rbt/libtool/class_methods/append_this_directory_to_the_list_of_directories_to_search_for.rb', line 30
def self.append_this_directory_to_the_list_of_directories_to_search_for(
i = ARGV
)
i = i.first if i.is_a? Array
case i
when 'PROGRAMS'
i = program_dir?
end unless File.exist?(i)
i = i.dup if i.frozen?
i << '/' unless i.end_with? '/'
target_file = FILE_SEARCH_IN_THESE_DIRECTORIES
array_search_in_these_directories = YAML.load_file(target_file)
if array_search_in_these_directories.include? i
opn; e "Can not add #{Colours.sdir(i)} as it is already a part "\
"of the search-directories."
else
array_search_in_these_directories << i
opn; e 'We will append the directory `'+Colours.sdir(i)+'` to the '\
'list of directories'
opn; e 'that we will search for incorrect .la files.'
File.open(target_file, 'w+') { |file|
file.write(YAML.dump(array_search_in_these_directories))
}
opn; e "Done! The new file can be found at `#{Colours.sfile(target_file)}`."
if RBT.is_on_roebe?
this_file = "#{RUBY_SRC_DIR}roebe/lib/roebe/yaml/"\
"#{File.basename(target_file)}"
File.open(this_file, 'w+') { |file|
file.write(YAML.dump(array_search_in_these_directories))
}
opn; e 'Done! The new file can be found at '+Colours.sfile(this_file)
end
end
end
|
.autocorrect_this_file(i) ⇒ Object
#
The argument for this method should be an erroneous libtool entry such as /usr/lib/glib.la.
#
19
20
21
|
# File 'lib/rbt/libtool/class_methods/autocorrect_this_file.rb', line 19
def self.autocorrect_this_file(i)
RBT::Libtool.new(:do_not_run_yet).remove_this_entry(i)
end
|
.autofix_every_la_file ⇒ Object
#
Use this method to fix every .la file on your system.
Invocation example:
rubylibtool --autofix
#
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
|
# File 'lib/rbt/libtool/libtool.rb', line 418
def self.autofix_every_la_file
ensure_that_we_have_found_la_files
if Libtool.faulty_la_files?.empty?
Libtool.fill_up_array_that_holds_faulty_la_files
end
Libtool.faulty_la_files?.each {|file|
opne "Now working on the #{orange('.la')} file `#{sfile(file)}`."
dataset = File.readlines(file)
new_file_content = ''
dataset.each {|line|
if line.include?('dependency_libs') and
line.include? PROGRAMS_DIRECTORY.chop splitted = line.split(' ')
splitted.map! {|entry|
if entry.include? PROGRAMS_DIRECTORY.chop
entry = rds(entry)
regex = REGEX_TO_DISCOVER_PROGRAMS_ENTRIES_IN_DEPENDENCY_LIBS
entry =~ regex
match = $1.to_s.dup
entry.sub!(/#{match}/, '/usr/')
end
entry
}
line = splitted.join(' ')+N
end
new_file_content << line
}
what = new_file_content
into = file
opne "Now storing into `#{sfile(into)}`."
write_what_into(what, into)
}
end
|
.e(i = '') ⇒ Object
19
20
21
|
# File 'lib/rbt/libtool/class_methods/append_this_directory_to_the_list_of_directories_to_search_for.rb', line 19
def self.e(i = '')
puts i
end
|
.obtain_all_la_files_from_system_libraries ⇒ Object
#
Grab all .la files from /System/Index/lib/.
#
36
37
38
|
# File 'lib/rbt/libtool/class_methods/class_methods.rb', line 36
def self.obtain_all_la_files_from_system_libraries
Dir["#{SYSTEM_LIBRARIES}*.la"].sort
end
|
.obtain_all_la_files_from_usr_lib ⇒ Object
#
Grab all .la files from /usr/lib/.
#
27
28
29
|
# File 'lib/rbt/libtool/class_methods/class_methods.rb', line 27
def self.obtain_all_la_files_from_usr_lib
Dir["#{ULIB_LIBRARIES}*.la"].sort
end
|
.obtain_all_la_files_from_usr_lib64 ⇒ Object
#
Grab all .la files from the /usr/lib64/ directory.
This is no longer in use a lot.
#
18
19
20
|
# File 'lib/rbt/libtool/class_methods/class_methods.rb', line 18
def self.obtain_all_la_files_from_usr_lib64
Dir["#{ULIB64_LIBRARIES}*.la"].sort
end
|
.return_all_la_files_from_this_directory(this_directory) ⇒ Object
14
15
16
|
# File 'lib/rbt/libtool/class_methods/return_all_la_files_from_this_directory.rb', line 14
def self.return_all_la_files_from_this_directory(this_directory)
Dir["#{this_directory}*.la"].sort
end
|
.return_every_la_file ⇒ Object
#
If you want to return every .la file on a given computer system, then, use this method here.
This will obtain from /usr/lib/, /usr/lib64 and /System/Libraries/ by default. Otherwise, we will make use of an Array.
#
22
23
24
|
# File 'lib/rbt/libtool/class_methods/return_every_la_file.rb', line 22
def self.return_every_la_file
::RBT::Libtool.new.every_la_file
end
|
.set_use_this_directory(i) ⇒ Object
32
33
34
|
# File 'lib/rbt/libtool/class_methods/use_this_directory.rb', line 32
def self.set_use_this_directory(i)
@use_this_directory = i.to_s
end
|
.use_this_directory(i) ⇒ Object
#
The PWD macro means Dir.pwd actually.
#
41
42
43
44
45
46
47
48
49
|
# File 'lib/rbt/libtool/class_methods/use_this_directory.rb', line 41
def self.use_this_directory(i)
i = i.to_s
case i
when 'PWD'
i = return_pwd
end unless File.exist? i
i << '/' unless i.end_with? '/'
@use_this_directory = i
end
|
.use_this_directory? ⇒ Boolean
25
26
27
|
# File 'lib/rbt/libtool/class_methods/use_this_directory.rb', line 25
def self.use_this_directory?
@use_this_directory
end
|
Instance Method Details
#append_this_directory_to_the_list_of_directories_to_search_for(i) ⇒ Object
#
append_this_directory_to_the_list_of_directories_to_search_for
#
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
|
# File 'lib/rbt/libtool/libtool.rb', line 215
def append_this_directory_to_the_list_of_directories_to_search_for(i)
case i
when 'PROGRAMS'
i = program_dir?
end unless File.exist?(i)
i = i.dup if i.frozen?
i << '/' unless i.end_with? '/'
unless @search_in_these_directories.include? i
if block_given?
yielded = yield
case yielded
when :be_verbose
opne "Adding the directory `#{sdir(i)}"\
"` to the search path of this class."
end
end
@search_in_these_directories << i
end
end
|
#clear_array_log_these_files ⇒ Object
#
clear_array_log_these_files
#
272
273
274
|
# File 'lib/rbt/libtool/libtool.rb', line 272
def clear_array_log_these_files
@array_log_these_files = []
end
|
#ensure_that_we_have_found_la_files ⇒ Object
#
ensure_that_we_have_found_la_files
#
206
207
208
209
210
|
# File 'lib/rbt/libtool/libtool.rb', line 206
def ensure_that_we_have_found_la_files
if @array_all_libtool_files.empty?
obtain_all_the_la_files
end
end
|
388
389
390
|
# File 'lib/rbt/libtool/libtool.rb', line 388
def input?
@input
end
|
#log_these_files ⇒ Object
178
179
180
|
# File 'lib/rbt/libtool/libtool.rb', line 178
def log_these_files
@array_log_these_files
end
|
#
The input to this should ideally be the whole commandline, as String.
Reason being that we can apply a regex on the whole line.
#
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
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
|
# File 'lib/rbt/libtool/libtool.rb', line 58
def (i)
if i.is_a? Array
i.each {|entry| (entry) }
else
case i when /(_|-)?(_|-)?search(_|-)?in(_|-)?this(_|-)?directory=(.+)/i, /(_|-)?(_|-)?add=(.+)/i _ = $3.to_s.dup
_ = $6.to_s.dup if $6
append_this_directory_to_the_list_of_directories_to_search_for(
_
) { :be_verbose }
when /^-?-?remove(_|-)?from(_|-)?stored(_|-)?file$/i,
/^-?-?remove(_|-)?from(_|-)?file$/i
remove_the_last_faulty_libtool_entry_stored_in_a_file
when /-?-?remove-?this-?entry=(.+)/,
/-?-?remove=(.+)/,
/-?-?purge=(.+)/,
/-?-?purge (.+)/,
/-?-?purge-?this-?entry=(.+)/,
/-?-?purge-?this=(.+)/,
/-?-?purge-?entry=(.+)/,
/-?-?fix-?this-?entry=(.+)/
remove_this_entry($1.to_s.dup)
exit
when /-?-?help/i
show_help
exit
when /(_|-)?(_|-)?search(_|-)?in(_|-)?which(_|-)?directories\??/
notify_the_user_which_directories_will_be_searched
when /--from-this-directory=(.+)/
use_this_directory($1.to_s.dup)
when /-?-?autofix/, /-?-?autocorrect/
autofix_every_la_file
when /-?-?show(_|-)?every(_|-)?la(_|-)?file/,
/-?-?all$/,'ALL'
show_every_la_file
when /^-?-?stats$/i,
/^-?-?statistics$/i,
/^-?-?report$/i
show_statistics
exit
else if i.end_with?('.la')
remove_this_entry(i)
end
end
end
end
|
#n_la_files? ⇒ Boolean
464
465
466
|
# File 'lib/rbt/libtool/libtool.rb', line 464
def n_la_files?
@array_all_libtool_files.size
end
|
#notify_the_user_which_directories_will_be_searched ⇒ Object
#
notify_the_user_which_directories_will_be_searched
#
241
242
243
244
|
# File 'lib/rbt/libtool/libtool.rb', line 241
def notify_the_user_which_directories_will_be_searched
opne 'The following directories will be searched:'
e " #{sfancy(@search_in_these_directories.join(', '))}"
end
|
#obtain_all_the_la_files(i = @search_in_these_directories) ⇒ Object
Also known as:
obtain_all_libtool_files, every_la_file
#
obtain_all_the_la_files
#
257
258
259
260
261
262
263
264
265
266
|
# File 'lib/rbt/libtool/libtool.rb', line 257
def obtain_all_the_la_files(
i = @search_in_these_directories
)
i.each {|this_dir|
these_la_files = Dir["#{this_dir}**/**.la"]
@array_all_libtool_files << these_la_files
@array_all_libtool_files.flatten!
}
return @array_all_libtool_files
end
|
#remove_the_last_faulty_libtool_entry_stored_in_a_file ⇒ Object
#
remove_the_last_faulty_libtool_entry_stored_in_a_file
Invocation example:
rubylibtool --remove-from-file
#
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
|
# File 'lib/rbt/libtool/libtool.rb', line 359
def remove_the_last_faulty_libtool_entry_stored_in_a_file
_ = "#{rbt_log_directory?}libtool/last_faulty_libtool_file.md"
if File.exist? _
this_is_a_faulty_libtool_entry = File.read(_).strip
remove_this_entry(this_is_a_faulty_libtool_entry)
else
opnn; no_file_exists_at(_)
end
end
|
#remove_this_entry(i) ⇒ Object
#
remove_this_entry
Use this method to remove a specific entry within all .la files.
#
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
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
|
# File 'lib/rbt/libtool/libtool.rb', line 281
def remove_this_entry(i)
clear_array_log_these_files if i.end_with?(':') and !File.exist?(i)
i.chop!
end
opne 'The following entry will be removed from every '\
'encountered .la file on this computer:'
e
e " #{seagreen(i)}"
e
if ::RBT::Libtool.use_this_directory?
la_files = Dir["#{RBT::Libtool.use_this_directory?}**/**.la"]
else
la_files = obtain_all_libtool_files
end
notify_the_user_which_directories_will_be_searched
la_files.select! {|file|
if File.symlink?(file) and !File.exist?(File.readlink(file))
symlink_target = File.readlink(file)
opne 'No file exists at '+sfile(file)+rev+
' (a symlink pointing '\
'at '+sfile(symlink_target)+')'
end
if File.exist? file
dataset = File.read(file)
dataset.include?(i)
else
opne "No file could be found at `#{sfile(file)}#{rev}`."
end
}
if la_files.empty?
opne "We did not find any .la file that includes "\
"the entry `#{simp(i)}#{rev}`."
else
la_files.each {|file|
opne "#{rev}Working on `#{sfile(file)}#{rev}` next."
dataset = File.readlines(file)
_ = ''.dup
dataset.each {|line|
if line.include?('dependency_libs') and line.include?(i)
line.gsub!(/#{Regexp.quote(i)}/,'')
@array_log_these_files << i
end
_ << line
}
write_what_into(_, file)
}
unless @array_log_these_files.empty?
what = N+@array_log_these_files.join(N)+('-' * 40)+N
into = "#{rbt_log_directory?}libtool_modified_these_files.md"
opne "#{rev}Keeping a backup of which libtool files were"
opne "modified, at `#{sfile(into)}#{rev}`."
append_what_into(what, into)
end
end
end
|
#report_how_many_la_files_were_found ⇒ Object
#
report_how_many_la_files_were_found
#
378
379
380
381
382
383
|
# File 'lib/rbt/libtool/libtool.rb', line 378
def report_how_many_la_files_were_found
opne "There are a total of #{sfancy(n_la_files?.to_s)}"\
" .la files on this system."
opne 'The directories '+sdir(target_directories?.join(', '))+
' were searched.'
end
|
#reset ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/rbt/libtool/reset.rb', line 16
def reset
super()
infer_the_namespace
@array_all_libtool_files = []
clear_array_log_these_files
_ = FILE_SEARCH_IN_THESE_DIRECTORIES
if File.exist? _
set_search_in_these_directories(YAML.load_file(_))
else
opne "No file called #{sfile(_)} exists. Thus, "\
"we can not load the dataset."
end
end
|
#run ⇒ Object
12
13
|
# File 'lib/rbt/libtool/run.rb', line 12
def run
end
|
#sanitize_commandline_arguments ⇒ Object
#
sanitize_commandline_arguments
#
194
195
196
197
198
199
200
201
|
# File 'lib/rbt/libtool/libtool.rb', line 194
def sanitize_commandline_arguments
@commandline_arguments.map! {|entry|
if entry and entry.end_with?(':')
entry.chop! end
entry
}
end
|
#search_in_these_directories? ⇒ Boolean
Also known as:
target_directories?, search_in_which_directories?
#
search_in_these_directories?
#
249
250
251
|
# File 'lib/rbt/libtool/libtool.rb', line 249
def search_in_these_directories?
@search_in_these_directories
end
|
#set_commandline_arguments(i) ⇒ Object
#
set_commandline_arguments
#
185
186
187
188
189
|
# File 'lib/rbt/libtool/libtool.rb', line 185
def set_commandline_arguments(i)
@commandline_arguments = [i].flatten.compact
sanitize_commandline_arguments
(@commandline_arguments)
end
|
#set_search_in_these_directories(i = FILE_SEARCH_IN_THESE_DIRECTORIES) ⇒ Object
#
set_search_in_these_directories
Note that the variable that is set here, called @search_in_these_directories, will keep track of the directories that we will search for, by default.
A directory must end with a trailing ‘/’ character, which is ensured here by this method too, if an Array is used as input.
On my home system, the .yml file that is searched is at:
bl $RSRC/libtool/lib/libtool/yaml/search_in_these_directories/search_in_these_directories.yml
#
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
# File 'lib/rbt/libtool/search_in_these_directories.rb', line 23
def set_search_in_these_directories(
i = FILE_SEARCH_IN_THESE_DIRECTORIES
)
if i.end_with?('.yml')
i = YAML.load_file(i)
end if i.is_a? String
if i.is_a? Array
i.map! {|line|
if (line == line.upcase) and ENV.has_key?(line.upcase)
line = ENV[line.upcase].dup
end
line << '/' unless line.end_with? '/'
line
}
end
@search_in_these_directories = i
end
|
#show_every_la_file ⇒ Object
#
show_every_la_file
Invocation example:
roebelibtool --show-every-la-file
#
398
399
400
401
402
403
404
405
406
|
# File 'lib/rbt/libtool/libtool.rb', line 398
def show_every_la_file
ensure_that_we_have_found_la_files
opne 'Every .la file on this computer will be shown next'
e
@array_all_libtool_files.each_with_index {|this_libtool_file, index| index += 1
index = (index.to_s+')').ljust(6)
e " #{sfancy(index)}#{sfile(this_libtool_file)}"
}; e
end
|
#show_help ⇒ Object
#
show_help (help tag)
Give some information to the user how RBT::Libtool can be used.
Invoke this like so:
roebelibtool --help
#
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
|
# File 'lib/rbt/libtool/help.rb', line 21
def show_help
e
opnn; ' --remove-this-entry=/usr/lib/libpng16.la # remove this entry from all .la files'
opnn; ' --stats # show some statistics from your system'
opnn; ' --show-every-la-file # show every .la file on your system'
opnn; ' --all # an alias to the above ^^^'
opnn; ' --search-in-which-directories? # report in which '\
'directories we will look for .la files'
opnn; ' --stats # show some statistics about your .la files'
opnn; ' --report # report how many .la files we have found'
opnn; ' --autofix # autofix every faulty .la file'
opnn; ' --purge # purge a specific entry from a '\
'.la file; also note that we will log this action'
opnn; ' --remove-this-entry # Remove a specific entry '\
'from all .la files'
opnn; ' --from-this-directory= # use '\
'another directory to search in'
opnn; ' --remove-from-stored-file # remove '\
'the .la file last registered'
' '\
'# as faulty, from a local file'
e
opnn; ' rubylibtool --remove-this-entry=/usr/lib/libpng16.la # Remove this entry.'
e
e
opne 'Note that you can also add new entries to the '\
'array of files that'
opne 'will be searched from the commandline, by doing this:'
e
opnn; ' --search-in-this-directory= # add this directory to '\
'the list of directories that will be searched'
opnn; ' --add= # ^^^ same as above, but shorter'
e
end
|
#show_statistics ⇒ Object
471
472
473
474
|
# File 'lib/rbt/libtool/libtool.rb', line 471
def show_statistics
ensure_that_we_have_found_la_files
report_how_many_la_files_were_found
end
|