environment_information 1.4.124 → 1.5.5
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.
- checksums.yaml +4 -4
- data/README.md +91 -15
- data/doc/README.gen +42 -14
- data/doc/todo/TODO_FOR_THE_ENVIRONMENT_INFORMATION_PROJECT.md +16 -12
- data/lib/environment_information/base/base.rb +483 -99
- data/lib/environment_information/colours/colours.rb +92 -66
- data/lib/environment_information/commandline/commandline.rb +137 -0
- data/lib/environment_information/constants/constants.rb +372 -11
- data/lib/environment_information/project/project.rb +1 -1
- data/lib/environment_information/query/constants.rb +46 -0
- data/lib/environment_information/query/help.rb +88 -0
- data/lib/environment_information/query/menu.rb +487 -0
- data/lib/environment_information/query/misc.rb +2006 -0
- data/lib/environment_information/query/query.rb +245 -0
- data/lib/environment_information/query/reset.rb +202 -0
- data/lib/environment_information/query/run.rb +70 -0
- data/lib/environment_information/requires/require_the_environment_information_project.rb +2 -7
- data/lib/environment_information/requires/require_the_toplevel_methods.rb +1 -3
- data/lib/environment_information/toplevel_methods/toplevel_methods.rb +2258 -0
- data/lib/environment_information/version/version.rb +2 -2
- data/lib/environment_information/www/sinatra_interface.rb +20 -17
- data/lib/environment_information/www/webobject_interface.cgi +6 -7
- data/lib/environment_information/yaml/colours.yml +3 -3
- data/lib/environment_information/yaml/query_to_use_for_all_components.yml +284 -0
- data/lib/environment_information/yaml/{array_tracked_programs.yml → track_these_components.yml} +77 -11
- metadata +18 -60
- data/lib/environment_information/class/class.rb +0 -2580
- data/lib/environment_information/class/colours.rb +0 -282
- data/lib/environment_information/colours/sfancy.rb +0 -19
- data/lib/environment_information/colours/simp.rb +0 -19
- data/lib/environment_information/constants/array_tracked_components.rb +0 -210
- data/lib/environment_information/constants/encoding.rb +0 -21
- data/lib/environment_information/constants/error_line.rb +0 -17
- data/lib/environment_information/constants/file_constants.rb +0 -102
- data/lib/environment_information/constants/misc.rb +0 -86
- data/lib/environment_information/constants/namespace.rb +0 -14
- data/lib/environment_information/constants/newline.rb +0 -16
- data/lib/environment_information/constants/regex.rb +0 -30
- data/lib/environment_information/constants/temp_directory.rb +0 -52
- data/lib/environment_information/misc_components/README.md +0 -3
- data/lib/environment_information/misc_components/cflags.rb +0 -36
- data/lib/environment_information/misc_components/cpuinfo.rb +0 -64
- data/lib/environment_information/misc_components/operating_system.rb +0 -54
- data/lib/environment_information/misc_components/operating_system_bit_type.rb +0 -42
- data/lib/environment_information/misc_components/ram.rb +0 -30
- data/lib/environment_information/misc_components/rubygems_installation_directory.rb +0 -54
- data/lib/environment_information/misc_components/screen_resolution.rb +0 -50
- data/lib/environment_information/queries/README.md +0 -2
- data/lib/environment_information/queries/complex_version.rb +0 -273
- data/lib/environment_information/queries/pkg_config.rb +0 -125
- data/lib/environment_information/queries/simple_version.rb +0 -272
- data/lib/environment_information/requires/require_the_individual_misc_components.rb +0 -30
- data/lib/environment_information/toplevel_methods/autogenerate_all_relevant_methods.rb +0 -153
- data/lib/environment_information/toplevel_methods/cd.rb +0 -16
- data/lib/environment_information/toplevel_methods/e.rb +0 -43
- data/lib/environment_information/toplevel_methods/hash.rb +0 -65
- data/lib/environment_information/toplevel_methods/internet_is_available.rb +0 -30
- data/lib/environment_information/toplevel_methods/is_on_roebe.rb +0 -16
- data/lib/environment_information/toplevel_methods/menu.rb +0 -90
- data/lib/environment_information/toplevel_methods/misc.rb +0 -324
- data/lib/environment_information/toplevel_methods/n_subcommands.rb +0 -31
- data/lib/environment_information/toplevel_methods/prefix_to_use.rb +0 -39
- data/lib/environment_information/toplevel_methods/register_this_component_is_missing.rb +0 -61
- data/lib/environment_information/toplevel_methods/remote_url_of_this_program.rb +0 -45
- data/lib/environment_information/toplevel_methods/replay_from_the_stored_file.rb +0 -84
- data/lib/environment_information/toplevel_methods/return_alias_to.rb +0 -30
- data/lib/environment_information/toplevel_methods/return_pkgconfig_based_programs.rb +0 -28
- data/lib/environment_information/toplevel_methods/return_remote_gtk2_version.rb +0 -54
- data/lib/environment_information/toplevel_methods/return_simple_version_based_programs.rb +0 -28
- data/lib/environment_information/toplevel_methods/return_version_of_this_program.rb +0 -182
- data/lib/environment_information/toplevel_methods/show_all_available_components.rb +0 -192
- data/lib/environment_information/toplevel_methods/write_what_into.rb +0 -24
- data/lib/environment_information/yaml/array_default_programs_on_linux.yml +0 -15
- data/lib/environment_information/yaml/array_lfs_core_programs.yml +0 -37
- data/lib/environment_information/yaml/array_science_cluster.yml +0 -12
- data/lib/environment_information/yaml/array_tracked_non_programs.yml +0 -13
- data/lib/environment_information/yaml/array_tracked_xorg_components.yml +0 -37
- data/lib/environment_information/yaml/query_to_use_for_the_individual_components.yml +0 -284
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/ruby -w
|
|
2
|
-
# Encoding: UTF-8
|
|
3
|
-
# frozen_string_literal: true
|
|
4
|
-
# =========================================================================== #
|
|
5
|
-
# require 'environment_information/toplevel_methods/return_remote_gtk2_version.rb'
|
|
6
|
-
# EnvironmentInformation.return_remote_gtk2_version
|
|
7
|
-
# =========================================================================== #
|
|
8
|
-
module EnvironmentInformation
|
|
9
|
-
|
|
10
|
-
require 'environment_information/toplevel_methods/internet_is_available.rb'
|
|
11
|
-
|
|
12
|
-
# ========================================================================= #
|
|
13
|
-
# === EnvironmentInformation.return_remote_gtk2_version
|
|
14
|
-
#
|
|
15
|
-
# This method can be used to obtain the latest gtk2-version, from a
|
|
16
|
-
# remote URL.
|
|
17
|
-
#
|
|
18
|
-
# The reason why this was necessary is because the RBT project may not
|
|
19
|
-
# always keep the latest gtk2 version, since gtk3 (and so forth) is more
|
|
20
|
-
# recent. Since we may still have to find out which gtk2 version is the
|
|
21
|
-
# most recent, we need a method to do so - which is precisely what this
|
|
22
|
-
# method here is doing.
|
|
23
|
-
# ========================================================================= #
|
|
24
|
-
def self.return_remote_gtk2_version
|
|
25
|
-
# ======================================================================= #
|
|
26
|
-
# We will use a hardcoded URL pointing towards gtk2:
|
|
27
|
-
# ======================================================================= #
|
|
28
|
-
remote_url = 'https://ftp.gnome.org/pub/GNOME/sources/gtk+/2.24/?C=M;O=D'
|
|
29
|
-
require 'open-uri'
|
|
30
|
-
newest_version = ''
|
|
31
|
-
# ======================================================================= #
|
|
32
|
-
# We will next try to obtain the remote dataset, but this would
|
|
33
|
-
# fail if we have no www-connection, so we must rescue this step.
|
|
34
|
-
# ======================================================================= #
|
|
35
|
-
if internet_is_available?
|
|
36
|
-
begin
|
|
37
|
-
dataset = URI.open(remote_url).read
|
|
38
|
-
use_this_regex =
|
|
39
|
-
/<a href="gtk\+\-(\d.\d\d.\d\d).tar.xz"><img src=/
|
|
40
|
-
scanned = dataset.scan(use_this_regex).flatten
|
|
41
|
-
newest_version = scanned.first
|
|
42
|
-
rescue SocketError => error
|
|
43
|
-
puts "It seems as if we have no working internet "\
|
|
44
|
-
"connection (#{sfancy(error.class)})"
|
|
45
|
-
end
|
|
46
|
-
end
|
|
47
|
-
return newest_version.strip # ← And return it here.
|
|
48
|
-
end
|
|
49
|
-
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
if __FILE__ == $PROGRAM_NAME
|
|
53
|
-
puts EnvironmentInformation.return_remote_gtk2_version
|
|
54
|
-
end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/ruby -w
|
|
2
|
-
# Encoding: UTF-8
|
|
3
|
-
# frozen_string_literal: true
|
|
4
|
-
# =========================================================================== #
|
|
5
|
-
# require 'environment_information/toplevel_methods/return_simple_version_based_programs.rb'
|
|
6
|
-
# =========================================================================== #
|
|
7
|
-
module EnvironmentInformation
|
|
8
|
-
|
|
9
|
-
require 'environment_information/constants/file_constants.rb'
|
|
10
|
-
|
|
11
|
-
# ========================================================================= #
|
|
12
|
-
# === EnvironmentInformation.return_simple_version_based_programs
|
|
13
|
-
# ========================================================================= #
|
|
14
|
-
def self.return_simple_version_based_programs
|
|
15
|
-
dataset = YAML.load_file(file_query_to_use_for_the_individual_components)
|
|
16
|
-
dataset.select {|key, value|
|
|
17
|
-
# ===================================================================== #
|
|
18
|
-
# The next query will select only for :version entries.
|
|
19
|
-
# ===================================================================== #
|
|
20
|
-
value == :version
|
|
21
|
-
}.keys
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
if __FILE__ == $PROGRAM_NAME
|
|
27
|
-
pp EnvironmentInformation.return_simple_version_based_programs
|
|
28
|
-
end
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/ruby -w
|
|
2
|
-
# Encoding: UTF-8
|
|
3
|
-
# frozen_string_literal: true
|
|
4
|
-
# =========================================================================== #
|
|
5
|
-
# require 'environment_information/toplevel_methods/return_version_of_this_program.rb'
|
|
6
|
-
# EnvironmentInformation.return_version_of_this_program
|
|
7
|
-
# =========================================================================== #
|
|
8
|
-
module EnvironmentInformation
|
|
9
|
-
|
|
10
|
-
require 'yaml'
|
|
11
|
-
require 'environment_information/colours/colours.rb'
|
|
12
|
-
require 'environment_information/constants/array_tracked_components.rb'
|
|
13
|
-
require 'environment_information/constants/error_line.rb'
|
|
14
|
-
require 'environment_information/constants/misc.rb'
|
|
15
|
-
require 'environment_information/constants/newline.rb'
|
|
16
|
-
require 'environment_information/toplevel_methods/e.rb'
|
|
17
|
-
require 'environment_information/toplevel_methods/prefix_to_use.rb'
|
|
18
|
-
require 'environment_information/toplevel_methods/return_alias_to.rb'
|
|
19
|
-
require 'environment_information/requires/require_the_individual_misc_components.rb'
|
|
20
|
-
require 'environment_information/queries/pkg_config.rb'
|
|
21
|
-
require 'environment_information/queries/simple_version.rb'
|
|
22
|
-
require 'environment_information/queries/complex_version.rb'
|
|
23
|
-
|
|
24
|
-
begin
|
|
25
|
-
require 'rbt/utility_scripts/report_mate_desktop_version.rb'
|
|
26
|
-
rescue LoadError; end
|
|
27
|
-
|
|
28
|
-
# ========================================================================= #
|
|
29
|
-
# === @debug
|
|
30
|
-
#
|
|
31
|
-
# This variable can be used to control whether we debug the project
|
|
32
|
-
# or not. It should be false by default (and upon re-destribution of
|
|
33
|
-
# the project to other users).
|
|
34
|
-
# ========================================================================= #
|
|
35
|
-
@debug = false
|
|
36
|
-
|
|
37
|
-
# ========================================================================= #
|
|
38
|
-
# === @query_to_use_for_the_individual_components
|
|
39
|
-
#
|
|
40
|
-
# Initialize our dataset here.
|
|
41
|
-
# ========================================================================= #
|
|
42
|
-
@query_to_use_for_the_individual_components = YAML.load_file(
|
|
43
|
-
FILE_QUERY_TO_USE_FOR_THE_INDIVIDUAL_COMPONENTS
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
# ========================================================================= #
|
|
47
|
-
# === EnvironmentInformation.return_version_of_this_program
|
|
48
|
-
#
|
|
49
|
-
# This is the general method that will return the version of a particular
|
|
50
|
-
# program at hand.
|
|
51
|
-
#
|
|
52
|
-
# The method must be able to deal with using pkg-config, but also
|
|
53
|
-
# querying some program's version via --version, via the commandline,
|
|
54
|
-
# Furthermore, some programs may require an ad-hoc fix.
|
|
55
|
-
# ========================================================================= #
|
|
56
|
-
def self.return_version_of_this_program(
|
|
57
|
-
this_program,
|
|
58
|
-
prefix_to_use = @prefix_to_use
|
|
59
|
-
)
|
|
60
|
-
prefix_to_use = prefix_to_use.dup if prefix_to_use
|
|
61
|
-
version = nil # ← This is the default.
|
|
62
|
-
if this_program.is_a? Array
|
|
63
|
-
this_program = this_program.flatten.first
|
|
64
|
-
end
|
|
65
|
-
# ======================================================================= #
|
|
66
|
-
# Next define a few aliases.
|
|
67
|
-
# ======================================================================= #
|
|
68
|
-
this_program = ::EnvironmentInformation.return_alias_to(this_program)
|
|
69
|
-
if ARRAY_TRACKED_NON_PROGRAMS.include? this_program
|
|
70
|
-
return ::EnvironmentInformation.send(this_program)
|
|
71
|
-
elsif @query_to_use_for_the_individual_components.has_key? this_program.to_sym
|
|
72
|
-
use_this_command = @query_to_use_for_the_individual_components[this_program.to_sym]
|
|
73
|
-
case use_this_command
|
|
74
|
-
# ===================================================================== #
|
|
75
|
-
# === :mate_desktop
|
|
76
|
-
#
|
|
77
|
-
# This entry is special.
|
|
78
|
-
# ===================================================================== #
|
|
79
|
-
when :mate_desktop
|
|
80
|
-
return RBT.return_mate_desktop_version_array
|
|
81
|
-
# ===================================================================== #
|
|
82
|
-
# === :pkgconfig
|
|
83
|
-
#
|
|
84
|
-
# An invocation example for this would be:
|
|
85
|
-
#
|
|
86
|
-
# x = EnvironmentInformation.return_version_of_this_program(:check) # => "0.15.2"
|
|
87
|
-
#
|
|
88
|
-
# ===================================================================== #
|
|
89
|
-
when :pkgconfig
|
|
90
|
-
version = ::EnvironmentInformation::Queries::PkgConfig.new(this_program).version?
|
|
91
|
-
# ===================================================================== #
|
|
92
|
-
# === :custom_gtk2
|
|
93
|
-
# ===================================================================== #
|
|
94
|
-
when :custom_gtk2
|
|
95
|
-
version = ::EnvironmentInformation::Queries::PkgConfig.new('gtk+-2.0').version?
|
|
96
|
-
# ===================================================================== #
|
|
97
|
-
# === :custom_mpc
|
|
98
|
-
#
|
|
99
|
-
# We rely on the header called mpc.h.
|
|
100
|
-
# ===================================================================== #
|
|
101
|
-
when :custom_mpc
|
|
102
|
-
version = ::EnvironmentInformation.return_version_of_mpc
|
|
103
|
-
# ===================================================================== #
|
|
104
|
-
# === :custom_boost
|
|
105
|
-
# ===================================================================== #
|
|
106
|
-
when :custom_boost
|
|
107
|
-
version = ::EnvironmentInformation.return_version_of_boost
|
|
108
|
-
if version.nil?
|
|
109
|
-
register_this_component_is_missing(:boost)
|
|
110
|
-
end
|
|
111
|
-
# ===================================================================== #
|
|
112
|
-
# === :version (version tag)
|
|
113
|
-
#
|
|
114
|
-
# This entry point is typically for "program_name --version"
|
|
115
|
-
# entries. Some of them require custom modifications.
|
|
116
|
-
# ===================================================================== #
|
|
117
|
-
when :version
|
|
118
|
-
# =================================================================== #
|
|
119
|
-
# Next enable support for AppDir layout, where programs will
|
|
120
|
-
# ultimately reside in the same directory.
|
|
121
|
-
# =================================================================== #
|
|
122
|
-
unless prefix_to_use.empty?
|
|
123
|
-
prefix_to_use << "#{this_program.to_s.capitalize}/Current/bin/"
|
|
124
|
-
end
|
|
125
|
-
cmd = "#{prefix_to_use}#{this_program} --version #{ERROR_LINE}"
|
|
126
|
-
if @debug
|
|
127
|
-
e Colours.crimson('DEBUG for the prefix-value in use: ')+
|
|
128
|
-
Colours.steelblue(cmd)
|
|
129
|
-
end
|
|
130
|
-
version = ::EnvironmentInformation::Queries::SimpleVersion.new(this_program) {{
|
|
131
|
-
prefix_to_use: prefix_to_use
|
|
132
|
-
}}.version?
|
|
133
|
-
# ===================================================================== #
|
|
134
|
-
# Next we will handle special programs, such as "swig -v" and similar.
|
|
135
|
-
# This is done by class ComplexVersion since as of 29.08.2020.
|
|
136
|
-
# ===================================================================== #
|
|
137
|
-
else # else tag
|
|
138
|
-
if use_this_command.start_with?('pkg-config')
|
|
139
|
-
version = ::EnvironmentInformation::Queries::PkgConfig.new(this_program).version?
|
|
140
|
-
else
|
|
141
|
-
cmd = "#{@prefix_to_use}#{use_this_command} #{ERROR_LINE}"
|
|
142
|
-
version = ::EnvironmentInformation::Queries::ComplexVersion.new(this_program) {{
|
|
143
|
-
prefix_to_use: prefix_to_use
|
|
144
|
-
}}.version?
|
|
145
|
-
end
|
|
146
|
-
end
|
|
147
|
-
else
|
|
148
|
-
e 'Not registered any key for the program: '+this_program.to_s
|
|
149
|
-
e 'This is currently not allowed - please add this missing information.'
|
|
150
|
-
exit
|
|
151
|
-
end
|
|
152
|
-
result = version
|
|
153
|
-
if result
|
|
154
|
-
unless result.include? COMMAND_NOT_FOUND
|
|
155
|
-
result = result.dup if result.frozen?
|
|
156
|
-
result.strip!
|
|
157
|
-
end
|
|
158
|
-
end
|
|
159
|
-
if result and (result == 'found' or result == 'foud')
|
|
160
|
-
register_this_component_is_missing(this_program)
|
|
161
|
-
elsif result and result.include?(COMMAND_NOT_FOUND)
|
|
162
|
-
register_this_component_is_missing(this_program)
|
|
163
|
-
# ======================================================================= #
|
|
164
|
-
# Check whether pkg-config is available or not.
|
|
165
|
-
# ======================================================================= #
|
|
166
|
-
elsif result and (
|
|
167
|
-
result.include?(PKGCONFIG_COMMAND_NOT_FOUND) or
|
|
168
|
-
result.include?(NO_SUCH_FILE_OR_DIRECTORY)
|
|
169
|
-
)
|
|
170
|
-
register_this_component_is_missing(this_program)
|
|
171
|
-
elsif result.nil?
|
|
172
|
-
register_this_component_is_missing(this_program)
|
|
173
|
-
end
|
|
174
|
-
return result
|
|
175
|
-
end; self.instance_eval { alias version_for? return_version_of_this_program } # === EnvironmentInformation,version_for?
|
|
176
|
-
|
|
177
|
-
end
|
|
178
|
-
|
|
179
|
-
if __FILE__ == $PROGRAM_NAME
|
|
180
|
-
puts EnvironmentInformation.return_version_of_this_program(ARGV)
|
|
181
|
-
end # envireturnversionofthisprogram ruby
|
|
182
|
-
# envireturnversionofthisprogram ethtools
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/ruby -w
|
|
2
|
-
# Encoding: UTF-8
|
|
3
|
-
# frozen_string_literal: true
|
|
4
|
-
# =========================================================================== #
|
|
5
|
-
# require 'environment_information/toplevel_methods/show_all_available_components.rb'
|
|
6
|
-
# EnvironmentInformation.show_all_available_components
|
|
7
|
-
# =========================================================================== #
|
|
8
|
-
module EnvironmentInformation
|
|
9
|
-
|
|
10
|
-
# ========================================================================= #
|
|
11
|
-
# The next require also pulls in the misc/ components.
|
|
12
|
-
# ========================================================================= #
|
|
13
|
-
require 'environment_information/toplevel_methods/return_version_of_this_program.rb'
|
|
14
|
-
require 'environment_information/constants/array_tracked_components.rb'
|
|
15
|
-
require 'environment_information/constants/regex.rb'
|
|
16
|
-
require 'environment_information/toplevel_methods/hash.rb'
|
|
17
|
-
require 'environment_information/toplevel_methods/autogenerate_all_relevant_methods.rb'
|
|
18
|
-
require 'environment_information/toplevel_methods/misc.rb'
|
|
19
|
-
require 'environment_information/toplevel_methods/replay_from_the_stored_file.rb'
|
|
20
|
-
|
|
21
|
-
begin
|
|
22
|
-
require 'rbt/requires/swift_version.rb'
|
|
23
|
-
rescue LoadError; end
|
|
24
|
-
|
|
25
|
-
# ========================================================================= #
|
|
26
|
-
# Add colours-support next:
|
|
27
|
-
# ========================================================================= #
|
|
28
|
-
require 'environment_information/colours/colours.rb'
|
|
29
|
-
require 'environment_information/queries/pkg_config.rb'
|
|
30
|
-
require 'environment_information/toplevel_methods/e.rb'
|
|
31
|
-
require 'environment_information/toplevel_methods/is_on_roebe.rb'
|
|
32
|
-
require 'environment_information/toplevel_methods/register_this_component_is_missing.rb'
|
|
33
|
-
|
|
34
|
-
# ========================================================================= #
|
|
35
|
-
# === EnvironmentInformation.show_all_available_components
|
|
36
|
-
#
|
|
37
|
-
# This method will quickly and easily show all available (registered)
|
|
38
|
-
# components. If you need more fine-tuning when you wish to display
|
|
39
|
-
# the main dataset at hand, then you should use other methods that
|
|
40
|
-
# are also a bit more complex. This method here is really just a
|
|
41
|
-
# fast version-display overview.
|
|
42
|
-
#
|
|
43
|
-
# The second argument to this method contains the programs that we
|
|
44
|
-
# wish to display through this method.
|
|
45
|
-
# ========================================================================= #
|
|
46
|
-
def self.show_all_available_components(
|
|
47
|
-
n_ljust = 18,
|
|
48
|
-
show_these_components = ARRAY_DEFAULT_PROGRAMS_ON_LINUX+
|
|
49
|
-
ARRAY_TRACKED_PROGRAMS,
|
|
50
|
-
use_colours = use_colours?
|
|
51
|
-
)
|
|
52
|
-
clear_main_hash
|
|
53
|
-
if show_these_components.is_a? Array
|
|
54
|
-
show_these_components.flatten!
|
|
55
|
-
end
|
|
56
|
-
# ======================================================================= #
|
|
57
|
-
# The next variable determines whether we will also compare the
|
|
58
|
-
# program versions.
|
|
59
|
-
# ======================================================================= #
|
|
60
|
-
compare_program_versions = false
|
|
61
|
-
default_nljust_value = 30 # ← Detemine default padding.
|
|
62
|
-
if n_ljust.is_a?(Array) and n_ljust.empty?
|
|
63
|
-
n_ljust = default_nljust_value # Use the default value in this case.
|
|
64
|
-
end
|
|
65
|
-
# ======================================================================= #
|
|
66
|
-
# First we will treat n_ljust as a commandline-flag if it is a String
|
|
67
|
-
# and additionally begins with "--".
|
|
68
|
-
# ======================================================================= #
|
|
69
|
-
if n_ljust.is_a?(Array) and n_ljust.first.start_with?('--')
|
|
70
|
-
_ = n_ljust.first
|
|
71
|
-
case _
|
|
72
|
-
# ===================================================================== #
|
|
73
|
-
# === --help
|
|
74
|
-
#
|
|
75
|
-
# Invocation example:
|
|
76
|
-
#
|
|
77
|
-
# showcomponents --help
|
|
78
|
-
#
|
|
79
|
-
# ===================================================================== #
|
|
80
|
-
when /^-?-?help$/i
|
|
81
|
-
e 'The following options are available for bin/fast_envi (fenvi):'
|
|
82
|
-
e
|
|
83
|
-
e ' --xorg # show only the xorg-components'
|
|
84
|
-
e ' --compare-to-program-versions # also compare the program versions'
|
|
85
|
-
e
|
|
86
|
-
exit
|
|
87
|
-
# ===================================================================== #
|
|
88
|
-
# === --compare-to-program-versions
|
|
89
|
-
#
|
|
90
|
-
# To invoke this, try:
|
|
91
|
-
#
|
|
92
|
-
# show_components --compare
|
|
93
|
-
# envi --compare-version
|
|
94
|
-
#
|
|
95
|
-
# ===================================================================== #
|
|
96
|
-
when *ARRAY_COMPARE_PROGRAM_VERSIONS
|
|
97
|
-
compare_program_versions = true
|
|
98
|
-
n_ljust = default_nljust_value
|
|
99
|
-
# ===================================================================== #
|
|
100
|
-
# === --xorg
|
|
101
|
-
# ===================================================================== #
|
|
102
|
-
when /^-?-?xorg$/i
|
|
103
|
-
show_these_components = ::EnvironmentInformation.xorg_components?
|
|
104
|
-
n_ljust = default_nljust_value
|
|
105
|
-
end
|
|
106
|
-
end
|
|
107
|
-
e
|
|
108
|
-
uniq = show_these_components.uniq
|
|
109
|
-
uniq.sort.each {|this_program|
|
|
110
|
-
use_this_name_for_send = "return_version_of_#{this_program}"
|
|
111
|
-
# ===================================================================== #
|
|
112
|
-
# Next, add the name of the program at hand, onto the left hand side:
|
|
113
|
-
# ===================================================================== #
|
|
114
|
-
result = this_program.to_s.ljust(n_ljust)
|
|
115
|
-
if use_colours
|
|
116
|
-
result = ::EnvironmentInformation.colourize_and_pad_the_left_side(result)
|
|
117
|
-
end
|
|
118
|
-
# ===================================================================== #
|
|
119
|
-
# Some components may not be installed on the user's computer system,
|
|
120
|
-
# which we have to keep in mind in the following code. This is
|
|
121
|
-
# why we will first apply the .send(), before checking whether
|
|
122
|
-
# the program at hand is actually missing or not.
|
|
123
|
-
# ===================================================================== #
|
|
124
|
-
result_of_send = send(use_this_name_for_send)
|
|
125
|
-
if result_of_send
|
|
126
|
-
result_of_send = result_of_send.dup if result_of_send.frozen?
|
|
127
|
-
result_of_send.strip!
|
|
128
|
-
end
|
|
129
|
-
@hash_available_programs[this_program.to_sym] = result_of_send.to_s
|
|
130
|
-
right_component = ''.dup
|
|
131
|
-
if @array_this_component_is_missing.include?(this_program.to_sym)
|
|
132
|
-
right_component << "not installed (or otherwise not found)".ljust(12)
|
|
133
|
-
else
|
|
134
|
-
right_component << result_of_send.ljust(12) if result_of_send
|
|
135
|
-
end
|
|
136
|
-
if use_colours
|
|
137
|
-
# =================================================================== #
|
|
138
|
-
# We will distinguish between components that have been found and
|
|
139
|
-
# components that have not been found.
|
|
140
|
-
# =================================================================== #
|
|
141
|
-
if right_component.include?('not installed')
|
|
142
|
-
right_component = ::Colours.send(:mediumslateblue, right_component)
|
|
143
|
-
else
|
|
144
|
-
right_component = ::Colours.send(colour_for_the_right_side, right_component)
|
|
145
|
-
end
|
|
146
|
-
end
|
|
147
|
-
result = result.dup if result.frozen?
|
|
148
|
-
result << right_component
|
|
149
|
-
if compare_program_versions
|
|
150
|
-
if is_this_program_included?(this_program)
|
|
151
|
-
registered_local_version = RBT.swift_return_version_of_this_program(this_program.to_sym).to_s.dup
|
|
152
|
-
if registered_local_version.include? 'v'
|
|
153
|
-
# =============================================================== #
|
|
154
|
-
# Modify entries such as 'v12.15.0' into '12.15.0'.
|
|
155
|
-
# =============================================================== #
|
|
156
|
-
registered_local_version.delete!('v')
|
|
157
|
-
end
|
|
158
|
-
case this_program.to_s
|
|
159
|
-
when 'gtk2'
|
|
160
|
-
registered_local_version = query_pkgconfig_version_for(:gtk2)
|
|
161
|
-
else
|
|
162
|
-
if result_of_send.nil?
|
|
163
|
-
# ^^^ This is missing, then, so it will be ignored.
|
|
164
|
-
elsif registered_local_version <= result_of_send
|
|
165
|
-
# This is ok.
|
|
166
|
-
else
|
|
167
|
-
result <<
|
|
168
|
-
royalblue(
|
|
169
|
-
"\n "\
|
|
170
|
-
"^^^ This could be updated; the version in "\
|
|
171
|
-
"RBT is: #{mediumpurple(registered_local_version)}"
|
|
172
|
-
)
|
|
173
|
-
end
|
|
174
|
-
end
|
|
175
|
-
end
|
|
176
|
-
end
|
|
177
|
-
# ===================================================================== #
|
|
178
|
-
# Finally display our findings to the end user.
|
|
179
|
-
# ===================================================================== #
|
|
180
|
-
e result
|
|
181
|
-
}
|
|
182
|
-
e
|
|
183
|
-
if is_on_roebe? # And store it on my home system too.
|
|
184
|
-
::EnvironmentInformation.store_relevant_files
|
|
185
|
-
end
|
|
186
|
-
end
|
|
187
|
-
|
|
188
|
-
end
|
|
189
|
-
|
|
190
|
-
if __FILE__ == $PROGRAM_NAME
|
|
191
|
-
EnvironmentInformation.show_all_available_components(ARGV)
|
|
192
|
-
end # showcomponents --compare
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/ruby -w
|
|
2
|
-
# Encoding: UTF-8
|
|
3
|
-
# frozen_string_literal: true
|
|
4
|
-
# =========================================================================== #
|
|
5
|
-
# require 'environment_information/toplevel_methods/write_what_into.rb'
|
|
6
|
-
# EnvironmentInformation.write_what_into
|
|
7
|
-
# =========================================================================== #
|
|
8
|
-
module EnvironmentInformation
|
|
9
|
-
|
|
10
|
-
require 'environment_information/toplevel_methods/e.rb'
|
|
11
|
-
|
|
12
|
-
# ========================================================================= #
|
|
13
|
-
# === EnvironmentInformation.write_what_into
|
|
14
|
-
# ========================================================================= #
|
|
15
|
-
def self.write_what_into(what, into)
|
|
16
|
-
what = what.join("\n") if what.is_a? Array
|
|
17
|
-
File.open(into, 'w+') {|entry| entry.write(what) }
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
end
|
|
21
|
-
|
|
22
|
-
if __FILE__ == $PROGRAM_NAME
|
|
23
|
-
EnvironmentInformation.write_what_into(ARGV, 'test_this.md')
|
|
24
|
-
end
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# =========================================================================== #
|
|
2
|
-
# x = YAML.load_file('array_default_programs_on_linux.yml')
|
|
3
|
-
# =========================================================================== #
|
|
4
|
-
|
|
5
|
-
- !ruby/symbol operating_system
|
|
6
|
-
- !ruby/symbol operating_system_bit_type
|
|
7
|
-
- !ruby/symbol cpuinfo
|
|
8
|
-
- !ruby/symbol ram
|
|
9
|
-
- !ruby/symbol screen_resolution
|
|
10
|
-
- !ruby/symbol cflags
|
|
11
|
-
- !ruby/symbol gcc
|
|
12
|
-
- !ruby/symbol glibc
|
|
13
|
-
- !ruby/symbol linux
|
|
14
|
-
- !ruby/symbol binutils
|
|
15
|
-
- !ruby/symbol cmake
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# =========================================================================== #
|
|
2
|
-
# === array_lfs_core_programs.yml
|
|
3
|
-
#
|
|
4
|
-
# This .yml file will contain an Array of Symbols denoting which programs
|
|
5
|
-
# are tracked by the LFS project.
|
|
6
|
-
#
|
|
7
|
-
# If you wish to add new entries to this yaml file then please keep them
|
|
8
|
-
# sorted alphabetically - this makes things a bit easier in the long run.
|
|
9
|
-
# =========================================================================== #
|
|
10
|
-
# x = YAML.load_file(FILE_ARRAY_LFS_CORE_PROGRAMS)
|
|
11
|
-
# =========================================================================== #
|
|
12
|
-
|
|
13
|
-
- !ruby/symbol bash
|
|
14
|
-
- !ruby/symbol binutils
|
|
15
|
-
- !ruby/symbol bison
|
|
16
|
-
- !ruby/symbol busybox
|
|
17
|
-
- !ruby/symbol bzip2
|
|
18
|
-
- !ruby/symbol coreutils
|
|
19
|
-
- !ruby/symbol diffutils
|
|
20
|
-
- !ruby/symbol findutils
|
|
21
|
-
- !ruby/symbol flex
|
|
22
|
-
- !ruby/symbol gawk
|
|
23
|
-
- !ruby/symbol gcc
|
|
24
|
-
- !ruby/symbol grep
|
|
25
|
-
- !ruby/symbol gzip
|
|
26
|
-
- !ruby/symbol libuv
|
|
27
|
-
- !ruby/symbol linux
|
|
28
|
-
- !ruby/symbol m4
|
|
29
|
-
- !ruby/symbol make
|
|
30
|
-
- !ruby/symbol patch
|
|
31
|
-
- !ruby/symbol perl
|
|
32
|
-
- !ruby/symbol python
|
|
33
|
-
- !ruby/symbol sed
|
|
34
|
-
- !ruby/symbol tar
|
|
35
|
-
- !ruby/symbol texinfo
|
|
36
|
-
- !ruby/symbol xz
|
|
37
|
-
- !ruby/symbol zlib
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
# =========================================================================== #
|
|
2
|
-
# Applications that have to do with science may be stored in this yaml
|
|
3
|
-
# file here.
|
|
4
|
-
# =========================================================================== #
|
|
5
|
-
# x = YAML.load_file(FILE_ARRAY_SCIENCE_CLUSTER)
|
|
6
|
-
# =========================================================================== #
|
|
7
|
-
|
|
8
|
-
- !ruby/symbol hmmer
|
|
9
|
-
- !ruby/symbol pbbam
|
|
10
|
-
- !ruby/symbol relion
|
|
11
|
-
- !ruby/symbol samtools
|
|
12
|
-
- !ruby/symbol viennarna
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# =========================================================================== #
|
|
2
|
-
# Please keep the following Array (of symbols) sorted alphabeticall.
|
|
3
|
-
# =========================================================================== #
|
|
4
|
-
# x = EnvironmentInformation.load_file_array_tracked_non_programs
|
|
5
|
-
# =========================================================================== #
|
|
6
|
-
|
|
7
|
-
- !ruby/symbol cflags
|
|
8
|
-
- !ruby/symbol cpuinfo
|
|
9
|
-
- !ruby/symbol operating_system
|
|
10
|
-
- !ruby/symbol operating_system_bit_type
|
|
11
|
-
- !ruby/symbol ram
|
|
12
|
-
- !ruby/symbol rubygems_installation_directory
|
|
13
|
-
- !ruby/symbol screen_resolution
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# =========================================================================== #
|
|
2
|
-
# === array_tracked_xorg_components.yml
|
|
3
|
-
#
|
|
4
|
-
# This .yml file will contain an Array of Symbols denoting which
|
|
5
|
-
# programs belong to the xorg-stack.
|
|
6
|
-
# =========================================================================== #
|
|
7
|
-
# x = YAML.load_file(FILE_ARRAY_TRACKED_XORG_COMPONENTS)
|
|
8
|
-
# =========================================================================== #
|
|
9
|
-
|
|
10
|
-
- !ruby/symbol libevdev
|
|
11
|
-
- !ruby/symbol libinput
|
|
12
|
-
- !ruby/symbol libx11
|
|
13
|
-
- !ruby/symbol libxaw3d
|
|
14
|
-
- !ruby/symbol libxau
|
|
15
|
-
- !ruby/symbol libxcb
|
|
16
|
-
- !ruby/symbol libxcm
|
|
17
|
-
- !ruby/symbol libxcursor
|
|
18
|
-
- !ruby/symbol libxdamage
|
|
19
|
-
- !ruby/symbol libxi
|
|
20
|
-
- !ruby/symbol libxkbfile
|
|
21
|
-
- !ruby/symbol libxmu
|
|
22
|
-
- !ruby/symbol libxpm
|
|
23
|
-
# - !ruby/symbol libxp # This one no longer appears to work as of 2023.
|
|
24
|
-
- !ruby/symbol libxpresent
|
|
25
|
-
# - !ruby/symbol libxtrap # This has been deprecated many years ago already.
|
|
26
|
-
- !ruby/symbol libxtst
|
|
27
|
-
- !ruby/symbol libxt
|
|
28
|
-
- !ruby/symbol libxv
|
|
29
|
-
- !ruby/symbol libxvmc
|
|
30
|
-
- !ruby/symbol randrproto
|
|
31
|
-
- !ruby/symbol xextproto
|
|
32
|
-
- !ruby/symbol xkbcomp
|
|
33
|
-
- !ruby/symbol xrandr
|
|
34
|
-
- !ruby/symbol xstdcmap
|
|
35
|
-
- !ruby/symbol xf86bigfontproto
|
|
36
|
-
- !ruby/symbol xf86dgaproto
|
|
37
|
-
- !ruby/symbol xf86driproto
|