rbt 0.16.12 → 0.16.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rbt might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/doc/README.gen +1 -1
- data/lib/rbt/actions/actions.rb +18 -17
- data/lib/rbt/actions/individual_actions/create_app_dir_skeleton/create_app_dir_skeleton.rb +1 -1
- data/lib/rbt/actions/individual_actions/installer/aggregate.rb +28 -112
- data/lib/rbt/{utility_scripts → actions/individual_actions/show_manual_steps}/show_manual_steps.rb +12 -15
- data/lib/rbt/actions/individual_actions/software_manager/actions.rb +72 -0
- data/lib/rbt/actions/individual_actions/software_manager/extract_related_code.rb +26 -9
- data/lib/rbt/actions/individual_actions/software_manager/logic_related_code.rb +50 -73
- data/lib/rbt/actions/individual_actions/software_manager/menu.rb +154 -153
- data/lib/rbt/actions/individual_actions/software_manager/misc.rb +1390 -1865
- data/lib/rbt/actions/individual_actions/software_manager/query_related_methods.rb +121 -21
- data/lib/rbt/actions/individual_actions/software_manager/reset.rb +7 -7
- data/lib/rbt/actions/individual_actions/software_manager/setters.rb +433 -28
- data/lib/rbt/actions/individual_actions/software_manager/software_manager.rb +1 -0
- data/lib/rbt/shell/shell_script_containing_the_program_versions.sh +11420 -5
- data/lib/rbt/toplevel_methods/meson.rb +13 -11
- data/lib/rbt/version/version.rb +2 -2
- data/lib/rbt/yaml/cookbooks/exiv2.yml +1 -0
- data/lib/rbt/yaml/cookbooks/extracmakemodules.yml +1 -1
- data/lib/rbt/yaml/cookbooks/glibnetworking.yml +1 -0
- data/lib/rbt/yaml/cookbooks/kitinerary.yml +5 -0
- data/lib/rbt/yaml/cookbooks/libproxy.yml +1 -1
- data/lib/rbt/yaml/cookbooks/ncurses.yml +1 -2
- data/lib/rbt/yaml/cookbooks/wordpress.yml +4 -2
- data/lib/rbt/yaml/expanded_cookbooks/cbindgen.yml +16 -13
- data/lib/rbt/yaml/expanded_cookbooks/erlang.yml +1 -1
- data/lib/rbt/yaml/expanded_cookbooks/exiv2.yml +1 -1
- data/lib/rbt/yaml/expanded_cookbooks/extracmakemodules.yml +1 -1
- data/lib/rbt/yaml/expanded_cookbooks/gdkpixbuf.yml +2 -2
- data/lib/rbt/yaml/expanded_cookbooks/kitinerary.yml +3 -3
- data/lib/rbt/yaml/expanded_cookbooks/libmpeg3.yml +2 -1
- data/lib/rbt/yaml/expanded_cookbooks/libproxy.yml +1 -1
- data/lib/rbt/yaml/expanded_cookbooks/nuvie.yml +1 -1
- data/lib/rbt/yaml/expanded_cookbooks/qt.yml +5 -5
- data/lib/rbt/yaml/expanded_cookbooks/sendmail.yml +14 -7
- data/lib/rbt/yaml/expanded_cookbooks/sharutils.yml +1 -1
- data/lib/rbt/yaml/expanded_cookbooks/squashfstools.yml +3 -3
- data/lib/rbt/yaml/expanded_cookbooks/wordpress.yml +10 -10
- data/lib/rbt/yaml/programs_version/available_programs_versions.md +3 -3
- data/lib/rbt/yaml/programs_version/the_expanded_coobkook_dataset_was_last_updated_on_this_day.yml +1 -1
- metadata +5 -4
@@ -12,6 +12,127 @@ class Action
|
|
12
12
|
|
13
13
|
class SoftwareManager < RBT::Action # === RBT::Action::SoftwareManager
|
14
14
|
|
15
|
+
# ========================================================================== #
|
16
|
+
# === will_the_extracted_source_archive_be_removed?
|
17
|
+
#
|
18
|
+
# A boolean value will be returned by this method. This boolean value
|
19
|
+
# determines whether the archive will be kept after it was extracted,
|
20
|
+
# or whether it will be removed again after it was extracted.
|
21
|
+
# ========================================================================== #
|
22
|
+
def will_the_extracted_source_archive_be_removed?
|
23
|
+
result = !cookbook_dataset_keep_extracted? # ← The default.
|
24
|
+
# ======================================================================== #
|
25
|
+
# Next check whether the user overrided this behaviour or not, via
|
26
|
+
# the appropriate commandline-flag:
|
27
|
+
# ======================================================================== #
|
28
|
+
user_variable = retain_the_extracted_source_archive?
|
29
|
+
if user_variable.nil? # Do nothing in this case.
|
30
|
+
else
|
31
|
+
result = !user_variable
|
32
|
+
end
|
33
|
+
return result
|
34
|
+
end; alias keep_the_extracted_archive? will_the_extracted_source_archive_be_removed? # === keep_the_extracted_archive?
|
35
|
+
alias keep_extracted_archive? will_the_extracted_source_archive_be_removed? # === keep_extracted_archive?
|
36
|
+
|
37
|
+
# ========================================================================== #
|
38
|
+
# === retain_the_extracted_source_archive?
|
39
|
+
#
|
40
|
+
# This is a query method towards the variable kept in the
|
41
|
+
# @instance_hash variable.
|
42
|
+
#
|
43
|
+
# It may only query, and never modify anything.
|
44
|
+
# ========================================================================== #
|
45
|
+
def retain_the_extracted_source_archive?
|
46
|
+
@internal_hash[:retain_the_extracted_source_archive]
|
47
|
+
end; alias keep_extracted? retain_the_extracted_source_archive? # === keep_extracted?
|
48
|
+
|
49
|
+
# ========================================================================== #
|
50
|
+
# === cookbook_dataset_keep_extracted?
|
51
|
+
#
|
52
|
+
# This method simply wraps over the cookbook_dataset keep_extracted value.
|
53
|
+
# ========================================================================== #
|
54
|
+
def cookbook_dataset_keep_extracted?
|
55
|
+
cookbook_dataset?.keep_extracted?
|
56
|
+
end; alias dataset_keep_extracted? cookbook_dataset_keep_extracted? # === dataset_keep_extracted?
|
57
|
+
|
58
|
+
# ========================================================================== #
|
59
|
+
# === will_be_extracted_towards?
|
60
|
+
#
|
61
|
+
# This method will tell us the full path of the extracted directory for
|
62
|
+
# the program at hand.
|
63
|
+
#
|
64
|
+
# A trailing '/' is required for the result of this method.
|
65
|
+
#
|
66
|
+
# Returns: a String.
|
67
|
+
# ========================================================================== #
|
68
|
+
def will_be_extracted_towards?
|
69
|
+
"#{rbt_log_directory?}#{program_name_and_program_version?}/"
|
70
|
+
end; alias extracted_source_archive_directory? will_be_extracted_towards? # === extracted_source_archive_directory?
|
71
|
+
|
72
|
+
# ========================================================================== #
|
73
|
+
# === cookbook_dataset_use_this_build_system?
|
74
|
+
#
|
75
|
+
# Query which build-system is to be used. This will determine how we
|
76
|
+
# will install a given program at hand.
|
77
|
+
# ========================================================================== #
|
78
|
+
def cookbook_dataset_use_this_build_system?
|
79
|
+
cookbook_dataset?.use_which_build_system?
|
80
|
+
end; alias use_this_build_system? cookbook_dataset_use_this_build_system? # === use_this_build_system?
|
81
|
+
alias build_system_in_use? cookbook_dataset_use_this_build_system? # === build_system_in_use?
|
82
|
+
alias cookbookset_dataset_use_which_build_system? cookbook_dataset_use_this_build_system? # === cookbookset_dataset_use_which_build_system?
|
83
|
+
alias cookbook_build_system? cookbook_dataset_use_this_build_system? # === cookbook_build_system?
|
84
|
+
|
85
|
+
# ========================================================================== #
|
86
|
+
# === can_be_compiled_statically?
|
87
|
+
# ========================================================================== #
|
88
|
+
def can_be_compiled_statically?
|
89
|
+
cookbooks_dataset?.send(__method__)
|
90
|
+
end
|
91
|
+
|
92
|
+
# ========================================================================= #
|
93
|
+
# === is_this_a_registered_binary?
|
94
|
+
# ========================================================================= #
|
95
|
+
def is_this_a_registered_binary?(i)
|
96
|
+
i != return_program_based_on_this_binary(i)
|
97
|
+
end
|
98
|
+
|
99
|
+
# ========================================================================= #
|
100
|
+
# === directory_rbt_profiles?
|
101
|
+
#
|
102
|
+
# This will point to a location such as
|
103
|
+
# "/home/Programs/Ruby/2.6.5/lib/ruby/site_ruby/2.6.0/rbt/misc/profiles/"
|
104
|
+
# ========================================================================= #
|
105
|
+
def directory_rbt_profiles?
|
106
|
+
DIRECTORY_RBT_PROFILES
|
107
|
+
end
|
108
|
+
|
109
|
+
# ========================================================================= #
|
110
|
+
# === is_a_gem_file?
|
111
|
+
#
|
112
|
+
# Query whether we have a .gem file at hand here.
|
113
|
+
# ========================================================================= #
|
114
|
+
def is_a_gem_file?(
|
115
|
+
i = program_path?
|
116
|
+
)
|
117
|
+
if i
|
118
|
+
i.to_s.end_with? '.gem'
|
119
|
+
end
|
120
|
+
end; alias is_a_gem? is_a_gem_file? # === is_a_gem?
|
121
|
+
|
122
|
+
# ========================================================================= #
|
123
|
+
# === is_on_32_bit_system?
|
124
|
+
# ========================================================================= #
|
125
|
+
def is_on_32_bit_system?
|
126
|
+
TARGET_CPU == 'i686'
|
127
|
+
end
|
128
|
+
|
129
|
+
# ========================================================================== #
|
130
|
+
# === appdir_prefix_points_at?
|
131
|
+
# ========================================================================== #
|
132
|
+
def appdir_prefix_points_at?
|
133
|
+
prefix_object?.prefix?
|
134
|
+
end
|
135
|
+
|
15
136
|
# ========================================================================== #
|
16
137
|
# === prefix_object?
|
17
138
|
# ========================================================================== #
|
@@ -856,20 +977,6 @@ class SoftwareManager < RBT::Action # === RBT::Action::SoftwareManager
|
|
856
977
|
action(:chained_programs) # Load the chained actions, then return it.
|
857
978
|
end
|
858
979
|
|
859
|
-
# ========================================================================== #
|
860
|
-
# === will_be_extracted_towards?
|
861
|
-
#
|
862
|
-
# This method will tell us the full path of the extracted directory for
|
863
|
-
# the program at hand.
|
864
|
-
#
|
865
|
-
# A trailing '/' is required for the result of this method.
|
866
|
-
#
|
867
|
-
# Returns: a String.
|
868
|
-
# ========================================================================== #
|
869
|
-
def will_be_extracted_towards?
|
870
|
-
"#{log_directory?}#{program_name_and_program_version?}/"
|
871
|
-
end
|
872
|
-
|
873
980
|
# ========================================================================== #
|
874
981
|
# === cookbook_aliases?
|
875
982
|
# ========================================================================== #
|
@@ -1635,13 +1742,6 @@ class SoftwareManager < RBT::Action # === RBT::Action::SoftwareManager
|
|
1635
1742
|
return result
|
1636
1743
|
end
|
1637
1744
|
|
1638
|
-
# ========================================================================== #
|
1639
|
-
# === appdir_prefix_points_at?
|
1640
|
-
# ========================================================================== #
|
1641
|
-
def appdir_prefix_points_at?
|
1642
|
-
real_prefix?.prefix?
|
1643
|
-
end
|
1644
|
-
|
1645
1745
|
# ======================================================================= #
|
1646
1746
|
# === cookbook_program_name_and_program_version?
|
1647
1747
|
# ======================================================================= #
|
@@ -280,6 +280,13 @@ class SoftwareManager < RBT::Action # === RBT::Action::SoftwareManager
|
|
280
280
|
# ======================================================================= #
|
281
281
|
@internal_hash[:cookbook_dataset] = nil
|
282
282
|
# ======================================================================= #
|
283
|
+
# === :retain_the_extracted_source_archive
|
284
|
+
#
|
285
|
+
# This variable will retain the extracted source archive, aka
|
286
|
+
# "keep the extracted archive", rather than to remove it.
|
287
|
+
# ======================================================================= #
|
288
|
+
@internal_hash[:retain_the_extracted_source_archive] = nil
|
289
|
+
# ======================================================================= #
|
283
290
|
# === :user_prefix
|
284
291
|
#
|
285
292
|
# This prefix can be determined by the user.
|
@@ -565,13 +572,6 @@ class SoftwareManager < RBT::Action # === RBT::Action::SoftwareManager
|
|
565
572
|
# ======================================================================= #
|
566
573
|
@internal_hash[:keep_la_files] = nil
|
567
574
|
# ======================================================================= #
|
568
|
-
# === :keep_the_archive_extracted
|
569
|
-
#
|
570
|
-
# The keep-extracted setting will lateron be sanitized. The default
|
571
|
-
# value will be nil.
|
572
|
-
# ======================================================================= #
|
573
|
-
@internal_hash[:keep_the_archive_extracted] = nil
|
574
|
-
# ======================================================================= #
|
575
575
|
# === :may_we_download
|
576
576
|
# ======================================================================= #
|
577
577
|
@internal_hash[:may_we_download] = RBT::TRY_TO_DOWNLOAD_IF_NOT_FOUND
|
@@ -12,6 +12,439 @@ class Action
|
|
12
12
|
|
13
13
|
class SoftwareManager < RBT::Action # === RBT::Action::SoftwareManager
|
14
14
|
|
15
|
+
# ========================================================================= #
|
16
|
+
# === set_retain_the_extracted_source_archive
|
17
|
+
# ========================================================================= #
|
18
|
+
def set_retain_the_extracted_source_archive(
|
19
|
+
i = true
|
20
|
+
)
|
21
|
+
@internal_hash[:retain_the_extracted_source_archive] = true
|
22
|
+
end; alias set_keep_the_extracted_archive set_retain_the_extracted_source_archive # === set_keep_the_extracted_archive
|
23
|
+
|
24
|
+
# ========================================================================= #
|
25
|
+
# === do_retain_the_extracted_source_archive
|
26
|
+
#
|
27
|
+
# This delegates towards the method called
|
28
|
+
# .set_retain_the_extracted_source_archive().
|
29
|
+
#
|
30
|
+
# It may also optionally report to the user as to what is being done.
|
31
|
+
# ========================================================================= #
|
32
|
+
def do_retain_the_extracted_source_archive(
|
33
|
+
be_verbose = be_verbose?
|
34
|
+
)
|
35
|
+
case be_verbose
|
36
|
+
# ======================================================================= #
|
37
|
+
# === :be_silent
|
38
|
+
# ======================================================================= #
|
39
|
+
when :be_silent,
|
40
|
+
:be_quiet
|
41
|
+
be_verbose = false
|
42
|
+
end
|
43
|
+
if be_verbose
|
44
|
+
orev 'The extracted directory will not be removed after'
|
45
|
+
orev 'compilation / installation has finished.'
|
46
|
+
end
|
47
|
+
set_retain_the_extracted_source_archive(true)
|
48
|
+
end; alias do_set_keep_extracted do_retain_the_extracted_source_archive # === do_set_keep_extracted
|
49
|
+
alias do_set_keep_extracted_archive do_retain_the_extracted_source_archive # === do_set_keep_extracted_archive
|
50
|
+
|
51
|
+
# ========================================================================= #
|
52
|
+
# === set_dont_keep_archive
|
53
|
+
#
|
54
|
+
# Use this method when you don't want to keep the extracted archive.
|
55
|
+
# ========================================================================= #
|
56
|
+
def set_dont_keep_archive(
|
57
|
+
be_verbose = true
|
58
|
+
)
|
59
|
+
if be_verbose
|
60
|
+
orev 'We will not keep our extracted archive.'
|
61
|
+
end
|
62
|
+
@internal_hash[:keep_the_extracted_archive] = false
|
63
|
+
end
|
64
|
+
|
65
|
+
# ========================================================================= #
|
66
|
+
# === set_keep_the_extracted_archive
|
67
|
+
#
|
68
|
+
# This method will keep the source-archive extracted. Note that this
|
69
|
+
# is not the default - by default we will remove the extracted
|
70
|
+
# archive.
|
71
|
+
# ========================================================================= #
|
72
|
+
def set_keep_the_extracted_archive(
|
73
|
+
i = true
|
74
|
+
)
|
75
|
+
@internal_hash[:keep_the_extracted_archive] = i
|
76
|
+
end; alias set_keep_extracted_archive set_keep_the_extracted_archive # === set_keep_extracted_archive
|
77
|
+
alias set_keep_extracted set_keep_the_extracted_archive # === set_keep_extracted
|
78
|
+
alias do_not_remove_the_extracted_archive set_keep_the_extracted_archive # === do_not_remove_the_extracted_archive
|
79
|
+
alias do_not_remove_extracted_archive set_keep_the_extracted_archive # === do_not_remove_extracted_archive
|
80
|
+
|
81
|
+
# ========================================================================== #
|
82
|
+
# === set_short_name
|
83
|
+
# ========================================================================== #
|
84
|
+
def set_short_name(i)
|
85
|
+
cookbook_dataset?.set_short_name(i)
|
86
|
+
end; alias set_real_short_name set_short_name # === set_real_short_name
|
87
|
+
|
88
|
+
# =========================================================================== #
|
89
|
+
# === set_internal_pid
|
90
|
+
# =========================================================================== #
|
91
|
+
def set_internal_pid(i = nil)
|
92
|
+
@internal_hash[:pid] = i
|
93
|
+
end; alias set_pid set_internal_pid # === set_pid
|
94
|
+
|
95
|
+
# ========================================================================= #
|
96
|
+
# === set_these_env_variables
|
97
|
+
#
|
98
|
+
# This method can be used to modify ENV variables.
|
99
|
+
#
|
100
|
+
# The first input argument to this method should be the Hash, consisting
|
101
|
+
# of the key-value pairs in the form of key being the NAME of the shell
|
102
|
+
# variable that is to be modified; and the corresponding value being
|
103
|
+
# the new VALUE that you wish to set this variable to.
|
104
|
+
#
|
105
|
+
# The third argument to this method determines whether we will output
|
106
|
+
# what we do to the user. By default this is true, but sometimes we
|
107
|
+
# may want to be able to quietly set these environment variables,
|
108
|
+
# such as when we attempt to use clang.
|
109
|
+
#
|
110
|
+
# Legitimate usage examples for this method, in ruby, would be:
|
111
|
+
#
|
112
|
+
# set_this_env_variable 'CFLAGS = -gcc'
|
113
|
+
# set_this_env_variable 'LIBS: -lpthread'
|
114
|
+
#
|
115
|
+
# ========================================================================= #
|
116
|
+
def set_these_env_variables(
|
117
|
+
hash_or_string, # We allow Hash and String as input. But String must be in a special format.
|
118
|
+
do_which_action = :report_only,
|
119
|
+
be_verbose = true,
|
120
|
+
&block
|
121
|
+
)
|
122
|
+
if block_given?
|
123
|
+
yielded = yield
|
124
|
+
if yielded.is_a? Symbol
|
125
|
+
do_which_action = yielded
|
126
|
+
end
|
127
|
+
end
|
128
|
+
unless @internal_hash[:do_not_use_special_flags]
|
129
|
+
case do_which_action
|
130
|
+
# ===================================================================== #
|
131
|
+
# === :be_quiet
|
132
|
+
# ===================================================================== #
|
133
|
+
when :be_quiet,
|
134
|
+
:be_silent
|
135
|
+
be_verbose = false
|
136
|
+
# =================================================================== #
|
137
|
+
# Also change the do_which_action variable.
|
138
|
+
# =================================================================== #
|
139
|
+
do_which_action = :do_set_these_variables
|
140
|
+
end
|
141
|
+
case be_verbose
|
142
|
+
# ===================================================================== #
|
143
|
+
# === :be_verbose
|
144
|
+
# ===================================================================== #
|
145
|
+
when :be_verbose
|
146
|
+
be_verbose = true
|
147
|
+
# ===================================================================== #
|
148
|
+
# === :be_quiet
|
149
|
+
# ===================================================================== #
|
150
|
+
when :be_quiet,
|
151
|
+
:be_silent
|
152
|
+
be_verbose = false
|
153
|
+
end
|
154
|
+
# ===================================================================== #
|
155
|
+
# === Next, handle Strings
|
156
|
+
# ===================================================================== #
|
157
|
+
if hash_or_string.is_a? String
|
158
|
+
if hash_or_string.include?('=') or
|
159
|
+
hash_or_string.include?(':')
|
160
|
+
if hash_or_string.include?('=')
|
161
|
+
use_this_as_split_token = '='
|
162
|
+
elsif hash_or_string.include?(':')
|
163
|
+
use_this_as_split_token = ':'
|
164
|
+
end
|
165
|
+
splitted = hash_or_string.sub(/^export /,'').split(use_this_as_split_token)
|
166
|
+
this_key = splitted.first
|
167
|
+
this_value = splitted.last
|
168
|
+
hash_or_string = { this_key => this_value }
|
169
|
+
end
|
170
|
+
end
|
171
|
+
# ===================================================================== #
|
172
|
+
# === Next, handle Hashes
|
173
|
+
# ===================================================================== #
|
174
|
+
hash_or_string.each_pair {|key, value|
|
175
|
+
value.strip! if value.is_a? String
|
176
|
+
# =================================================================== #
|
177
|
+
# Make some exceptions, e. g. for gems.
|
178
|
+
# =================================================================== #
|
179
|
+
return if cookbook_dataset_has_been_initialized? and is_a_gem?
|
180
|
+
if be_verbose and is_compiled? and !extract_only? and not value.to_s.empty?
|
181
|
+
# ================================================================== #
|
182
|
+
# Notify the user as to the env-value modification. Since as of
|
183
|
+
# November 2018 we will no longer use opnn() here.
|
184
|
+
# ================================================================== #
|
185
|
+
e " #{sfancy(key)} #{rev}will be set to the "\
|
186
|
+
"value(s): #{lightblue(value.to_s)}#{rev}"
|
187
|
+
end
|
188
|
+
if value.is_a? FalseClass or
|
189
|
+
value.is_a? TrueClass or
|
190
|
+
value.is_a? Integer
|
191
|
+
value = value.to_s
|
192
|
+
end
|
193
|
+
case do_which_action
|
194
|
+
when :do_set_these_variables
|
195
|
+
# ================================================================== #
|
196
|
+
# Next set the value to the environment variable.
|
197
|
+
# ================================================================== #
|
198
|
+
ENV[key] = value
|
199
|
+
end
|
200
|
+
}
|
201
|
+
end
|
202
|
+
end; alias set_this_env_variable set_these_env_variables # === set_this_env_variable
|
203
|
+
|
204
|
+
# ========================================================================= #
|
205
|
+
# === set_extracted_base_directory
|
206
|
+
# ========================================================================= #
|
207
|
+
def set_extracted_base_directory(i)
|
208
|
+
@internal_hash[:extracted_base_directory] = i
|
209
|
+
end
|
210
|
+
|
211
|
+
# ========================================================================= #
|
212
|
+
# === set_really_compile_this_program
|
213
|
+
# ========================================================================= #
|
214
|
+
def set_really_compile_this_program(i = :qt)
|
215
|
+
set_compile_this_program(i)
|
216
|
+
set_compile_these_programs(i) if compile_these_programs?.empty?
|
217
|
+
initialize_cookbook_dataset
|
218
|
+
end
|
219
|
+
|
220
|
+
# ========================================================================= #
|
221
|
+
# === set_user_prefix (set_prefix tag, set prefix tag)
|
222
|
+
#
|
223
|
+
# This method can be used by the user, to designate another prefix in
|
224
|
+
# use for the given program. This will be the target directory into
|
225
|
+
# which the program will be installed into.
|
226
|
+
#
|
227
|
+
# A specialized class, called RBT::Prefix, will handle the prefix.
|
228
|
+
# ========================================================================= #
|
229
|
+
def set_user_prefix(
|
230
|
+
i = :appdir_prefix
|
231
|
+
)
|
232
|
+
# ======================================================================= #
|
233
|
+
# We must rewrite the program version in the following case.
|
234
|
+
#
|
235
|
+
# The input may look like this:
|
236
|
+
#
|
237
|
+
# "/Programs/Gobjectintrospection/1.53.4/"
|
238
|
+
#
|
239
|
+
# ======================================================================= #
|
240
|
+
if i and use_this_specific_program_version?
|
241
|
+
if i.is_a?(String) and i.include?(programs_directory?)
|
242
|
+
use_this_regex = /(\d{1,2}\.?\d{1,2}\.?\d{1,2}\/)$/ # See: http://rubular.com/r/PPb2Y96XfF
|
243
|
+
i.sub!(use_this_regex, use_this_specific_program_version?)
|
244
|
+
i << '/' unless i.end_with? '/'
|
245
|
+
elsif i.is_a?(Symbol)
|
246
|
+
i = use_this_specific_program_version?
|
247
|
+
end
|
248
|
+
end
|
249
|
+
if i.is_a? Symbol
|
250
|
+
# ===================================================================== #
|
251
|
+
# Next, perform some sanitize operations.
|
252
|
+
#
|
253
|
+
# This clause will handle Symbols such as :app_dir_like or
|
254
|
+
# :use_ntrad_prefix_at_a_later_time.
|
255
|
+
# ===================================================================== #
|
256
|
+
case i.to_s # case tag
|
257
|
+
# ===================================================================== #
|
258
|
+
# === ULOCAL
|
259
|
+
#
|
260
|
+
# This refers to the commonly used /usr/local/ directory.
|
261
|
+
# ===================================================================== #
|
262
|
+
when 'ULOCAL'
|
263
|
+
i = '/usr/local/'
|
264
|
+
# ===================================================================== #
|
265
|
+
# === trad
|
266
|
+
# ===================================================================== #
|
267
|
+
when /^trad$/
|
268
|
+
i = '/usr/'
|
269
|
+
# ===================================================================== #
|
270
|
+
# === --opt_prefix
|
271
|
+
# ===================================================================== #
|
272
|
+
when /^-?-?opt(_|-)?prefix$/,
|
273
|
+
:opt
|
274
|
+
i = '/opt/'
|
275
|
+
# ===================================================================== #
|
276
|
+
# === non_traditional
|
277
|
+
#
|
278
|
+
# This entry point has various aliases such as :ntrad.
|
279
|
+
# ===================================================================== #
|
280
|
+
when /^app(_|-)?dir$/,
|
281
|
+
/^app(_|-)?dir(_|-)?like$/,
|
282
|
+
/^use(_|-)?appdir(_|-)?prefix$/i,
|
283
|
+
/^use(_|-)?ntrad(_|-)?prefix(_|-)?at(_|-)?a(_|-)?later(_|-)?time$/i,
|
284
|
+
'non_traditional',
|
285
|
+
'gobolinux',
|
286
|
+
'ntrad',
|
287
|
+
'default',
|
288
|
+
'app_dir_like',
|
289
|
+
'appdir',
|
290
|
+
'return_appdir_path',
|
291
|
+
'false',
|
292
|
+
'f',
|
293
|
+
'appdir_prefix',
|
294
|
+
''
|
295
|
+
prefix?.clear_program # Clear it initially.
|
296
|
+
prefix?.do_use_appdir_prefix
|
297
|
+
if handle_which_program?
|
298
|
+
i = return_non_traditional_prefix(handle_which_program?)
|
299
|
+
end
|
300
|
+
# =================================================================== #
|
301
|
+
# Since as of May 2014 we get rid of all '-'
|
302
|
+
# =================================================================== #
|
303
|
+
i.delete!('-') if i.respond_to?(:include?) and i.include? '-'
|
304
|
+
end
|
305
|
+
# ===================================================================== #
|
306
|
+
# === Convert environment variables, if given, and unfreeze frozen
|
307
|
+
# Strings
|
308
|
+
# ===================================================================== #
|
309
|
+
if i.is_a?(String)
|
310
|
+
# =================================================================== #
|
311
|
+
# Unfreeze frozen Strings.
|
312
|
+
# =================================================================== #
|
313
|
+
if i.is_a? String and i.frozen?
|
314
|
+
i = i.dup # "unfreeze" it.
|
315
|
+
end
|
316
|
+
# =================================================================== #
|
317
|
+
# === Handle Strings that start with the ':' character
|
318
|
+
#
|
319
|
+
# Handle the situation when we input a String that starts with
|
320
|
+
# the character ':'. This will be assumed to be a shortcut to
|
321
|
+
# an environment variable.
|
322
|
+
# =================================================================== #
|
323
|
+
if i.start_with?(':')
|
324
|
+
# ================================================================== #
|
325
|
+
# Next, we must add the proper program_version. This is either the
|
326
|
+
# program_version at hand - or it is an ENV variable if it exists.
|
327
|
+
# We check for the ENV variable first.
|
328
|
+
# ================================================================== #
|
329
|
+
this_key = (i.delete(':').upcase+'_PREFIX').dup
|
330
|
+
if ENV.has_key? this_key
|
331
|
+
# =============================================================== #
|
332
|
+
# The environment variables must be UPCASED and have appended
|
333
|
+
# the string '_PREFIX'.
|
334
|
+
# =============================================================== #
|
335
|
+
i = ENV[this_key].dup.to_s
|
336
|
+
else
|
337
|
+
# =============================================================== #
|
338
|
+
# Assume a special prefix variant targetting the /Programs/
|
339
|
+
# hierarchy.
|
340
|
+
# =============================================================== #
|
341
|
+
i = programs_directory?+i.to_s.delete(':').capitalize+'/'
|
342
|
+
i << program_version?.dup.to_s
|
343
|
+
end
|
344
|
+
end
|
345
|
+
if i.include?('$')
|
346
|
+
i = convert_env_variable(i) # Replace ENV variables here.
|
347
|
+
i << '/' unless i.end_with? '/'
|
348
|
+
end
|
349
|
+
if i.include? '--'
|
350
|
+
if i.include? '--prefix=' # Input is assumed to be like '--prefix=/Depot/j'
|
351
|
+
i = i.split('=').last # ← Obtain just the last part in this case.
|
352
|
+
end
|
353
|
+
end
|
354
|
+
end
|
355
|
+
# ===================================================================== #
|
356
|
+
# === Ensure a trailing '/' for directories.
|
357
|
+
# ===================================================================== #
|
358
|
+
unless i.to_s.end_with? '/' # .to_s to protect against Symbols given.
|
359
|
+
i << '/' if File.directory?(i.to_s)
|
360
|
+
end
|
361
|
+
end
|
362
|
+
# ======================================================================= #
|
363
|
+
# Next, we must check for post-install actions and modify these,
|
364
|
+
# if they exist. We only do so if we have an AppDir-prefix.
|
365
|
+
# ======================================================================= #
|
366
|
+
if is_an_appdir_prefix?(i.to_s)
|
367
|
+
consider_modifying_postinstall
|
368
|
+
end
|
369
|
+
prefix_object?.use_this_as_the_new_prefix = i
|
370
|
+
end; alias set_use_this_prefix set_user_prefix # === set_use_this_prefix
|
371
|
+
alias prefix= set_user_prefix # === prefix=
|
372
|
+
alias set_prefix set_user_prefix # === set_prefix
|
373
|
+
alias set_prefix_to_use set_user_prefix # === set_prefix_to_use
|
374
|
+
|
375
|
+
# ========================================================================== #
|
376
|
+
# === cookbook_dataset_set_program_version
|
377
|
+
# ========================================================================== #
|
378
|
+
def cookbook_dataset_set_program_version(i)
|
379
|
+
cookbook_dataset?.set_program_version(i)
|
380
|
+
end
|
381
|
+
|
382
|
+
# ========================================================================== #
|
383
|
+
# === set_description
|
384
|
+
# ========================================================================== #
|
385
|
+
def set_description(i)
|
386
|
+
cookbook_dataset?.set_description(i)
|
387
|
+
end; alias set_desc set_description # === set_desc
|
388
|
+
|
389
|
+
# ========================================================================== ##
|
390
|
+
# === set_is_an_abbreviation
|
391
|
+
# ========================================================================== #
|
392
|
+
def set_is_an_abbreviation(i = true)
|
393
|
+
@internal_hash[:is_an_abbreviation] = i
|
394
|
+
end
|
395
|
+
|
396
|
+
# ========================================================================= #
|
397
|
+
# === set_cflags (cflags tag)
|
398
|
+
#
|
399
|
+
# This method will enable you to set i.e. new cflags. This then also
|
400
|
+
# allows you to compile some programs in a different manner, such as
|
401
|
+
# if you wish to compile that particular program statically.
|
402
|
+
#
|
403
|
+
# The default argument to this method will be a copy of ENV['CFLAGS'].
|
404
|
+
#
|
405
|
+
# You can overrule this via a shortcut, if you want to, by passing
|
406
|
+
# true as argument, or even better, a Symol such as :static. This
|
407
|
+
# will then allow you to perform the static build, if the program
|
408
|
+
# at hand allows for this.
|
409
|
+
#
|
410
|
+
# -static-libgcc may also be an option here.
|
411
|
+
#
|
412
|
+
# The variable LDFLAGS may be important as well.
|
413
|
+
#
|
414
|
+
# For instance:
|
415
|
+
#
|
416
|
+
# make LDFLAGS=-all-static
|
417
|
+
#
|
418
|
+
# ========================================================================= #
|
419
|
+
def set_cflags(
|
420
|
+
i = default_cflags?,
|
421
|
+
&block
|
422
|
+
)
|
423
|
+
case i # case tag
|
424
|
+
# ======================================================================= #
|
425
|
+
# === :clear
|
426
|
+
# ======================================================================= #
|
427
|
+
when :clear
|
428
|
+
i = ''
|
429
|
+
# ======================================================================= #
|
430
|
+
# Enable static builds for the CFLAGS at hand
|
431
|
+
# ======================================================================= #
|
432
|
+
when :overrule_static_build,
|
433
|
+
:static,
|
434
|
+
:build_static,
|
435
|
+
true
|
436
|
+
i = "#{old_cflags?} -static -g"
|
437
|
+
end
|
438
|
+
# ======================================================================= #
|
439
|
+
# Do the actual assignment next.
|
440
|
+
# ======================================================================= #
|
441
|
+
set_this_env_variable(
|
442
|
+
"CFLAGS: #{i}",
|
443
|
+
:do_set_these_variables,
|
444
|
+
&block
|
445
|
+
)
|
446
|
+
end
|
447
|
+
|
15
448
|
# ========================================================================= #
|
16
449
|
# === set_use_this_prefix
|
17
450
|
#
|
@@ -105,20 +538,6 @@ class SoftwareManager < RBT::Action # === RBT::Action::SoftwareManager
|
|
105
538
|
@internal_hash[:extract_to_this_directory_as_specified_by_the_user] = i
|
106
539
|
end
|
107
540
|
|
108
|
-
# ========================================================================= #
|
109
|
-
# === set_keep_the_extracted_archive
|
110
|
-
#
|
111
|
-
# This method will keep the source-archive extracted. Note that this
|
112
|
-
# is not the default - by default we will remove the extracted
|
113
|
-
# archive.
|
114
|
-
# ========================================================================= #
|
115
|
-
def set_keep_the_extracted_archive(i = true)
|
116
|
-
@internal_hash[:keep_the_extracted_archive] = i
|
117
|
-
end; alias set_keep_extracted_archive set_keep_the_extracted_archive # === set_keep_extracted_archive
|
118
|
-
alias set_keep_extracted set_keep_the_extracted_archive # === set_keep_extracted
|
119
|
-
alias do_not_remove_the_extracted_archive set_keep_the_extracted_archive # === do_not_remove_the_extracted_archive
|
120
|
-
alias do_not_remove_extracted_archive set_keep_the_extracted_archive # === do_not_remove_extracted_archive
|
121
|
-
|
122
541
|
# ========================================================================= #
|
123
542
|
# === set_program_name_and_program_version
|
124
543
|
#
|
@@ -558,20 +977,6 @@ class SoftwareManager < RBT::Action # === RBT::Action::SoftwareManager
|
|
558
977
|
@internal_hash[:do_not_symlink] = true
|
559
978
|
end; alias do_not_symlink set_do_not_symlink # === do_not_symlink
|
560
979
|
|
561
|
-
# ========================================================================= #
|
562
|
-
# === set_dont_keep_archive
|
563
|
-
#
|
564
|
-
# Use this method when you don't want to keep the extracted archive.
|
565
|
-
# ========================================================================= #
|
566
|
-
def set_dont_keep_archive(
|
567
|
-
be_verbose = true
|
568
|
-
)
|
569
|
-
if be_verbose
|
570
|
-
orev 'We will not keep our extracted archive.'
|
571
|
-
end
|
572
|
-
@internal_hash[:keep_the_extracted_archive] = false
|
573
|
-
end
|
574
|
-
|
575
980
|
# ========================================================================= #
|
576
981
|
# === set_use_these_configure_options
|
577
982
|
# ========================================================================= #
|
@@ -64,6 +64,7 @@ class SoftwareManager < RBT::Action # === RBT::Action::SoftwareManager
|
|
64
64
|
rescue LoadError; end
|
65
65
|
end
|
66
66
|
|
67
|
+
require 'rbt/actions/individual_actions/software_manager/actions.rb'
|
67
68
|
require 'rbt/actions/individual_actions/software_manager/initialize.rb'
|
68
69
|
require 'rbt/actions/individual_actions/software_manager/extract_related_code.rb'
|
69
70
|
require 'rbt/actions/individual_actions/software_manager/logic_related_code.rb'
|