1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
|
--- bin/vmware-uninstall-vSphere-CLI.pl 2019-07-21 20:08:05.802708197 -0700
+++ bin/vmware-uninstall-vSphere-CLI.pl.patched 2019-07-21 21:06:46.775372374 -0700
@@ -766,7 +766,7 @@
# Constants
my $cInstallerFileName = 'vmware-install.pl';
my $cModuleUpdaterFileName = 'install.pl';
-my $cRegistryDir = '/etc/vmware';
+my $cRegistryDir = '../../pkg/vmware-vcli/etc/vmware';
my $cInstallerMainDB = $cRegistryDir . '/locations';
my $cInstallerObject = $cRegistryDir . '/installer.sh';
my $cConfFlag = $cRegistryDir . '/not_configured';
@@ -1662,7 +1662,7 @@
sub initialize_globals {
my $dirname = shift;
- $gRegistryDir = '/etc/vmware-vcli';
+ $gRegistryDir = '../../pkg/vmware-vcli/etc/vmware-vcli';
@gOldUninstallers = qw( /etc/vmware-vicli/installer.sh /etc/vmware-rcli/installer.sh);
$gUninstallerFileName = 'vmware-uninstall-vSphere-CLI.pl';
@@ -1865,7 +1865,7 @@
foreach $file (internal_ls($src_dir)) {
my $src = $src_dir . '/' . $file;
- my $src_loc = '/usr/bin/' . $file;
+ my $src_loc = '../../pkg/vmware-vcli/usr/bin/' . $file;
my $dst_loc = $dst_dir . '/' . $file;
if (-l $dst_loc) {
install_symlink(readlink($dst_loc), $src_loc);
@@ -2047,9 +2047,9 @@
print wrap('The installation of ' . vmware_longname()
. ' completed successfully. '
- . 'You can decide to remove this software from your system at any '
- . 'time by invoking the following command: "'
- . db_get_answer('BINDIR') . '/' . $gUninstallerFileName . '".'
+ # . 'You can decide to remove this software from your system at any '
+ # . 'time by invoking the following command: "'
+ # . db_get_answer('BINDIR') . '/' . $gUninstallerFileName . '".'
. "\n\n", 0);
if (vmware_product() eq 'vicli') {
@@ -2199,32 +2199,30 @@
my $shipped_ssl_version = '0.9.8';
my $installed_ssl_version = '0';
my $minimum_ssl_version = '0.9.7';
- my $ssleay_installed = 0;
+ my $ssleay_installed = 1;
my $link_ssleay = 0;
my $linker_installed = `which ld`;
my $minimum_libxml_version = '2.6.26';
my $installed_libxml_version = '0';
- my $OpenSSL_installed = 0;
my $LibXML2_installed = 0;
- my $OpenSSL_dev_installed = 0;
my $libxml_perl_installed = 1;
- my $e2fsprogs_installed = 0;
+ my $e2fsprogs_installed = 1;
my $e2fsprogs_version = '0';
my $minimum_e2fsprogs_version = '1.38';
- my $e2fsprogs_devel_installed = 0;
+ my $e2fsprogs_devel_installed = 1;
my $internet_available = 0;
- my $install_rhel55_local = 0;
+ my $install_rhel55_local = 1;
my $vicliName = vmware_product_name();
if ($] < 5.008) {
error($vicliName . " requires Perl version 5.8 or later.\n\n");
}
- unless(direct_command("perldoc -V 2> /dev/null")) {
- print wrap("warning: " . $vicliName . " requires Perldoc.\n Please install perldoc.\n\n");
- }
+ #unless(direct_command("perldoc -V 2> /dev/null")) {
+ # print wrap("warning: " . $vicliName . " requires Perldoc.\n Please install perldoc.\n\n");
+ #}
# Determine version of libxml2 that's installed.
@@ -2268,11 +2266,11 @@
}
}
- if ( $installed_ssl_version eq '0' ) {
- print wrap(" OpenSSL is not installed on the system \n");
- } else {
- $OpenSSL_installed = 1;
- }
+ #if ( $installed_ssl_version eq '0' ) {
+ # print wrap(" OpenSSL is not installed on the system \n");
+ #} else {
+ # $OpenSSL_installed = 1;
+ #}
if (compare_dot_version_strings($installed_ssl_version, $minimum_ssl_version) < 0) {
print wrap("OpenSSL $minimum_ssl_version is required for encrypted connections.\n" .
@@ -2280,63 +2278,63 @@
}
# check for e2fsprogs-devel installed
- if ( direct_command("cat /etc/*-release | grep -i ubuntu") || direct_command("cat /proc/version | grep -i ubuntu") ) {
- my $libssl_dev = direct_command("dpkg-query -W -f='\${Version}\n' '*ssl-dev*' ");
- if ( $libssl_dev ) {
- $OpenSSL_dev_installed = 1;
- } else {
- print wrap("libssl-dev $minimum_ssl_version is required for encrypted connections.\n" .
- "Please install libssl-dev version $minimum_ssl_version or greater.\n\n", 0);
- }
-
- my $e2fsprogs = direct_command("dpkg-query -W -f='\${Version}\n' e2fsprogs ");
- if ($e2fsprogs) {
- my @e2fs = split('-', $e2fsprogs);
- $e2fsprogs_version = $e2fs[0];
- $e2fsprogs_installed = 1;
- }
-
- if ( direct_command("dpkg-query -W -f'\${Status}\n' libxml-libxml-perl | grep not-installed ") ) {
- print wrap("libxml-libxml-perl package is not installed on the system. libxml-libxml-perl package must be installed for use by " . $vicliName . ":\n\n", 0);
- $libxml_perl_installed = 0;
- }
-
- } else {
- my @openssl_dev = direct_command("rpm -qa | grep 'ssl-dev'");
-
- foreach my $line (@openssl_dev) {
- chomp($line);
- if ($line =~ /[a-zA-Z]*ssl-dev[a-zA-Z]*-(\d+\.?\d*\.?\d*[a-zA-Z]*)/) {
- $OpenSSL_dev_installed = 1;
- }
- }
-
- if (! $OpenSSL_dev_installed) {
- print wrap("Openssl-devel is not installed on the system.\n" .
- "openssl-devel $minimum_ssl_version is required for encrypted connections.\n" .
- "Please install openssl-devel version $minimum_ssl_version or greater.\n\n", 0);
- }
-
- my @e2fsprogs = split('\n', direct_command("rpm -qa | grep 'e2fsprogs'"));
- foreach my $line (@e2fsprogs) {
- chomp($line);
- if ($line =~ /e2fsprogs-+([0-9\.]+)/) {
- $e2fsprogs_version = "$1";
- $e2fsprogs_installed = 1;
- }
- if ( ! $install_rhel55_local ) {
- if ( -e "/etc/SuSE-release" ) {
- if ($line =~ /e2fsprogs-devel-+([0-9\.]+)/) {
- $e2fsprogs_devel_installed = 1;
- }
- }
- }
- }
- }
-
- if (! $e2fsprogs_installed ) {
- print wrap("e2fsprogs is not installed on the system \n\n", 0);
- }
+ #if ( direct_command("cat /etc/*-release | grep -i ubuntu") || direct_command("cat /proc/version | grep -i ubuntu") ) {
+ # my $libssl_dev = direct_command("dpkg-query -W -f='\${Version}\n' '*ssl-dev*' ");
+ # if ( $libssl_dev ) {
+# $OpenSSL_dev_installed = 1;
+ # } else {
+ # print wrap("libssl-dev $minimum_ssl_version is required for encrypted connections.\n" .
+ # "Please install libssl-dev version $minimum_ssl_version or greater.\n\n", 0);
+ # }
+
+ # my $e2fsprogs = direct_command("dpkg-query -W -f='\${Version}\n' e2fsprogs ");
+ # if ($e2fsprogs) {
+ # my @e2fs = split('-', $e2fsprogs);
+ # $e2fsprogs_version = $e2fs[0];
+ # $e2fsprogs_installed = 1;
+ # }
+
+ # if ( direct_command("dpkg-query -W -f'\${Status}\n' libxml-libxml-perl | grep not-installed ") ) {
+ # print wrap("libxml-libxml-perl package is not installed on the system. libxml-libxml-perl package must be installed for use by " . $vicliName . ":\n\n", 0);
+ # $libxml_perl_installed = 0;
+ # }
+
+ #} else {
+ # my @openssl_dev = direct_command("rpm -qa | grep 'ssl-dev'");
+
+ # foreach my $line (@openssl_dev) {
+ # chomp($line);
+ # if ($line =~ /[a-zA-Z]*ssl-dev[a-zA-Z]*-(\d+\.?\d*\.?\d*[a-zA-Z]*)/) {
+ # $OpenSSL_dev_installed = 1;
+ # }
+ # }
+
+ # if (! $OpenSSL_dev_installed) {
+ # print wrap("Openssl-devel is not installed on the system.\n" .
+ # "openssl-devel $minimum_ssl_version is required for encrypted connections.\n" .
+ # "Please install openssl-devel version $minimum_ssl_version or greater.\n\n", 0);
+ # }
+
+ # my @e2fsprogs = split('\n', direct_command("rpm -qa | grep 'e2fsprogs'"));
+ # foreach my $line (@e2fsprogs) {
+ # chomp($line);
+ # if ($line =~ /e2fsprogs-+([0-9\.]+)/) {
+ # $e2fsprogs_version = "$1";
+ # $e2fsprogs_installed = 1;
+ # }
+ # if ( ! $install_rhel55_local ) {
+ # if ( -e "/etc/SuSE-release" ) {
+ # if ($line =~ /e2fsprogs-devel-+([0-9\.]+)/) {
+ # $e2fsprogs_devel_installed = 1;
+ # }
+ # }
+ # }
+ # }
+ #}
+
+ #if (! $e2fsprogs_installed ) {
+ # print wrap("e2fsprogs is not installed on the system \n\n", 0);
+ #}
if (compare_dot_version_strings($e2fsprogs_version, $minimum_e2fsprogs_version) < 0) {
print wrap("e2fsprogs $minimum_e2fsprogs_version is required for UUID.\n" .
@@ -2350,7 +2348,7 @@
}
# Exit the installation if OpenSSL or LibXML or e2fsprogs not installed on system.
- if ( ! $OpenSSL_installed || ! $LibXML2_installed || ! $e2fsprogs_installed || ! $OpenSSL_dev_installed || ! $libxml_perl_installed ) {
+ if ( ! $LibXML2_installed || ! $libxml_perl_installed ) {
uninstall_file($gInstallerMainDB);
exit 1;
}
@@ -2670,16 +2668,16 @@
undef %patch;
if ($] >= 5.010 && ( -e "./lib/5.10/$module->{'path'}/lib" ) ) {
- install_dir("./lib/5.10/$module->{'path'}/lib", "$lib_dir", \%patch, 0x1);
+ install_dir("./lib/5.10/$module->{'path'}/lib", "../../pkg/vmware-vcli$lib_dir", \%patch, 0x1);
} elsif (-e "./lib/$module->{'path'}/lib") {
- install_dir("./lib/$module->{'path'}/lib", "$lib_dir", \%patch, 0x1);
+ install_dir("./lib/$module->{'path'}/lib", "../../pkg/vmware-vcli$lib_dir", \%patch, 0x1);
}
undef %patch;
if ($] >= 5.010 && ( -e "./lib/5.10/$module->{'path'}/share" ) ) {
- install_dir("./lib/5.10/$module->{'path'}/share", "$share_dir", \%patch, 0x1);
+ install_dir("./lib/5.10/$module->{'path'}/share", "../../pkg/vmware-vcli$share_dir", \%patch, 0x1);
} elsif (-e "./lib/$module->{'path'}/share") {
- install_dir("./lib/$module->{'path'}/share", "$share_dir", \%patch, 0x1);
+ install_dir("./lib/$module->{'path'}/share", "../../pkg/vmware-vcli$share_dir", \%patch, 0x1);
}
if ($] < 5.010) {
@@ -2742,7 +2740,7 @@
my $previous = $gOption{'default'};
$gOption{'default'} = 0;
- show_EULA();
+ #show_EULA();
$gOption{'default'} = $previous;
if ((check_disk_space('.', '/usr/lib')) < 0) {
@@ -2812,29 +2810,29 @@
db_add_answer('LIBDIR', $libdir);
# Install a symlink for ESXCLI, which is in the library
- install_symlink("$libdir/bin/esxcli/esxcli", "$bindir/esxcli");
+ install_symlink("/usr/lib/vmware-vcli/bin/esxcli/esxcli", "$bindir/esxcli");
# Install a symlink for DCLI, which is in the library
- install_symlink("$libdir/bin/vmware-dcli/dcli", "$bindir/dcli");
- safe_chmod(755, "$bindir/esxcli");
- safe_chmod(755, "$bindir/dcli");
+ install_symlink("/usr/lib/vmware-vcli/bin/vmware-dcli/dcli", "$bindir/dcli");
+ #safe_chmod(755, "$bindir/esxcli");
+ #safe_chmod(755, "$bindir/dcli");
# Install a symlink for VCLI
- if ( "$rootdir/bin" ne "/usr/bin") {
- install_bin_symlink('./bin', "$rootdir/bin");
- install_symlink("$libdir/bin/esxcli/esxcli", "/usr/bin/esxcli");
- install_symlink("$libdir/bin/vmware-dcli/dcli", "/usr/bin/dcli");
+ if ( "$rootdir/bin" ne "../../pkg/vmware-vcli/usr/bin") {
+ install_bin_symlink('./bin', "/bin");
+ install_symlink("/usr/lib/vmware-vcli/bin/esxcli/esxcli", "esxcli");
+ install_symlink("/usr/lib/vmware-vcli/bin/vmware-dcli/dcli", "dcli");
# Making esxcli and dcli executable
- safe_chmod(755, "/usr/bin/esxcli");
- safe_chmod(755, "/usr/bin/dcli");
+ #safe_chmod(755, "/usr/bin/esxcli");
+ #safe_chmod(755, "/usr/bin/dcli");
}
# Install a symlink to make /lib point to the correct library
# based on the architecture of our system
if (is64BitUserLand()) {
- install_symlink("$libdir/lib64", "$libdir/lib");
+ install_symlink("/usr/lib/vmware-vcli/lib64", "$libdir/lib");
}
else {
- install_symlink("$libdir/lib32", "$libdir/lib");
+ install_symlink("/usr/lib/vmware-vcli/lib32", "$libdir/lib");
}
# Make sure that, in particular, libvmacore.so's exec text permission needs
@@ -2845,12 +2843,12 @@
}
# Install vSphere SDK for Perl content excluding "apps"
- $docdir = $rootdir . '/share/doc/vmware-vcli';
+ $docdir = $rootdir . '/usr/share/doc/vmware-vcli';
install_dir('./doc', $docdir, \%patch, 0x1);
db_add_answer('DOCDIR', $docdir);
# Install resxtop man files
- $mandir = "$rootdir/share/man/man1";
+ $mandir = "$rootdir/usr/share/man/man1";
undef %patch;
install_dir('./man', $mandir, \%patch, 0x1);
@@ -3826,9 +3824,9 @@
error($chk_msg);
}
- if (!is_root()) {
- error('Please re-run this program as the super user.' . "\n\n");
- }
+ #if (!is_root()) {
+ # error('Please re-run this program as the super user.' . "\n\n");
+ #}
# Force the path to reduce the risk of using "modified" external helpers
# If the user has a special system setup, he will will prompted for the
|