Class: RBT::Base
Overview
Direct Known Subclasses
Action::FindAlternativeArchive, Action::Prefix, ApplySedOperations, Autosymlink, AutoupdateThisProgram, BackupProgram, BeautifyConfigureHelpOutput, BeautifySystem, BinaryNameBelongsToWhichProgram, BuildDetector, ChainCompile, Chainer, ChangePrefix, CheckForDuplicateBinaries, CheckForInvalidCurrentSymlinks, ClassesForIndividualPrograms::Gcc::ChangeLib64ToLib, CleanupSystemTags, Cmake, ColourMakeInstall, ColourizeParser, Commandline, CompileBase, CompileBaseSystem, CompileInTraditionalManner, CompileIntoHomeDir, CompileIntoHomeDirWithoutSymlinking, CompileVersionedProgram, CompileViaEnvironmentVariableAsPrefix, CompileViaSQL, ConfigLogParser, ConfigureString, Controller, ConvertToNonTraditional, ConvertToTraditional, Cookbooks::AllUrls, Cookbooks::AllowedCookbookEntries, Cookbooks::BatchValidateTheCookbookRecipes, Cookbooks::CheckForAvailableVersions, Cookbooks::CheckForCorrectDependencies, Cookbooks::CheckForInclusion, Cookbooks::CheckForRemoteWebpages, Cookbooks::CheckIfSourceDirectoriesExist, Cookbooks::CheckValidityOfCookbooks, Cookbooks::ConvertDateFormat, Cookbooks::Convert_PKGBUILD, Cookbooks::CopyTheIdealCookbook, Cookbooks::CreateBigYamlCookbook, Cookbooks::CreateCookbookYamlFile, Cookbooks::CreateDatabase, Cookbooks::CreateEbuild, Cookbooks::CreateGlobalYamlDatabase, Cookbooks::CreateSqlFromThisCookbook, Cookbooks::DisplayCookbookDataset, Cookbooks::DownloadAllSourceArchives, Cookbooks::FeedbackLicenses, Cookbooks::FindAllArchiveTypes, Cookbooks::FindDirectoryEntriesWithoutCorrespondingYamlFile, Cookbooks::FindDuplicateBinaries, Cookbooks::FindHeaders, Cookbooks::FindMultipleVersions, Cookbooks::GenerateHomepage, Cookbooks::GobolinuxRecipesComparer, Cookbooks::Homepage, Cookbooks::IncrementProgramVersion, Cookbooks::LocalCheckForLatest, Cookbooks::MergeCookbooks, Cookbooks::MissingUseThisBuildSystemEntry, Cookbooks::Registered, Cookbooks::ReportMissingHomepageEntries, Cookbooks::ReportMissingLicenceEntries, Cookbooks::ReportTheRegisteredPrograms, Cookbooks::ReportUselessDescriptions, Cookbooks::ScanForMissingLastUpdateEntries, Cookbooks::ScanSourceArchive, Cookbooks::SearchForTags, Cookbooks::ShowDependenciesOf, Cookbooks::ShowDependenciesOn, Cookbooks::ShowLastUpdated, Cookbooks::ToggleKeepExtractedValue, Cookbooks::Url, Cookbooks::ValidateAllCookbookEntries, Cookbooks::ValidateArchiveSize, Cookbooks::ValidateBlfsEntries, Cookbooks::ValidateCookbookAliases, CopyTheseArchives, CreateAndPopulatePkgconfigDirectory, CreateBashScripts, CreateLogFile, CreatePackage, CreatePkgconfigFile, CreatePkgconfigFileForLua, CreateRpmSpecFile, CreateShellScriptContainingTheseProgramsVersions, CreateSnapcraftFile, DatabaseAdapters::Sequel::Adapter, ExclusiveLogic, ExtraInformation, FeedbackBinariesOf, FeedbackInformation, FetchAllM4Macros, FixPkgconfigFile, FlatpakUrlScanner, GUI::UniversalWidgets::CompileProgram, GUI::UniversalWidgets::InstalledPrograms, GUI::UniversalWidgets::Notebook, GUI::UniversalWidgets::RecipeMaker, GUI::UniversalWidgets::Statistics, GUI::UniversalWidgets::UrlAction, GenerateFlatpakManifestFile, GenerateMachomebrewFormula, GenerateMakefile, GeneratePdfTutorial, GenerateRbtConfiguration, GenerateShellCompletion, GenerateShellscript, GenerateSqlTable, Gitty, Gobolinux::NamingConvention, ImproveTheCookbookRecipes, InstallGlibSchema, InstallGraalvm, InstalledPrograms, Installer::Shell, KernelConfigSanitizer, Libtool, Libtool::RemoveLibtoolFiles, Linux::Debian::CreateControlFile, Linux::Debian::CreateDebianPackage, Linux::Fedora, Linux::Gobolinux::CreateDependenciesFile, Linux::Gobolinux::CreateRecipe, Linux::LFS, Linux::ParseBlfsWebpage, Linux::RenameSystemMap, Linux::Slackware::CreateSlackwarePackage, Linux::Slackware::FilelistParser, Linux::Slackware::GenerateSlackDescFile, Linux::Slackware::InstallThisSlackwarePackage, Make, MissingHomepages, NotFoundLibraries, PackageRbtScripts, ParseConfigureHelp, ProblemsAndErrors, ProfileInstall, PurgeBinariesOfThisProgram, PurgeHeadersOfThisProgram, PurgeIncorrectYamlDirectoriesInTheProgramsHierarchy, PurgeLibrariesOfThisProgram, QueryBinaryToPackage, QueryFileAssociation, QueryHeaderToPackage, ReconstituteGlibc, RegisterProgramFilesIntoGlobalDatabase, RegisterProgramFilesIntoYamlDatabase, RegisteredTags, RemoveAllSymlinks, RemoveEmptyDirectories, RemoveProgram, RemovePrograms, RemoveSymlinks, ReplaceSymlinks, RequiredDependenciesOn, ReverseDependencies, SaveTheAvailableProgramsVersions, Scons, ShowDependenciesOfThisLibrary, ShowDescriptionAndExtraInformation, SimpleVersionComparer, SimplifiedLddOutput, SimplifyRootEntries, StaticOverviewOfTheAvailableBinariesOnThisComputerSystem, SymlinkAllUpcasedProgramsToDowncasedVariants, SymlinkGlibSchema, SymlinkHeaders, SymlinkIntoTheUsrBinHierarchy, SymlinkIntoUsrLibDirectory, SymlinkPkgconfigFiles, SystemCompilePossibilities, Toolchain, Uninstall, UpdateEntry, UpdateSlackpkg, UrlAction, UseFlags, Users, VersionSwitcher, WhatCouldBecomeAnAppDir
Constant Summary
LeanPrototype::ALL_COLOUR_METHODS, LeanPrototype::ARRAY_KDE_KONSOLE_COLOURS_IN_USE, LeanPrototype::DAY_NAMES, LeanPrototype::NAMESPACE, LeanPrototype::SILENT_REDIRECTION
Class Method Summary
collapse
Instance Method Summary
collapse
-
#cat(i) ⇒ Object
# === cat (cat tag) ========================================================================== #.
-
#cd_back_to_the_current_working_directory ⇒ Object
# === cd_back_to_the_current_working_directory.
-
#consider_reporting_how_many_programs_are_registered(shall_we_report = false) ⇒ Object
# === consider_reporting_how_many_programs_are_registered ========================================================================== #.
-
#cookbook_files?(show_how = :show_only_name) ⇒ Boolean
(also: #available_cookbook_files?)
# === cookbook_files?.
-
#copy_recursively(what, where_to = '/usr/', be_verbose = false) ⇒ Object
# === copy_recursively (cpr tag) ========================================================================== #.
-
#delete_code_of_conduct? ⇒ Boolean
# === delete_code_of_conduct?.
-
#determine_appdir_prefix_from_this_input(i = nil, program_version = nil) ⇒ Object
(also: #static_appdir_prefix_of?)
-
#directory_validation? ⇒ Boolean
# === directory_validation? ========================================================================== #.
-
#do_not_show_names ⇒ Object
# === do_not_show_names ========================================================================== #.
-
#fast_return_file_size_of_this_program(i) ⇒ Object
# === fast_return_file_size_of_this_program ========================================================================== #.
-
#file_last_symlinked_program? ⇒ Boolean
# === file_last_symlinked_program? ========================================================================== #.
-
#file_programs_version_url ⇒ Object
# === file_programs_version_url ========================================================================== #.
-
#gem_version(i) ⇒ Object
# === gem_version.
-
#is_a_64bit_system? ⇒ Boolean
(also: #is_on_64_bit?)
# === is_a_64bit_system?.
-
#is_ccache_available? ⇒ Boolean
(also: #ccache_is_available?)
# === is_ccache_available?.
-
#is_porg_available? ⇒ Boolean
(also: #porg_is_available?)
# === is_porg_available?.
-
#is_this_binary_registered?(i) ⇒ Boolean
# === is_this_binary_registered? ========================================================================== #.
-
#is_this_program_included?(i, optional_arguments = nil) ⇒ Boolean
(also: #cookbooks_include_this_program?)
# === is_this_program_included?.
-
#make_command? ⇒ Boolean
# === make_command? ========================================================================== #.
-
#make_install_command? ⇒ Boolean
# === make_install_command?.
-
#new_cookbook_instance_for(name_of_the_program) ⇒ Object
# === new_cookbook_instance_for.
-
#program_exists?(this_program) ⇒ Boolean
# === program_exists?.
-
#publish_list_of_all_programs_version ⇒ Object
# === publish_list_of_all_programs_version ========================================================================== #.
-
#rcp(i, &block) ⇒ Object
# === rcp.
-
#remove_symlink(i, be_verbose = false) ⇒ Object
(also: #delete_symlink, #delete_this_symlink, #remove_this_symlink)
# === remove_symlink.
-
#rename_kde_konsole_tab(use_this_as_the_new_title = '') ⇒ Object
# === rename_kde_konsole_tab ========================================================================== #.
-
#repackage(i, use_this_for_the_opnn_namespace = 'RBT::Repackage') ⇒ Object
(also: #repackage_this)
# === repackage (repackage tag).
-
#report_n_programs ⇒ Object
# === report_n_programs.
-
#report_working_directory ⇒ Object
# === report_working_directory.
-
#return_compile_time_statistics ⇒ Object
# === return_compile_time_statistics ========================================================================== #.
-
#return_n_random_characters(i = 10) ⇒ Object
# === return_n_random_characters.
-
#return_version_of_this_program(i) ⇒ Object
# === return_version_of_this_program ========================================================================== #.
-
#run_make_then_make_install ⇒ Object
# === run_make_then_make_install ========================================================================== #.
-
#sanitize_url1_entry(i, optional_hash = {}) ⇒ Object
# === sanitize_url1_entry ========================================================================== #.
-
#set_source_directory(i = return_pwd, be_verbose = false) ⇒ Object
(also: #set_source_dir)
# === set_source_directory.
-
#show_overview_over_available_utility_scripts ⇒ Object
# === show_overview_over_available_utility_scripts ========================================================================== #.
-
#symlink_all_files_from_this_directory_to_that_directory(this_dir, that_dir, delete_target_file = false) ⇒ Object
(also: #symlink_from_to)
# === symlink_all_files_from_this_directory_to_that_directory.
-
#system_tags? ⇒ Boolean
-
#upload_list_of_all_programs_version ⇒ Object
# === upload_list_of_all_programs_version ========================================================================== #.
-
#use_yaml_database_for_tags? ⇒ Boolean
-
#warn_and_exit(input, exit_mode = true) ⇒ Object
(also: #warn_then_exit)
# === warn_and_exit.
-
#wget(i) ⇒ Object
# === 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, #initialize, #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?, #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_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, #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, #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
Class Method Details
.registered_binaries? ⇒ Boolean
#
RBT::Base.registered_binaries?
Tell us where our binaries are registered.
#
Instance Method Details
#cat(i) ⇒ Object
519
520
521
522
523
|
# File 'lib/rbt/base/base.rb', line 519
def cat(i)
if File.exist? i
return readlines_with_proper_encoding(i).join
end
end
|
#cd_back_to_the_current_working_directory ⇒ Object
#
cd_back_to_the_current_working_directory
This method can be used to ensure that we are back in the old “current working directory”, after invoking the given block.
#
448
449
450
451
452
453
454
|
# File 'lib/rbt/base/base.rb', line 448
def cd_back_to_the_current_working_directory
working_directory = return_pwd
if block_given?
yield
end
cd(working_directory)
end
|
#consider_reporting_how_many_programs_are_registered(shall_we_report = false) ⇒ Object
#
consider_reporting_how_many_programs_are_registered
#
302
303
304
305
306
307
308
|
# File 'lib/rbt/base/base.rb', line 302
def consider_reporting_how_many_programs_are_registered(
shall_we_report = false
)
if shall_we_report
action(:report_the_registered_programs)
end
end
|
#cookbook_files?(show_how = :show_only_name) ⇒ Boolean
Also known as:
available_cookbook_files?
#
cookbook_files?
This method will return all available cookbook files in an Array.
Usage example:
cookbook_files?(:show_full_path)
#
466
467
468
469
470
471
472
473
474
475
476
477
478
|
# File 'lib/rbt/base/base.rb', line 466
def cookbook_files?(
show_how = :show_only_name
)
result = Dir["#{individual_cookbooks_directory?}*yml"].sort
case show_how
when :show_only_name result.map! {|entry|
File.basename(entry).gsub( File.extname(entry), '' )
}
when :show_full_path end
return result
end
|
#copy_recursively(what, where_to = '/usr/', be_verbose = false) ⇒ Object
#
copy_recursively (cpr tag)
#
368
369
370
371
372
373
374
|
# File 'lib/rbt/base/base.rb', line 368
def copy_recursively(
what,
where_to = '/usr/',
be_verbose = false
)
::RBT.copy_recursively(what, where_to, be_verbose)
end
|
#delete_code_of_conduct? ⇒ Boolean
#
delete_code_of_conduct?
Query method over as to whether we will try to remove code-of-conduct files. This is usually only valid for my home system, or when a config-option has been set to true. Note that the default value is false, so that other users can decide on their own whether they want to retain code of conducts or not.
#
138
139
140
141
142
143
144
145
146
147
148
|
# File 'lib/rbt/base/base.rb', line 138
def delete_code_of_conduct?
if is_on_roebe?
true
else if config?
config?.automatically_delete_code_of_conduct_files_when_repackaging
else
false
end
end
end
|
#
This method has to return a String, which constitutes the AppDir prefix of the target program at hand.
#
#directory_validation? ⇒ Boolean
#
directory_validation?
#
219
220
221
|
# File 'lib/rbt/base/base.rb', line 219
def directory_validation?
RBT.directory_validation?
end
|
#do_not_show_names ⇒ Object
#fast_return_file_size_of_this_program(i) ⇒ Object
#
fast_return_file_size_of_this_program
#
#file_last_symlinked_program? ⇒ Boolean
#
file_last_symlinked_program?
#
#file_programs_version_url ⇒ Object
#
file_programs_version_url
#
#gem_version(i) ⇒ Object
#
gem_version
This method is a wrapper over Gem::Version.new()
The reason as to why this resides in a method is so that we can do some input-sanitizing, and easier rescue, if this is necessary one day.
#
325
326
327
328
329
330
331
332
333
334
335
336
|
# File 'lib/rbt/base/base.rb', line 325
def gem_version(i)
i = i.to_s.delete('vr')
begin
if i =~ /\d+/ return Gem::Version.new(i)
end
rescue ArgumentError => error
opne 'An error occurred in gem_version()'
pp error
end
nil end
|
#is_a_64bit_system? ⇒ Boolean
Also known as:
is_on_64_bit?
#
is_a_64bit_system?
This method will return true if the underlying system is a 64-bit system.
#
115
116
117
|
# File 'lib/rbt/base/base.rb', line 115
def is_a_64bit_system?
RUBY_PLATFORM.include? '_64' end
|
#is_ccache_available? ⇒ Boolean
Also known as:
ccache_is_available?
#
is_ccache_available?
This method queries as to whether ccache is available or whether it is not.
#
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
|
# File 'lib/rbt/base/base.rb', line 269
def is_ccache_available?
result = true
begin
check_for_ccache = `ccache 2>&1`
if check_for_ccache.include? 'command not found'
result = false
end
rescue Errno::ENOENT
check_for_ccache = false
end
result
end
|
#is_porg_available? ⇒ Boolean
Also known as:
porg_is_available?
#
is_porg_available?
This method is required to determine whether porg is available or not.
#
388
389
390
391
|
# File 'lib/rbt/base/base.rb', line 388
def is_porg_available?
result = `porg 2>&1`.include? 'porg: command not found'
return !result
end
|
#is_this_binary_registered?(i) ⇒ Boolean
#
is_this_binary_registered?
#
508
509
510
511
512
513
514
|
# File 'lib/rbt/base/base.rb', line 508
def is_this_binary_registered?(i)
unless RBT.respond_to?(:registered_binaries?)
require 'rbt/registered/registered_binaries.rb'
end
array = RBT.registered_binaries?
array.include?(i.to_s)
end
|
#is_this_program_included?(i, optional_arguments = nil) ⇒ Boolean
Also known as:
cookbooks_include_this_program?
#
is_this_program_included?
Use this method to query whether a program is included or whether it is not.
The second argument is, by default, nil. It can be a symbol such as :include_abbreviations, in which case we will include abbreviations.
Usage example:
is_this_program_included?(:htop, :include_abbreviations)
#
#make_command? ⇒ Boolean
417
418
419
|
# File 'lib/rbt/base/base.rb', line 417
def make_command?
RBT::Base.make_command?
end
|
#make_install_command? ⇒ Boolean
#
make_install_command?
This is the default “make install” command for now.
#
426
427
428
|
# File 'lib/rbt/base/base.rb', line 426
def make_install_command?
'make install'
end
|
#new_cookbook_instance_for(name_of_the_program) ⇒ Object
#
new_cookbook_instance_for
Use a slightly shorter wrapper to access class Cookbook.
Note that you still have to require class Cookbook on your own, prior to calling this method.
The argument to this method should be the name of the program whose cookbook-dataset you wish to access/manipulate.
#
572
573
574
|
# File 'lib/rbt/base/base.rb', line 572
def new_cookbook_instance_for(name_of_the_program)
action(:sanitize_cookbook, name_of_the_program)
end
|
#program_exists?(this_program) ⇒ Boolean
#
program_exists?
Use this method to find out whether the given program, as input to this method, exists.
Usage example:
if program_exists? :htop
#
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
# File 'lib/rbt/base/base.rb', line 170
def program_exists?(
this_program
)
does_program_exist = false this_program = this_program.to_s.dup if this_program.include? ' ' this_program = this_program.split(' ').first
end
path_variable_file = "#{RUBY_SRC_DIR}rcfiles/lib/rcfiles/yaml/path_variable.yml"
if File.exist? path_variable_filelib
array_available_paths = load_yaml(path_variable_file)['path'].strip.split(' ')
array_available_paths.each {|path|
_ = "#{path}/#{this_program}"
does_program_exist = true if File.exist?(_)
}
end
does_program_exist = true if this_program.include? '/configure'
return does_program_exist
end
|
#publish_list_of_all_programs_version ⇒ Object
#
publish_list_of_all_programs_version
#
#rcp(i, &block) ⇒ Object
#
rcp
This method performs a recursive copy action, through RBT.action().
#
155
156
157
|
# File 'lib/rbt/base/base.rb', line 155
def rcp(i, &block)
action(:rcp, i, &block)
end
|
#remove_symlink(i, be_verbose = false) ⇒ Object
Also known as:
delete_symlink, delete_this_symlink, remove_this_symlink
#
remove_symlink
Simply remove a symlink. Use this method consistently when you wish to remove any symlink.
#
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
|
# File 'lib/rbt/base/base.rb', line 531
def remove_symlink(
i,
be_verbose = false
)
case be_verbose
when :be_quiet
be_verbose = false
when :be_verbose
be_verbose = true
end
if i.is_a? Array
i.each {|entry| remove_symlink(entry, be_verbose) }
else
if File.symlink?(i)
if be_verbose
e "#{rev}Now deleting the symlink `#{sfancy(i)}#{rev}`."
end
File.delete(i)
end
end
end
|
#rename_kde_konsole_tab(use_this_as_the_new_title = '') ⇒ Object
#
rename_kde_konsole_tab
#
55
56
57
58
59
60
61
62
|
# File 'lib/rbt/base/base.rb', line 55
def rename_kde_konsole_tab(
use_this_as_the_new_title = ''
)
if Object.const_defined?(:Roebe) and
Roebe.respond_to?(:rename_tab)
Roebe.rename_tab(use_this_as_the_new_title)
end
end
|
#repackage(i, use_this_for_the_opnn_namespace = 'RBT::Repackage') ⇒ Object
Also known as:
repackage_this
#
repackage (repackage tag)
This method will repackage an archive format such as .tar.gz into .tar.xz.
#
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
# File 'lib/rbt/base/base.rb', line 70
def repackage(
i,
use_this_for_the_opnn_namespace = 'RBT::Repackage'
)
begin
require 'repackage'
if File.exist? i
opnn(
namespace_to_use: use_this_for_the_opnn_namespace
)
e "#{rev}Trying to repackage `#{sfile(i)}#{rev}` next:"
Repackage.new(i) {{
run: :run_already,
delete_code_of_conduct: delete_code_of_conduct?
}}
else
end
rescue LoadError
e "#{rev}The gem called \"repackage\" is not available - please install it"
e "in order to repackage the archive at hand here (`#{sfile(i)}`)."
end
end
|
#report_n_programs ⇒ Object
#
report_n_programs
Usage example for the report functionality of this method:
report_n_programs
#
438
439
440
|
# File 'lib/rbt/base/base.rb', line 438
def report_n_programs
consider_reporting_how_many_programs_are_registered
end
|
#report_working_directory ⇒ Object
#
report_working_directory
This method will simply report the current working directory (pwd), without making use of opnn().
#
212
213
214
|
# File 'lib/rbt/base/base.rb', line 212
def report_working_directory
e "#{rev}The current working directory is #{sdir(return_pwd)}#{rev}."
end
|
#return_compile_time_statistics ⇒ Object
#
return_compile_time_statistics
#
#return_n_random_characters(i = 10) ⇒ Object
#
return_n_random_characters
This method will return n random characters, as Strings. It is used specifically to “create” a random temporary directory, into which archives can be extracted into.
#
487
488
489
490
491
492
493
494
|
# File 'lib/rbt/base/base.rb', line 487
def return_n_random_characters(
i = 10
)
array = ('a'..'z').to_a
_ = ''.dup
i.times { _ << array.sample }
_
end
|
#return_version_of_this_program(i) ⇒ Object
#
return_version_of_this_program
#
#run_make_then_make_install ⇒ Object
#
run_make_then_make_install
#
#sanitize_url1_entry(i, optional_hash = {}) ⇒ Object
233
234
235
236
237
|
# File 'lib/rbt/base/base.rb', line 233
def sanitize_url1_entry(
i, optional_hash = {}
)
RBT.sanitize_url1_entry(i, optional_hash)
end
|
#set_source_directory(i = return_pwd, be_verbose = false) ⇒ Object
Also known as:
set_source_dir
#
set_source_directory
Set the source dir to ANY new location. Defaults to Dir.pwd.
Example to test this method:
ry mantis --source_dir=/Depot/j
#
403
404
405
406
407
408
409
410
411
412
|
# File 'lib/rbt/base/base.rb', line 403
def set_source_directory(
i = return_pwd,
be_verbose = false
)
i << '/' unless i.end_with? '/'
RBT.set_source_directory(i)
if be_verbose?
e "#{rev}Setting source directory to `#{sdir(i)}#{rev}` next."
end
end
|
#show_overview_over_available_utility_scripts ⇒ Object
#
show_overview_over_available_utility_scripts
#
#symlink_all_files_from_this_directory_to_that_directory(this_dir, that_dir, delete_target_file = false) ⇒ Object
Also known as:
symlink_from_to
#
symlink_all_files_from_this_directory_to_that_directory
This method can be used to symlink two directories to one another, e. g. from directory A onto directory B.
#
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
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
|
# File 'lib/rbt/base/base.rb', line 609
def symlink_all_files_from_this_directory_to_that_directory(
this_dir,
that_dir,
delete_target_file = false
)
_ = Dir[("#{this_dir}/*").squeeze('/')].select {|entry| is_file?(entry) }
if block_given?
yielded = yield
case yielded
when :also_include_directories,
:include_directories
_ = Dir[("#{this_dir}/*").squeeze('/')].select {|entry|
is_file?(entry) or is_directory?(entry)
}
when :delete_target_file_if_it_exists
delete_target_file = true
end
end
_.each {|entry|
if delete_target_file
_ = that_dir+File.basename(entry)
if File.exist?(_) and File.file?(_)
remove_file(_)
end
end
real_target = that_dir+File.basename(entry)
symlink(entry, real_target)
}
end
|
#upload_list_of_all_programs_version ⇒ Object
#
upload_list_of_all_programs_version
#
#warn_and_exit(input, exit_mode = true) ⇒ Object
Also known as:
warn_then_exit
#
warn_and_exit
This method will exit from the scripts.
You should be careful when using this, because in some situations we do not actually want to exit completely - for example when we chain-compile something.
#
295
296
297
|
# File 'lib/rbt/base/base.rb', line 295
def warn_and_exit(input, exit_mode = true)
warn(input, exit_mode)
end
|
#wget(i) ⇒ Object
341
342
343
|
# File 'lib/rbt/base/base.rb', line 341
def wget(i)
esystem "wget #{i}"
end
|