From 22eb6a2930561472824a339a57417b199471c764 Mon Sep 17 00:00:00 2001 From: Salvydas Lukosius Date: Tue, 26 May 2026 07:47:22 +0100 Subject: [PATCH 1/3] fix(package): make /bin/zsh replacement opt-in and de-duplicate the manifest The manifest defined 11 near-identical build recipes that had already drifted (inconsistent /bin/zsh guard). Add scripts/build-manifest.py as the single source of truth that regenerates package.json from one recipe template + version list. Fixes baked into the recipe: - /bin/zsh is no longer replaced by default; the sudo swap is gated behind an opt-in $ZSH_INSTALL_SYSTEM env var (builds into $ZPFX otherwise). - LDFLAGS typo corrected: /usr/libs -> /usr/lib, /usr/local/libs -> /usr/local/lib. - All version profiles now share one consistent build body (drift eliminated). README documents the opt-in system install. (ZSH-13) --- docs/README.md | 10 +++++ package.json | 22 +++++------ scripts/build-manifest.py | 81 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+), 11 deletions(-) create mode 100644 scripts/build-manifest.py diff --git a/docs/README.md b/docs/README.md index 3a3933c..c1c7f09 100755 --- a/docs/README.md +++ b/docs/README.md @@ -46,6 +46,16 @@ zi pack"5.2.4" for zsh zi pack"5.1.1" for zsh ``` +### System installation (opt-in) + +By default the package builds Zsh into `$ZPFX` and does **not** touch the system +shell. To also replace `/bin/zsh` (the original is backed up to `/bin/zsh.bkp`), +set `ZSH_INSTALL_SYSTEM` when installing: + +```shell +ZSH_INSTALL_SYSTEM=1 zi pack for zsh +``` + ### Default Profile The ZI command that'll be run will be equivalent to: diff --git a/package.json b/package.json index 6809465..bf41be1 100755 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/libs -L/usr/local/libs' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { type sudo >> /dev/null 2>&1 && [[ -f /bin/zsh ]] && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -32,7 +32,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.1.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/libs -L/usr/local/libs' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { type sudo >> /dev/null 2>&1 && [[ -f /bin/zsh ]] && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.1.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -43,7 +43,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.2.4; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/libs -L/usr/local/libs' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { type sudo >> /dev/null 2>&1 && [[ -f /bin/zsh ]] && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.2.4; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -54,7 +54,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.3.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/libs -L/usr/local/libs' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.3.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -65,7 +65,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.4.2; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/libs -L/usr/local/libs' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.4.2; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -76,7 +76,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.5.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/libs -L/usr/local/libs' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.5.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -87,7 +87,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.6.2; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/libs -L/usr/local/libs' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.6.2; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -98,7 +98,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.7.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/libs -L/usr/local/libs' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.7.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -109,7 +109,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.8; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/libs -L/usr/local/libs' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.8; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -120,7 +120,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.8.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/libs -L/usr/local/libs' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.8.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -131,7 +131,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.9; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/libs -L/usr/local/libs' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.9; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", diff --git a/scripts/build-manifest.py b/scripts/build-manifest.py new file mode 100644 index 0000000..3f3d2fb --- /dev/null +++ b/scripts/build-manifest.py @@ -0,0 +1,81 @@ +#!/usr/bin/env python3 +"""Generate package.json (the Zi package manifest) from a single recipe template. + +Why this exists: the manifest defines one Zi install profile per Zsh version, and +every profile's `atclone` build recipe is identical except for the `git checkout` +line. Hand-maintaining 11 ~600-char copies caused drift (e.g. an inconsistent +`-f /bin/zsh` guard). This script is the single source of truth: edit BUILD / +VERSIONS / METADATA here, run `python3 scripts/build-manifest.py`, and commit the +regenerated package.json. + +Notes on the recipe: +- Builds into $ZPFX (the Zi prefix) via `./configure --prefix="$ZPFX"`. +- Replacing the *system* /bin/zsh is opt-in: it only happens when the installer + sets `ZSH_INSTALL_SYSTEM` (e.g. `ZSH_INSTALL_SYSTEM=1 zi ...`). By default the + package never touches /bin/zsh. +""" +import json +import pathlib + +METADATA = { + "name": "zsh", + "description": "Zsh – the programmer's shell", + "homepage": "https://github.com/zsh-users/zsh", + "bugs": {"url": "https://github.com/zsh-users/zsh/issues"}, + "keywords": ["zpackage", "zshell", "zsh"], +} + +PLUGIN_INFO = {"user": "zsh-users", "plugin": "zsh"} + +# Selectable version profiles, in addition to the unpinned "default". +VERSIONS = ["5.1.1", "5.2.4", "5.3.1", "5.4.2", "5.5.1", "5.6.2", + "5.7.1", "5.8", "5.8.1", "5.9"] + +# Single source of truth for the build recipe. `{checkout}` is replaced per +# profile (empty for "default"). +BUILD = ( + "{checkout}" + "./.preconfig; m {{nl}}{{hi}}Building Zsh{{…}}; " + "CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' " + "LDFLAGS='-L/usr/lib -L/usr/local/lib' " + "./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && " + "{{ type yodl >> /dev/null 2>&1 || {{ m -u2 {{warn}}WARNING{{ehi}}:{{rst}}{{warn}} " + "No {{cmd}}yodl{{warn}}, manual pages will not be built.; ((0)); }} && " + "{{ make install; ((1)); }} || make install.bin install.fns install.modules }} " + ">> /dev/null 2>&1 && " + "{{ [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && " + "[[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; " + "((1)); }} && m {{ok}}The build succeeded. || m {{failure}}The build failed." +) + + +def ice(checkout: str) -> dict: + return { + "requires": "cc;make;cp;rm", + "git": "", + "lucid": "", + "as": "null", + "atclone": BUILD.format(checkout=checkout), + "atpull": "%atclone", + "nocompile": "", + "nocompletions": "", + "countdown": "", + } + + +def main() -> None: + ices = {"default": ice("")} + for v in VERSIONS: + ices[v] = ice(f"git checkout --quiet zsh-{v}; ") + + manifest = dict(METADATA) + manifest["zsh-data"] = {"plugin-info": PLUGIN_INFO, "zi-ices": ices} + + out = pathlib.Path(__file__).resolve().parent.parent / "package.json" + out.write_text(json.dumps(manifest, indent=2, ensure_ascii=False) + "\n", + encoding="utf-8") + print(f"Wrote {out} with {len(ices)} profiles (default + {len(VERSIONS)} versions).") + + +if __name__ == "__main__": + main() From fb18291e42437953bfb2b36b20bc939b309c6bfb Mon Sep 17 00:00:00 2001 From: Salvydas Lukosius Date: Wed, 27 May 2026 01:45:13 +0100 Subject: [PATCH 2/3] docs(package): align zsh default profile example --- docs/README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/README.md b/docs/README.md index c1c7f09..a3c5df5 100755 --- a/docs/README.md +++ b/docs/README.md @@ -58,22 +58,22 @@ ZSH_INSTALL_SYSTEM=1 zi pack for zsh ### Default Profile -The ZI command that'll be run will be equivalent to: +The ZI command that runs for the default profile is generated from `scripts/build-manifest.py` and mirrored in `package.json`. + +In short, the default profile: + +- runs `./.preconfig`, then `./configure --prefix="$ZPFX"` +- uses `LDFLAGS="-L/usr/lib -L/usr/local/lib"` +- runs `make install` when `yodl` is available, otherwise falls back to `make install.bin install.fns install.modules` +- installs into `$ZPFX` by default +- copies the built shell to `/bin/zsh` only when `ZSH_INSTALL_SYSTEM` is set + +By default it never replaces `/bin/zsh`. System replacement requires: ```shell -zi ice as"null" lucid atclone'./.preconfig; print -P %F{208}Building \ - Zsh...%f; CPPFLAGS="-I/usr/include -I/usr/local/include" CFLAGS="-g \ - -O2 -Wall" LDFLAGS="-L/usr/libs -L/usr/local/libs" \ - ./configure --prefix="$ZPFX" --enable-shared >/dev/null && make install.bin install.fns \ - install.modules >/dev/null && sudo rm -f /bin/zsh && sudo cp -vf \ - Src/zsh /bin/zsh && print -P %F{208}The build succeeded.%f || print \ - -P %F{160}The build failed.%f' - atpull"%atclone" nocompile countdown git for \ - zsh-users/zsh +ZSH_INSTALL_SYSTEM=1 zi pack for zsh ``` -It copies the zsh binary onto `/bin/zsh`. - ### ZI Completions Control Package: [system-completions](https://github.com/z-shell/system-completions) From 259f61785fb942370af687d808f665967b9d6139 Mon Sep 17 00:00:00 2001 From: Salvydas Lukosius Date: Wed, 27 May 2026 02:01:53 +0100 Subject: [PATCH 3/3] fix(package): harden opt-in system install --- docs/README.md | 7 ++++--- package.json | 22 +++++++++++----------- scripts/build-manifest.py | 8 ++++---- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/docs/README.md b/docs/README.md index a3c5df5..16fec5e 100755 --- a/docs/README.md +++ b/docs/README.md @@ -49,8 +49,9 @@ zi pack"5.1.1" for zsh ### System installation (opt-in) By default the package builds Zsh into `$ZPFX` and does **not** touch the system -shell. To also replace `/bin/zsh` (the original is backed up to `/bin/zsh.bkp`), -set `ZSH_INSTALL_SYSTEM` when installing: +shell. To also replace `/bin/zsh`, set `ZSH_INSTALL_SYSTEM=1` when installing. +The original is backed up to `/bin/zsh.bkp`; if that backup already exists, +the system replacement step fails instead of overwriting it: ```shell ZSH_INSTALL_SYSTEM=1 zi pack for zsh @@ -66,7 +67,7 @@ In short, the default profile: - uses `LDFLAGS="-L/usr/lib -L/usr/local/lib"` - runs `make install` when `yodl` is available, otherwise falls back to `make install.bin install.fns install.modules` - installs into `$ZPFX` by default -- copies the built shell to `/bin/zsh` only when `ZSH_INSTALL_SYSTEM` is set +- copies the built shell to `/bin/zsh` only when `ZSH_INSTALL_SYSTEM=1` is set and `/bin/zsh.bkp` does not already exist By default it never replaces `/bin/zsh`. System replacement requires: diff --git a/package.json b/package.json index bf41be1..e768ebf 100755 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ ${ZSH_INSTALL_SYSTEM:-} != 1 ]] || { type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && [[ ! -e /bin/zsh.bkp ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; }; } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -32,7 +32,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.1.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.1.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ ${ZSH_INSTALL_SYSTEM:-} != 1 ]] || { type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && [[ ! -e /bin/zsh.bkp ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; }; } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -43,7 +43,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.2.4; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.2.4; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ ${ZSH_INSTALL_SYSTEM:-} != 1 ]] || { type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && [[ ! -e /bin/zsh.bkp ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; }; } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -54,7 +54,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.3.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.3.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ ${ZSH_INSTALL_SYSTEM:-} != 1 ]] || { type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && [[ ! -e /bin/zsh.bkp ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; }; } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -65,7 +65,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.4.2; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.4.2; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ ${ZSH_INSTALL_SYSTEM:-} != 1 ]] || { type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && [[ ! -e /bin/zsh.bkp ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; }; } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -76,7 +76,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.5.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.5.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ ${ZSH_INSTALL_SYSTEM:-} != 1 ]] || { type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && [[ ! -e /bin/zsh.bkp ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; }; } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -87,7 +87,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.6.2; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.6.2; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ ${ZSH_INSTALL_SYSTEM:-} != 1 ]] || { type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && [[ ! -e /bin/zsh.bkp ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; }; } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -98,7 +98,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.7.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.7.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ ${ZSH_INSTALL_SYSTEM:-} != 1 ]] || { type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && [[ ! -e /bin/zsh.bkp ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; }; } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -109,7 +109,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.8; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.8; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ ${ZSH_INSTALL_SYSTEM:-} != 1 ]] || { type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && [[ ! -e /bin/zsh.bkp ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; }; } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -120,7 +120,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.8.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.8.1; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ ${ZSH_INSTALL_SYSTEM:-} != 1 ]] || { type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && [[ ! -e /bin/zsh.bkp ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; }; } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", @@ -131,7 +131,7 @@ "git": "", "lucid": "", "as": "null", - "atclone": "git checkout --quiet zsh-5.9; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; ((1)); } && m {ok}The build succeeded. || m {failure}The build failed.", + "atclone": "git checkout --quiet zsh-5.9; ./.preconfig; m {nl}{hi}Building Zsh{…}; CPPFLAGS='-I/usr/include -I/usr/local/include' CFLAGS='-g -O2 -Wall' LDFLAGS='-L/usr/lib -L/usr/local/lib' ./configure --prefix=\"$ZPFX\" >> /dev/null 2>&1 && { type yodl >> /dev/null 2>&1 || { m -u2 {warn}WARNING{ehi}:{rst}{warn} No {cmd}yodl{warn}, manual pages will not be built.; ((0)); } && { make install; ((1)); } || make install.bin install.fns install.modules } >> /dev/null 2>&1 && { [[ ${ZSH_INSTALL_SYSTEM:-} != 1 ]] || { type sudo >> /dev/null 2>&1 && [[ -e /bin/zsh ]] && [[ ! -e /bin/zsh.bkp ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; }; } && m {ok}The build succeeded. || m {failure}The build failed.", "atpull": "%atclone", "nocompile": "", "nocompletions": "", diff --git a/scripts/build-manifest.py b/scripts/build-manifest.py index 3f3d2fb..926b05c 100644 --- a/scripts/build-manifest.py +++ b/scripts/build-manifest.py @@ -11,7 +11,7 @@ Notes on the recipe: - Builds into $ZPFX (the Zi prefix) via `./configure --prefix="$ZPFX"`. - Replacing the *system* /bin/zsh is opt-in: it only happens when the installer - sets `ZSH_INSTALL_SYSTEM` (e.g. `ZSH_INSTALL_SYSTEM=1 zi ...`). By default the + sets `ZSH_INSTALL_SYSTEM=1`. By default the package never touches /bin/zsh. """ import json @@ -43,9 +43,9 @@ "No {{cmd}}yodl{{warn}}, manual pages will not be built.; ((0)); }} && " "{{ make install; ((1)); }} || make install.bin install.fns install.modules }} " ">> /dev/null 2>&1 && " - "{{ [[ -n \"$ZSH_INSTALL_SYSTEM\" ]] && type sudo >> /dev/null 2>&1 && " - "[[ -e /bin/zsh ]] && sudo mv /bin/zsh /bin/zsh.bkp && sudo cp -vf Src/zsh /bin/zsh; " - "((1)); }} && m {{ok}}The build succeeded. || m {{failure}}The build failed." + "{{ [[ ${{ZSH_INSTALL_SYSTEM:-}} != 1 ]] || {{ type sudo >> /dev/null 2>&1 && " + "[[ -e /bin/zsh ]] && [[ ! -e /bin/zsh.bkp ]] && sudo mv /bin/zsh /bin/zsh.bkp && " + "sudo cp -vf Src/zsh /bin/zsh; }}; }} && m {{ok}}The build succeeded. || m {{failure}}The build failed." )