Package Details: vmware-vcli 6.7.0.8156551-2

Git Clone URL: https://aur.archlinux.org/vmware-vcli.git (read-only, click to copy)
Package Base: vmware-vcli
Description: VMware vSphere Command-Line Interface (vCLI); run commands against vSphere and ESX/ESXi
Upstream URL: https://code.vmware.com/web/tool/6.7/vsphere-cli
Licenses: custom:vmware
Submitter: ReNoM
Maintainer: None
Last Packager: None
Votes: 13
Popularity: 0.000000
First Submitted: 2013-04-17 05:24 (UTC)
Last Updated: 2019-10-22 19:44 (UTC)

Latest Comments

1 2 3 4 Next › Last »

Muddy commented on 2023-04-05 12:46 (UTC)

mcardillo55 where did you get the original fix_version_cmp.patch to patch as it does not exist when I extracted the tarball to patch?

mcardillo55 commented on 2023-02-19 00:56 (UTC)

I was running into issues with the script checking the libxml2 version.

I'm pretty sure the function to compare version strings is incorrect. I think VMware's intent was to have the version string comparison take into account alpha characters as well, but it doesn't work correctly, and none of the dependencies currently have alpha characters in their version strings on Arch right now.

Anyway, I replaced it with a function that utilizes the perl builtin 'version' package and it's working for me now. Here's a patch:

From 5496d1480c77f32eb9247d7181e544cfe38caaef Mon Sep 17 00:00:00 2001
From: Michael Cardillo <mcardillo55@gmail.com>
Date: Sat, 18 Feb 2023 16:38:07 -0800
Subject: [PATCH] Switch to using perl version package, since VMWare script
 works incorrectly

---
 PKGBUILD              |  6 ++--
 fix_version_cmp.patch | 68 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 72 insertions(+), 2 deletions(-)
 create mode 100644 fix_version_cmp.patch

diff --git a/PKGBUILD b/PKGBUILD
index 77367a4..600e726 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -17,10 +17,10 @@ depends=(e2fsprogs openssl libxml2 perl kmod krb5
   perl-lwp-protocol-https perl-class-methodmaker perl-net-ssleay
   perl-text-template perl-uuid)
 install=$pkgname.install
-source=(for-arch.patch)
+source=(for-arch.patch fix_version_cmp.patch)
 source_i686=(local://VMware-vSphere-CLI-$_pkgver.i386.tar.gz)
 source_x86_64=(local://VMware-vSphere-CLI-$_pkgver.x86_64.tar.gz)
-md5sums=('645541c36349779a7f580e4a5b8453d3')
+md5sums=('645541c36349779a7f580e4a5b8453d3' 'bdb05f731df56294e1f7f6e281bc5393')
 md5sums_i686=('97df2464063c23bd87c5a8ed7e4871ef')
 md5sums_x86_64=('b38f05c522547c7377326e915597bdf7')
 options=(!strip docs libtool staticlibs emptydirs !zipman !purge !debug)
@@ -33,6 +33,8 @@ build() {
   patch -Np0 < ../for-arch.patch
   sed -i "s/my \$e2fsprogs_version = '0'/my \$e2fsprogs_version = '$(tune2fs 2>/dev/null | awk 'FNR == 1 {print $2}')'/" bin/vmware-uninstall-vSphere-CLI.pl

+  patch -Np0 < ../fix_version_cmp.patch
+
   chmod -w bin/vmware-uninstall-vSphere-CLI.pl
 }

diff --git a/fix_version_cmp.patch b/fix_version_cmp.patch
new file mode 100644
index 0000000..c24d66f
--- /dev/null
+++ b/fix_version_cmp.patch
@@ -0,0 +1,68 @@
+--- bin/vmware-uninstall-vSphere-CLI.pl    2023-02-18 16:24:16.885774631 -0800
++++ bin/vmware-uninstall-vSphere-CLI.pl.patched    2023-02-18 16:24:38.976431007 -0800
+@@ -6,6 +6,7 @@
+ # Tar package manager for VMware
+ 
+ use strict;
++use version;
+ 
+ # Use Config module to update VMware host-wide configuration file
+ # BEGINNING_OF_CONFIG_DOT_PM
+@@ -2148,49 +2149,19 @@
+   uninstall_prefix('');
+ }
+ 
+-#
+-# Given two strings where the format is a tuple of things separated by a '.'
+-# if more than one, i.e. X.Y, A.B.C, Z, determine which of the strings is
+-# of higher value representing a more recent version of a lib, say.
+-# This works 0.0.0b style lettered version strings.
+-#
+ # Result:
+-# If the Base String is greater than the New string, return 1.
+-# If the two are equal, return 0
++# If the Base String is greater than or equal to the New string, return 1.
+ # If the Base String is less than the New string, return -1.
+ sub compare_dot_version_strings {
+    my ($base, $new) = @_;
+-   my @base_digits = split(/\./, $base);
+-   my @new_digits = split(/\./, $new);
+-
+-   my $i = 0;
+-
+-   # Use the smaller limit value so we dont go outside the bounds of the array.
+-   my $limit = $#base_digits > $#new_digits ? $#new_digits : $#base_digits;
++   my $base_digits = split(/\./, $base);
++   my $new_digits = split(/\./, $new);
+ 
+-   while (($i < $limit) && ($base_digits[$i] eq $new_digits[$i])) {
+-      $i++;
+-   }
+-
+-   my $result;
+-   if (($i == $limit) && ($base_digits[$i] eq $new_digits[$i])) {
+-      if ($#base_digits == $#new_digits) {
+-         $result = 0;
+-      } elsif ($#base_digits < $#new_digits) {
+-         # if the new_digits string is longer, then it is greater.
+-         $result = -1;
+-      } else {
+-         # Else the base_digits is longer, and thus is greater
+-         $result = 1;
+-      }
+-   } else {
+-      if ($base_digits[$i] gt $new_digits[$i]) {
+-         $result = 1;
+-      } else {
+-         $result = -1;
+-      }
+-   }
+-   return $result;
++  if ( version->parse($base_digits) >= version->parse($new_digits) ) {
++   return 1;
++  } else {
++   return -1;
++  }
+ }
+ 
+ 

kronarq commented on 2019-10-18 20:50 (UTC)

Like @Witko I needed perl-uuid and perl-text-template in order to be able to run even vmware-cmd --help

<deleted-account> commented on 2019-08-05 20:30 (UTC)

@Witko, I've been able to build and install the package, and run esxcli without those packages installed. Exactly what command are you trying to run that requires those? Sounds like they may need to be listed as optional dependencies.

Witko commented on 2019-07-30 08:35 (UTC)

Thanks for the package. Just installed it. To run it it requires 2 more dependencies: perl-uuid, perl-text-template. Maybe these could be added to PKGBUILD. Thanks!

schaap137 commented on 2019-06-07 18:37 (UTC)

It seems an even newer Perl has arrived in testing (5.30), I had to use a patch again:

--- PKGBUILD.orig       2019-06-07 19:40:28.977442795 +0200
+++ PKGBUILD    2019-06-07 20:29:25.775162552 +0200
@@ -31,14 +31,14 @@
   cd "vmware-vsphere-cli-distrib"

   mkdir -p "$pkgdir"/usr/bin
-  mkdir -p "$pkgdir"/usr/lib/perl5/5.26/core_perl
+  mkdir -p "$pkgdir"/usr/lib/perl5/5.30/core_perl

   ./vmware-install.pl --prefix="$pkgdir"

-  rm "$pkgdir"/usr/lib/perl5/5.26/core_perl/Data/Dumper.pm
-  rm "$pkgdir"/usr/lib/perl5/5.26/core_perl/auto/Data/Dumper/Dumper.so
-  rm -rf "$pkgdir"/usr/lib/perl5/5.26/core_perl/MIME/
-  rm -rf "$pkgdir"/usr/lib/perl5/5.26/core_perl/auto/MIME/
+  rm "$pkgdir"/usr/lib/perl5/5.30/core_perl/Data/Dumper.pm
+  rm "$pkgdir"/usr/lib/perl5/5.30/core_perl/auto/Data/Dumper/Dumper.so
+  rm -rf "$pkgdir"/usr/lib/perl5/5.30/core_perl/MIME/
+  rm -rf "$pkgdir"/usr/lib/perl5/5.30/core_perl/auto/MIME/

   mv "$pkgdir"/bin/* "$pkgdir"/usr/bin/
   rmdir "$pkgdir"/bin

patch3 commented on 2018-09-06 14:38 (UTC)

I'm not sure this actually made it into master, I had to patch it manually given the instructions below.

schaap137 commented on 2018-08-07 17:19 (UTC)

To build the package successfully with the new Perl version, I had to use a patch like this:

--- PKGBUILD.orig   2018-08-07 19:12:37.114647064 +0200
+++ PKGBUILD    2018-08-07 19:07:03.137540326 +0200
@@ -31,14 +31,14 @@
   cd "vmware-vsphere-cli-distrib"

   mkdir -p "$pkgdir"/usr/bin
-  mkdir -p "$pkgdir"/usr/lib/perl5/5.26/core_perl
+  mkdir -p "$pkgdir"/usr/lib/perl5/5.28/core_perl

   ./vmware-install.pl --prefix="$pkgdir"

-  rm "$pkgdir"/usr/lib/perl5/5.26/core_perl/Data/Dumper.pm
-  rm "$pkgdir"/usr/lib/perl5/5.26/core_perl/auto/Data/Dumper/Dumper.so
-  rm -rf "$pkgdir"/usr/lib/perl5/5.26/core_perl/MIME/
-  rm -rf "$pkgdir"/usr/lib/perl5/5.26/core_perl/auto/MIME/
+  rm "$pkgdir"/usr/lib/perl5/5.28/core_perl/Data/Dumper.pm
+  rm "$pkgdir"/usr/lib/perl5/5.28/core_perl/auto/Data/Dumper/Dumper.so
+  rm -rf "$pkgdir"/usr/lib/perl5/5.28/core_perl/MIME/
+  rm -rf "$pkgdir"/usr/lib/perl5/5.28/core_perl/auto/MIME/

   mv "$pkgdir"/bin/* "$pkgdir"/usr/bin/
   rmdir "$pkgdir"/bin

paul.wilk commented on 2018-02-27 11:33 (UTC)

@spaceback

Thanks for your input. Your resolution seems to working fine. I applied it successfully to multiple independent systems. The patch you supplied has been merged with the master branch.

Cheers, Paul Wilk paul.wilk@null.net

spaceback commented on 2018-02-27 11:16 (UTC) (edited on 2018-02-27 11:17 (UTC) by spaceback)

this patch makes it build correctly:

--- PKGBUILD.orig       2018-02-27 12:15:06.328777552 +0100
+++ PKGBUILD    2018-02-27 12:11:48.593290963 +0100
@@ -30,14 +30,14 @@
   cd "vmware-vsphere-cli-distrib"

   mkdir -p "$pkgdir"/usr/bin
-  mkdir -p "$pkgdir"/usr/lib/perl5/core_perl
+  mkdir -p "$pkgdir"/usr/lib/perl5/5.26/core_perl

   ./vmware-install.pl --prefix="$pkgdir"

-  rm "$pkgdir"/usr/lib/perl5/core_perl/Data/Dumper.pm
-  rm "$pkgdir"/usr/lib/perl5/core_perl/auto/Data/Dumper/Dumper.so
-  rm -rf "$pkgdir"/usr/lib/perl5/core_perl/MIME/
-  rm -rf "$pkgdir"/usr/lib/perl5/core_perl/auto/MIME/
+  rm "$pkgdir"/usr/lib/perl5/5.26/core_perl/Data/Dumper.pm
+  rm "$pkgdir"/usr/lib/perl5/5.26/core_perl/auto/Data/Dumper/Dumper.so
+  rm -rf "$pkgdir"/usr/lib/perl5/5.26/core_perl/MIME/
+  rm -rf "$pkgdir"/usr/lib/perl5/5.26/core_perl/auto/MIME/

   mv "$pkgdir"/bin/* "$pkgdir"/usr/bin/
   rmdir "$pkgdir"/bin