ZOSOpenTools / meta

Meta repository to tie together the various underlying z/OS Open Source tools repositories here
https://zosopentools.github.io/meta/
Apache License 2.0
37 stars 25 forks source link

Meta 0.8.1 installation of tar fails #636

Closed ian-burnett closed 6 months ago

ian-burnett commented 6 months ago

Installing tar after upgrading to meta 0.8.1 gives the following error:

MV2A /MV2A/u/iburnet:> zopen install tar -v
VERBOSE: Installing to zopen file system: /cicsperf/zopen
VERBOSE: Working directory: /cicsperf/zopen/var/cache/zopen
- Querying repo for latest package information.
VERBOSE: Processing repo: ar
VERBOSE: Stripping any version (%), tag (#) or port suffixes
VERBOSE: Checking whether any invalid ports were specified.
***ERROR: The following requested port(s) do not exist:
         ar
***ERROR: Check port name(s), remove any port suffixes and retry command.

Note attempted install of package "ar".

Traced to the strtrim() routine in common.sh:

strtrim()
{
  echo "$1" | sed -e 's/^[ \t]*//' -e 's/[ ]*$//'
}

My shell is using the z/OS default sed tooling. Executing the following command gives an unexpected result:

MV2A /u/iburnet:> echo "    tttttabcdef  " | sed -e 's/^[ \t]*//' -e 's/[ ]*$//'
abcdef

When the z/OS Open Tools sed port is installed, this works correctly.

This problem also occurs trying to upgrade an existing instance of tar - same result of trimming the "tar" package name down to "ar", which is then not found.

MV2A /MV2A/u/iburnet:> zopen upgrade tar
- Querying repo for latest package information.
***ERROR: The following requested port(s) do not exist:
         ar
***ERROR: Check port name(s), remove any port suffixes and retry command.

Also occurs if you try to upgrade all installed.

ian-burnett commented 6 months ago

Looks like this is because the z/OS default sed doesn't recognise the \t escape sequence for a tab.

Changing \t in the first sed expression to a literal tab (in vim insert mode: Ctrl-V, tab) works correctly.

MikeFultonDev commented 6 months ago

Thanks for the detailed analysis. @DevonianTeuchter looks like you are taking this one ?