Skip to content

Conversation

@DevonianTeuchter
Copy link
Collaborator

Update to the installer primarily to handle install direct from file but includes:

  • analyzes install packages to determine if any are local files
  • implements capability to allow for custom repositories, currently complete GitHub mirror or a local directory; defaults to z/OS Open Tools main GH repo
  • generates install graph in advance to allow for space calculation up-front
  • implements pre/post phases to allow scripts to run at certain times. Default scripts:
    -- auto-cache-clean - clean package cache after installation transaction completes [enabled by default]
    -- man-db - run man-db automagically after install/alt/remove transactions [enabled if man-db package is installed]
    -- caveats - display any "caveats" that a package might have after installation [a caveat being something an end user has to either run, configure or be aware of when using a certain package]
  • implements an a/all option for y/n questions to automatically answer yes
  • generates a package database, updated during install/alt/removal
  • performance improvements to queries, utilising package db and jq
  • split install into "upgrade" and "install" scripts
  • split query into "query" and "list" scripts
  • multiple bug fixes and shellcheck updates
  • removes [broken] customized filesystem type logic; always use default of usr/local/zopen for package installation

Should resolve/improve: #733 #717 #701 #694 #688 #675 #673 #661 #643 #633 #619 #617 #605 #567 #566 #558 #533 #472 #431 #381 #339 #240

@IgorTodorovskiIBM
Copy link
Member

Impressive amount of changes! This will take me a few days to review!

@v1gnesh
Copy link
Collaborator

v1gnesh commented Mar 23, 2024

With a minor edit to the last line w.r.t issues closed, we can make GH auto-close them on the merge of this PR.
https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword

@DevonianTeuchter
Copy link
Collaborator Author

DevonianTeuchter commented Mar 23, 2024

With a minor edit to the last line w.r.t issues closed, we can make GH auto-close them on the merge of this PR.

My choice of words was deliberate to ensure this didn't happen ;-) As there is a lot of churn and some of the issues are subjective, explicitly checking those issues to see if the submitter is happy with the update is advised.

@DevonianTeuchter
Copy link
Collaborator Author

Investigating test harness failures...

@lbdyck
Copy link
Collaborator

lbdyck commented Mar 23, 2024

Impressive

@IgorTodorovskiIBM
Copy link
Member

I cloned this branch and ran zopen init on my existing file system and got this? Are we able to get it to work with existing file systems?

. ./.env
zopen init -y
Initializing zopen framework
- Enter fully-qualified path to your zopen root directory (default: /home/itodoro/zopen):

- Binaries will be symlinked under "/home/itodoro/zopen/usr/local/bin". Libraries will be symlinked under "/home/itodoro/zopen/usr/lib"
- Packages will be installed and maintained under the directory '/home/itodoro/zopen/'.
- Collecting usage statistics: true
- Re-initializing; zopen-config will be re-created
Generating File System
- Setting certificate environment variable
- Root FS available at /home/itodoro/zopen
Generating zopen-config
- Created config in /home/itodoro/zopen/etc/zopen-config
Installing zopen pre-requisites
/home/itodoro/projects/meta_new/packages/curl-8.4.0.20231011_155722.zos.pax.Z
- Sourcing environment
Processing z/OS Open Tools configuration...DONE
Updating CA Certificate
Getting latest CA Certificate
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  224k  100  224k    0     0  1515k      0 --:--:-- --:--:-- --:--:-- 1515k
Re-creating /home/itodoro/zopen/etc/pki/tls/certs/cacert.pem
- zopen bootstrapping complete
***WARNING: No metadata.json found in '/home/itodoro/zopen/usr/local/zopen/./bump/./bump'. Bad package install?
***WARNING: No metadata.json found in '/home/itodoro/zopen/usr/local/zopen/./bzip2/./bzip2'. Bad package install?
***WARNING: No metadata.json found in '/home/itodoro/zopen/usr/local/zopen/./cli/./cli'. Bad package install?
***WARNING: No metadata.json found in '/home/itodoro/zopen/usr/local/zopen/./expat/./expat'. Bad package install?
***WARNING: No metadata.json found in '/home/itodoro/zopen/usr/local/zopen/./expect/./expect'. Bad package install?
***WARNING: No metadata.json found in '/home/itodoro/zopen/usr/local/zopen/./findutils/./findutils'. Bad package install?
***WARNING: No metadata.json found in '/home/itodoro/zopen/usr/local/zopen/./gettext/./gettext'. Bad package install?
***WARNING: No metadata.json found in '/home/itodoro/zopen/usr/local/zopen/./gperf/./gperf'. Bad package install?
***WARNING: No metadata.json found in '/home/itodoro/zopen/usr/local/zopen/./gpg/./gpg'. Bad package install?
***WARNING: No metadata.json found in '/home/itodoro/zopen/usr/local/zopen/./help2man/./help2man'. Bad package install?
***WARNING: No metadata.json found in '/home/itodoro/zopen/usr/local/zopen/./libgdbm/./libgdbm'. Bad package install?
***WARNING: No metadata.json found in '/home/itodoro/zopen/usr/local/zopen/./libmd/./libmd'. Bad package install?
***WARNING: No metadata.json found in '/home/itodoro/zopen/usr/local/zopen/./libpcre/./libpcre'. Bad package install?
***WARNING: No metadata.json found in '/home/itodoro/zopen/usr/local/zopen/./libpcre2/./libpcre2'. Bad package install?
***WARNING: No metadata.json found in '/home/itodoro/zopen/usr/local/zopen/./libxml2/./libxml2'. Bad package install?
***WARNING: No metadata.json found in '/home/itodoro/zopen/usr/local/zopen/./llama/./llama'. Bad package install?
jq: invalid JSON text passed to --argjson
Use jq --help for help with command-line options,
or see the jq manpage, or online docs  at https://stedolan.github.io/jq
***ERROR: Could not add metadata for '' to install tracker. Run zopen --re-init to attempt regeneration.

@IgorTodorovskiIBM
Copy link
Member

On a new zopen file system:

zopen init
Initializing zopen framework
- Enter fully-qualified path to your zopen root directory (default: /home/itodoro/zopen):
/home/itodoro/zopen-russell
- Binaries will be symlinked under "/home/itodoro/zopen-russell/usr/local/bin". Libraries will be symlinked under "/home/itodoro/zopen-russell/usr/lib"
- Packages will be installed and maintained under the directory '/home/itodoro/zopen-russell/'.
- Collecting usage statistics: true
Do you want to continue? [y/n]
y
Generating File System
- Setting certificate environment variable
- Root FS available at /home/itodoro/zopen-russell
Generating zopen-config
- Created config in /home/itodoro/zopen-russell/etc/zopen-config
Installing zopen pre-requisites
/home/itodoro/projects/meta_new/packages/curl-8.4.0.20231011_155722.zos.pax.Z
Setting up curl...
Setup completed.
Setting up jq...
Setup completed.
- Sourcing environment
Updating CA Certificate
Getting latest CA Certificate
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  224k  100  224k    0     0  1458k      0 --:--:-- --:--:-- --:--:-- 1465k
Re-creating /home/itodoro/zopen-russell/etc/pki/tls/certs/cacert.pem
- zopen bootstrapping complete
- Configured zopen to use stable releaseline packages
find: FSUM6512 unable to access "./*/.": EDC5129I No such file or directory.
***ERROR: Unable to update the package db

I have z/OS Open Tools find in my PATH

@DevonianTeuchter
Copy link
Collaborator Author

I cloned this branch and ran zopen init on my existing file system and got this? Are we able to get it to work with existing file systems?

I had tested migrating from 0.8.0 and 0.8.2 - but that was using the --refresh rather than re-init options... let me check that migration path

find: FSUM6512 unable to access "./*/.": EDC5129I No such file or directory.
***ERROR: Unable to update the package db

Another thing to investigate...

@DevonianTeuchter
Copy link
Collaborator Author

@IgorTodorovskiIBM I've pushed a further commit that should resolve the issue when running in a new environment (ie. zopen init). slight issue is that when using the checked out version, it will automatically update meta to the latest in the repo so you then have to reapply the clone into the zopen filesystem. No easy way around that as copying the installing meta into the zopen filesystem could leave the system with an older meta than in the repo going forward, depengind on how quickly a packaged release is made available [if that makes sense].
Some of the changes in the commit are to fix the custom repo handling also.

@DevonianTeuchter
Copy link
Collaborator Author

DevonianTeuchter commented May 9, 2024

If anyone has a chance [and is feeling up for a challenge!], the new installer for zopen is available for testing.
It has to be cloned from git since it cannot be pushed to the repos until tested/merged: git clone --single-branch -b new_installer https://github.com/ZOSOpenTools/meta.git
and there's a few hoops to jump through [since it's not available in the repos, zopen has to be tricked to use it]
If interested, please see below for more information

The updated zopen will generate metadata when first "upgraded" so this needs more than just copying the files across - there needs to be a refresh.
Once cloned:
= Installing into a clean test environment:

  • cd into the cloned/meta/bin directory
  • run ./zopen init -y ""
  • Run the instruxtions below to integrate the new meta in place of the "latest" as installed during the initialization
    = An existing zopen environment can be upgraded by:
  • move the cloned directory to <zopen-rootfs>/usr/local/zopen/meta/meta.git
  • run zopen alt --select meta and pick the git version of zopen (which should be listed)
  • run zopen init --refresh - this should generate a new package database.
    This is basically what happens under-the-covers during a meta upgrade, just manually run.
    There shouldn't be any errors when running the commands - at least, it works on my system anyway! :-)
    It should be possible to move back to an older meta by using zopen alt --select meta, the new files/directories generated in <zopenrootfs>/etc/zopen will however need to be manually deleted (as the older meta releases have no knowledge of these files)
    Note that for testing purposes, cloning directly into a directory meta.[xyz] under usr/local/zopen/meta means it is possible to test different versions using zopen alt to switch; using a symlink within the u/l/z/meta directory structure will not currently work due to how the "in-use" version is detected
    Any and all feedback would be appreciated - as this is a bit more than a bug fix or basic feature addition, having extra testing would be useful!

@IgorTodorovskiIBM
Copy link
Member

[ITODORO@ZOSCAN2B ~/projects]$ zopen install ~/zopen/var/cache/zopen/tmux-heads.3.3a.20240308_143819.zos.pax.Z
curl: (37) Couldn't open file /home/itodoro/projects//home/itodoro/zopen/var/cache/zopen/tmux-heads.3.3a.20240308_143819.zos.pax.Z
***ERROR: Could not download from file:///home/itodoro/projects//home/itodoro/zopen/var/cache/zopen/tmux-heads.3.3a.20240308_143819.zos.pax.Z. Correct any errors and potentially retry
[ITODORO@ZOSCAN2B ~/projects]$ zopen install $HOME/zopen/var/cache/zopen/tmux-heads.3.3a.20240308_143819.zos.pax.Z
curl: (37) Couldn't open file /home/itodoro/projects//home/itodoro/zopen/var/cache/zopen/tmux-heads.3.3a.20240308_143819.zos.pax.Z
***ERROR: Could not download from file:///home/itodoro/projects//home/itodoro/zopen/var/cache/zopen/tmux-heads.3.3a.20240308_143819.zos.pax.Z. Correct any errors and potentially retry
[ITODORO@ZOSCAN2B ~/projects]$ zopen install zopen/var/cache/zopen/tmux-heads.3.3a.20240308_143819.zos.pax.Z
***ERROR: The following ports could not be installed:
***ERROR:     zopen/var/cache/zopen/tmux-heads.3.3a.20240308_143819.zos.pax.Z
***ERROR: Check port name(s), remove any extra 'port' suffixes and retry command.
[ITODORO@ZOSCAN2B ~/projects]$

@DevonianTeuchter
Copy link
Collaborator Author

DevonianTeuchter commented Feb 7, 2025

@IgorTodorovskiIBM One of the new commits should resolve your issue with relative local paxes.

@DevonianTeuchter
Copy link
Collaborator Author

To test the PR, replace with fq-path to zopen.test and all instances of zopen.test with test directory> :

  1. git clone https://github.com/zopencommunity/meta.git -b new_installer zopen.test/usr/local/zopen/meta/meta.new_installer
  2. zopen.test/usr/local/zopen/meta/meta.new_installer/bin/zopen init /<parents>/zopen.test
  3. zopen alt --select meta -> option 1

@pjfarleyiii
Copy link

@DevonianTeuchter I would like to test your new installer, but my employer's z/OS system has NO access to github or any other outside network locations and I do not have any copy of git available even if this system did have access to any network locations. If I git clone the zopen.test tree to my work PC and upload the entire cloned directory to my z/OS Unix file system under my $HOME directory (maybe using a pax file of the whole tree?), is there any chance this new installer can work on this z/OS system (e.g., the cacert.pem retrieval using curl does not function on this z/OS, I have to go get it using a web browser and then upload it to the mainframe under my $HOME directory).

@IgorTodorovskiIBM
Copy link
Member

IgorTodorovskiIBM commented Mar 14, 2025

Here's a script I am using to install / update to this new installer:

#!/bin/sh

ROOTFS=${1:-$ZOPEN_ROOTFS}

if [ -z "$ROOTFS" ]; then
    echo "Error: ZOPEN_ROOTFS is not set. Please set it or provide it as an argument."
    exit 1
fi

echo "This will update zopen to the new installer under $ROOTFS. Do you want to continue? (y/N)"
read response
case "$response" in
    y|Y) ;;
    *) echo "Operation aborted."; exit 1 ;;
esac

rm -rf "$ROOTFS/usr/local/zopen/meta/meta.new_installer"
GIT_UTF8_CCSID=819 git clone https://github.com/zopencommunity/meta.git -b new_installer "$ROOTFS/usr/local/zopen/meta/meta.new_installer"
"$ROOTFS/usr/local/zopen/meta/meta.new_installer/bin/zopen" init "$ROOTFS"
zopen alt --set meta meta.new_installer
touch "$ROOTFS/usr/local/zopen/meta/meta.new_installer/.pinned"
  1. Copy the above to a file name update_zopen.sh and give it executable permissions
  2. ./update_zopen.sh

@MikeFultonDev
Copy link
Collaborator

barfed right at the end for me:
image

Here's the whole screen without nice colours:

MFULTON@AQMVSOE:~>vi update_zopen.sh
MFULTON@AQMVSOE:~>chmod u+x update_zopen.sh
MFULTON@AQMVSOE:~>./update_zopen.sh
This will update zopen to the new installer under /u/mfulton/zopen. Do you want to continue? (y/N)
y
Cloning into '/u/mfulton/zopen/usr/local/zopen/meta/meta.new_installer'...
remote: Enumerating objects: 37505, done.
remote: Counting objects: 100% (802/802), done.
remote: Compressing objects: 100% (431/431), done.
remote: Total 37505 (delta 610), reused 537 (delta 371), pack-reused 36703 (from 2)
Receiving objects: 100% (37505/37505), 142.13 MiB | 52.56 MiB/s, done.
Resolving deltas: 100% (29572/29572), done.
Initializing zopen framework
- Binaries will be symlinked under "/u/mfulton/zopen/usr/local/bin". Libraries will be symlinked under "/u/mfulton/zopen/usr/lib"
- Packages will be installed and maintained under the directory '/u/mfulton/zopen/'.
- Collecting usage statistics: true
Do you want to continue? [y/n]
y
Should zopen tools default to overriding the z/OS /bin tools (e.g. man, find, grep)? [y/n]
n
***WARNING: - Existing configuration file found; re-initializing might lose access to previously installed packages. Continue (y/n)?
y
- Re-initializing; zopen-config will be re-created
Generating File System
- Setting certificate environment variable
- Root FS available at /u/mfulton/zopen
Installing zopen pre-requisites
/u/mfulton/zopen/usr/local/zopen/meta/meta.new_installer/packages/curl-8.10.1.20241001_214340.zos.pax.Z
/u/mfulton/zopen/usr/local/zopen/meta/meta.new_installer/packages/jq-1.6.20241001_204116.zos.pax.Z
/u/mfulton/zopen/usr/local/zopen/meta/meta.new_installer/packages/pinentry-1.2.1.20241002_001628.zos.pax.Z
/u/mfulton/zopen/usr/local/zopen/meta/meta.new_installer/packages/gnupg-2.4.4.20241001_233258.zos.pax.Z
Setting up curl...
Setup completed.
Setting up pinentry...
Setup completed.
Setting up gnupg...
Setup completed.
- Sourcing environment
Refreshing global configuration
Generating zopen-config
- Created config in /u/mfulton/zopen/etc/zopen-config
Processing zopen community configuration...DONE
NOTE: Conflicting tools (eg. man, cat, grep, make) will NOT take precendence over z/OS /bin tools; Use the prefixed executables instead (eg. zotman, gcat, ggrep, gmake). Pass the option --override-zos-tools if you prefer zopen tools or --help for further options.
Updating CA Certificate
Getting latest CA Certificate
Re-creating /u/mfulton/zopen/etc/pki/tls/certs/cacert.pem
- zopen bootstrapping complete
- Installing/updating bootstrapped curl, jq, gpg, pinentry and meta to install updated versions (if available)
- Created install graph
- Created dependancy graph
Installing the following packages:
curl
jq
pinentry
gpg
meta
After this operation, 166 MB of additional disk space will be used.
- Expanded file:  /u/mfulton/zopen/var/cache/zopen/curl-8.12.1.20250214_145238.zos.pax.Z
- Checked for file differences in mesh
Successfully installed curl
- Expanded file:  /u/mfulton/zopen/var/cache/zopen/jq-1.7.1.20250202_085803.zos.pax.Z
- Checked for file differences in mesh
- Expanded file:  /u/mfulton/zopen/var/cache/zopen/pinentry-1.3.1.20250131_041514.zos.pax.Z
- Checked for file differences in mesh
Successfully installed pinentry
- Expanded file:  /u/mfulton/zopen/var/cache/zopen/gnupg-2.5.4.20250305_125551.zos.pax.Z
- Checked for file differences in mesh
Successfully installed gpg
- Expanded file:  /u/mfulton/zopen/var/cache/zopen/meta-main.20250214_121722.zos.pax.Z
- Checked for file differences in mesh
Successfully installed meta
Installation complete.
Processing zopen community configuration...DONE
NOTE: Conflicting tools (eg. man, cat, grep, make) will NOT take precendence over z/OS /bin tools; Use the prefixed executables instead (eg. zotman, gcat, ggrep, gmake). Pass the option --override-zos-tools if you prefer zopen tools or --help for further options.
Initialization successfully completed
IMPORTANT: Run '. /u/mfulton/zopen/etc/zopen-config' to enable zopen environment for current session or add it to your .profile.
IMPORTANT: If you prefer GNU tools over z/OS /bin tools, run '. /u/mfulton/zopen/etc/zopen-config --override-zos-tools' in the current session or add it to your .profile.
***ERROR: Missing argument(s) for set option. Check program arguments

@IgorTodorovskiIBM
Copy link
Member

barfed right at the end for me: image

Here's the whole screen without nice colours:

MFULTON@AQMVSOE:~>vi update_zopen.sh
MFULTON@AQMVSOE:~>chmod u+x update_zopen.sh
MFULTON@AQMVSOE:~>./update_zopen.sh
This will update zopen to the new installer under /u/mfulton/zopen. Do you want to continue? (y/N)
y
Cloning into '/u/mfulton/zopen/usr/local/zopen/meta/meta.new_installer'...
remote: Enumerating objects: 37505, done.
remote: Counting objects: 100% (802/802), done.
remote: Compressing objects: 100% (431/431), done.
remote: Total 37505 (delta 610), reused 537 (delta 371), pack-reused 36703 (from 2)
Receiving objects: 100% (37505/37505), 142.13 MiB | 52.56 MiB/s, done.
Resolving deltas: 100% (29572/29572), done.
Initializing zopen framework
- Binaries will be symlinked under "/u/mfulton/zopen/usr/local/bin". Libraries will be symlinked under "/u/mfulton/zopen/usr/lib"
- Packages will be installed and maintained under the directory '/u/mfulton/zopen/'.
- Collecting usage statistics: true
Do you want to continue? [y/n]
y
Should zopen tools default to overriding the z/OS /bin tools (e.g. man, find, grep)? [y/n]
n
***WARNING: - Existing configuration file found; re-initializing might lose access to previously installed packages. Continue (y/n)?
y
- Re-initializing; zopen-config will be re-created
Generating File System
- Setting certificate environment variable
- Root FS available at /u/mfulton/zopen
Installing zopen pre-requisites
/u/mfulton/zopen/usr/local/zopen/meta/meta.new_installer/packages/curl-8.10.1.20241001_214340.zos.pax.Z
/u/mfulton/zopen/usr/local/zopen/meta/meta.new_installer/packages/jq-1.6.20241001_204116.zos.pax.Z
/u/mfulton/zopen/usr/local/zopen/meta/meta.new_installer/packages/pinentry-1.2.1.20241002_001628.zos.pax.Z
/u/mfulton/zopen/usr/local/zopen/meta/meta.new_installer/packages/gnupg-2.4.4.20241001_233258.zos.pax.Z
Setting up curl...
Setup completed.
Setting up pinentry...
Setup completed.
Setting up gnupg...
Setup completed.
- Sourcing environment
Refreshing global configuration
Generating zopen-config
- Created config in /u/mfulton/zopen/etc/zopen-config
Processing zopen community configuration...DONE
NOTE: Conflicting tools (eg. man, cat, grep, make) will NOT take precendence over z/OS /bin tools; Use the prefixed executables instead (eg. zotman, gcat, ggrep, gmake). Pass the option --override-zos-tools if you prefer zopen tools or --help for further options.
Updating CA Certificate
Getting latest CA Certificate
Re-creating /u/mfulton/zopen/etc/pki/tls/certs/cacert.pem
- zopen bootstrapping complete
- Installing/updating bootstrapped curl, jq, gpg, pinentry and meta to install updated versions (if available)
- Created install graph
- Created dependancy graph
Installing the following packages:
curl
jq
pinentry
gpg
meta
After this operation, 166 MB of additional disk space will be used.
- Expanded file:  /u/mfulton/zopen/var/cache/zopen/curl-8.12.1.20250214_145238.zos.pax.Z
- Checked for file differences in mesh
Successfully installed curl
- Expanded file:  /u/mfulton/zopen/var/cache/zopen/jq-1.7.1.20250202_085803.zos.pax.Z
- Checked for file differences in mesh
- Expanded file:  /u/mfulton/zopen/var/cache/zopen/pinentry-1.3.1.20250131_041514.zos.pax.Z
- Checked for file differences in mesh
Successfully installed pinentry
- Expanded file:  /u/mfulton/zopen/var/cache/zopen/gnupg-2.5.4.20250305_125551.zos.pax.Z
- Checked for file differences in mesh
Successfully installed gpg
- Expanded file:  /u/mfulton/zopen/var/cache/zopen/meta-main.20250214_121722.zos.pax.Z
- Checked for file differences in mesh
Successfully installed meta
Installation complete.
Processing zopen community configuration...DONE
NOTE: Conflicting tools (eg. man, cat, grep, make) will NOT take precendence over z/OS /bin tools; Use the prefixed executables instead (eg. zotman, gcat, ggrep, gmake). Pass the option --override-zos-tools if you prefer zopen tools or --help for further options.
Initialization successfully completed
IMPORTANT: Run '. /u/mfulton/zopen/etc/zopen-config' to enable zopen environment for current session or add it to your .profile.
IMPORTANT: If you prefer GNU tools over z/OS /bin tools, run '. /u/mfulton/zopen/etc/zopen-config --override-zos-tools' in the current session or add it to your .profile.
***ERROR: Missing argument(s) for set option. Check program arguments

Oh, maybe I had an older version when I ran it? or Russell fixed it.

Do zopen alt --set meta meta.new_installer and you should be good to go

@IgorTodorovskiIBM
Copy link
Member

@DevonianTeuchter I gave the latest a test. I think it's getting close! Here's some additional feedback/questions:

  1. zopen clean -m does not emit anything. In contrast, zopen clean -c does.
zopen clean -m
(No output provided)
  1. Previously, zopen list defaulted output with the header, now I need to specify --header. Is that intended?

  2. A few issues with zopen list --details --available --header:

Package             Installed Latest Tag                          Download sizeDisk usageQuality
ant                 installed         STABLE_antport_3011          1974272   3595264    -0%

Note the -0%, previously it reported “No tests”. Also, sizeDisk and usageQuality are not consistent with the other headers.

  1. I noticed mentions of "z/OS Open Tools" in a few of the help outputs, while the main branch has changed these instances to "zopen community":
bin/zopen-list:# List utility for z/OS Open Tools - https://github.com/ZOSOpenTools
bin/zopen-list:  --available     lists all available z/OS Open Tools
bin/zopen-list:  --installed     list only installed z/OS Open Tools (default output)
bin/zopen-query:  -i, --installed   list only installed z/OS Open Tools
bin/zopen-query:      --list        list all available z/OS Open Tools
bin/zopen-upgrade:# Upgrade utility for z/OS Open Tools - https://github.com/ZOSOpenTools
bin/zopen-upgrade:zopen upgrade is a utility for z/OS Open Tools to upgrade packages to
cicd/on_nightly.sh:  git config --global user.name "ZOS Open Tools"
cicd/on_release.sh:git config --global user.name "ZOS Open Tools"
  1. Getting debug output with zopen mirror:
...
+ 1<TMP> /tmp/shFFFeCHGbA
MAGENTA=
+ CYAN=
+ GRAY=
+ BOLD=
+ UNDERLINE=
+ HEADERCOLOR=
+ WARNINGCOLOR=
+ + printf
+ 1<TMP> /tmp/shGagHeCFfA
NC=
+ parseArgs
+ [ 0 -gt 0 ]
+ log zopen repository mirror
+ false
+ /bin/printf zopen repository mirror\n
zopen repository mirror
+ false
+ false
+ false
+ [ -z  ]
+ err Github personal access token (PAT) required to prevent rate-limiting
+ /bin/printf  !! Github personal access token (PAT) required to prevent rate-limiting\n
 !! Github personal access token (PAT) required to prevent rate-limiting
+ exit 1

@IgorTodorovskiIBM
Copy link
Member

IgorTodorovskiIBM commented Mar 31, 2025

Also, my zopen_releases.json still does not get updated automatically. I need to do this:

[ITODORO@ZOSCAN2B ~]$ zopen install getopt -y
- Created install graph
- Created dependancy graph
- No packages require installation
[ITODORO@ZOSCAN2B ~]$ zopen clean -m # clean the old one
[ITODORO@ZOSCAN2B ~]$ zopen install getopt -y
- Created install graph
- Created dependancy graph
Installing the following packages:
getopt
- Expanded file:  /home/itodoro/zopen/var/cache/zopen/getopt-1.1.6.20250331_150230.zos.pax.Z
- Merged getopt into symlink mesh
- Checked for file differences in mesh
Successfully installed getopt
Installation complete.

@v1gnesh
Copy link
Collaborator

v1gnesh commented Dec 19, 2025

This is a big one - augment review. Be thorough & systematic pls.

@augmentcode
Copy link

augmentcode bot commented Dec 19, 2025

🤖 Augment PR Summary

Summary: Large installer refactor to better support local/offline installs, custom repositories, and transaction-style package operations.

Changes:

  • Refactors install flow to build an install graph up-front (dependency/space calculation) and drive installs via cached JSON metadata + a local packageDB.json.
  • Adds scriptlet phases (transaction/install/remove pre/post) and default scriptlets for cache cleanup, caveats output, and man-db refresh.
  • Introduces new commands/scripts: zopen-list, zopen-upgrade, zopen-mirror; updates the main zopen wrapper routing accordingly.
  • Updates zopen init to generate repos.d configuration (defaulting to the main GitHub repo), support --offline, and bootstrap base tooling + meta.
  • Consolidates remote metadata retrieval into updateCaches and replaces many legacy zos* wrappers with standard find/du usage.

Technical Notes: Adds/extends config keys (e.g., autocacheclean/autopkgpurge/skip_broken/skip_size_check) and bumps zopen version to 0.9.0.

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 7 suggestions posted.

Comment augment review to trigger a new review at any time.

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/sh -x
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#!/bin/sh -x enables shell tracing by default, which will echo command lines/args (potentially including credentials like PATs/passwords) and makes normal CLI output very noisy. Consider only enabling -x under an explicit --xdebug/env flag (also applies to other scripts in this PR).

🤖 Was this useful? React with 👍 or 👎

if [ -e "${ZOPEN_PKGINSTALL}/${package}/${package}" ]; then
printVerbose "Removing main link"
rm -rf "${ZOPEN_PKGINSTALL}/${package}/${package}"
if ! rm -rf "${ZOPEN_PKGINSTALL}/${package}/${package}:?"; then
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rm -rf "${ZOPEN_PKGINSTALL}/${package}/${package}:?" looks like a typo for the ${var:?} safety expansion; as written it targets a literal .../package:? path and won’t remove the existing symlink. That can leave the old "current" link in place and break zopen alt --set behavior.

🤖 Was this useful? React with 👍 or 👎

package="$1"
newver="$2"
shift
newver="$1"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--set parsing no longer captures the package argument (only newver="$1"), so zopen alt --set <pkg> <ver> will end up swapping/misassigning package and newver (since package is set later in the default branch). This makes setAlt "${package}" "${newver}" unreliable for normal usage.

🤖 Was this useful? React with 👍 or 👎

# shellcheck disable=SC2034
bypassPrereqs=false
# shellcheck disable=SC2034
setActive=true
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

include/common.sh uses $setactive as a boolean command in multiple places (e.g., if $setactive && ...), but this script initializes setActive=true (different variable). If setactive stays unset, it will expand to an empty command and can cause a shell syntax/runtime failure during install (also applies to bin/zopen-upgrade).

🤖 Was this useful? React with 👍 or 👎

;;
"--no-symlink")
# shellcheck disable=SC2034
setactive=true # Do not mesh the package into the file system; leave as stand-alone
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--no-symlink currently sets setactive=true but never sets nosymlink=true, so the flag appears to have no effect (the install path will still run mergeIntoSystem when nosymlink is false).

🤖 Was this useful? React with 👍 or 👎

cat <<EOS >"${repoDFile}"
{
"type": "$2",
"metadata_baseurl": "${target}")",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated repod.json here is invalid JSON due to the extra ) in "metadata_baseurl": "${target}")", (and there’s a similar issue later in the Nexus generateRepoD heredoc where the JSON appears truncated). This will break --genRepoFile/--activate for remote repo types.

🤖 Was this useful? React with 👍 or 👎

split(values[i], words, /[ \t]+/)
for (j = 1; j <= length(words); j++) {
word = words[j]
printf "Parsed word:>>%s\n", word
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prettyPrint()’s awk currently prints debug lines like Parsed word:>>... / Started new line:>>... unconditionally, which will pollute stdout for any caller using this formatter. If this is meant for debugging, it likely needs to be gated behind a debug/verbose flag or removed before release.

🤖 Was this useful? React with 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants