Salió de barrer la máquina del usuario y cruzar sus 481 paquetes explícitos contra las 1181 recetas del corpus y las cuatro colas. zsh es su shell —medido en su historial: 1611 `cd`, 1054 `cargo`, 134 `zellij`— y no estaba en ningún lado. Una imagen de takana instalada en su laptop lo dejaba en bash: funciona, pero no es su máquina. Es el mismo hueco de RUNTIME que bash-completion: nadie lo alcanza por deps de build, así que ninguna métrica de deuda puede verlo. Sólo se ve mirando la máquina de quien la usa. Sus tres deps ya estaban selladas (ncurses, pcre2, libcap) ⇒ no arrastra tanda. Los seis parches son de main/zsh de aports y son el trabajo de portabilidad a musl que un import de nix pierde. implicit.patch (16 K) es el gordo: declaraciones implícitas que gcc14/clang rechazan como error. ⚠ RIESGO CONOCIDO para el primer build, heredado de bash.toml: si el configure mete -rdynamic en la línea de enlace, el wrapper de cc del lab tira el -static y el binario sale contra libncursesw.so.6, que NINGÚN artefacto del corpus provee ⇒ arrancaría en el sandbox de Alpine y no dentro de una imagen de takana. Síntoma: `Error relocating ... symbol not found`. El arreglo de bash fue `make LOCAL_LDFLAGS=` y vale igual. Verificar el primer artefacto con `file`: debe decir `statically linked`. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
85 lines
2.5 KiB
Diff
85 lines
2.5 KiB
Diff
From 1e52cd968d7ffd9da3249ef01f6c41f8b29e4df3 Mon Sep 17 00:00:00 2001
|
|
From: Bart Schaefer <schaefer@zsh.org>
|
|
Date: Sun, 22 May 2022 15:50:45 -0700
|
|
Subject: [PATCH] 50278: use `man -w` in preference to `manpath`; fix caching
|
|
and precedence of -M
|
|
|
|
---
|
|
ChangeLog | 5 ++++
|
|
Completion/Unix/Command/_man | 45 ++++++++++++++++++++++--------------
|
|
2 files changed, 33 insertions(+), 17 deletions(-)
|
|
|
|
diff --git a/Completion/Unix/Command/_man b/Completion/Unix/Command/_man
|
|
index dba1d13dc..190811e41 100644
|
|
--- a/Completion/Unix/Command/_man
|
|
+++ b/Completion/Unix/Command/_man
|
|
@@ -16,7 +16,7 @@
|
|
_man() {
|
|
local dirs expl mrd awk variant noinsert
|
|
local -a context line state state_descr args modes
|
|
- local -aU sects
|
|
+ local -aU sects _manpath
|
|
local -A opt_args val_args sect_descs
|
|
|
|
if [[ $service == man ]]; then
|
|
@@ -168,29 +168,40 @@ _man() {
|
|
_arguments -s -S : $args '*::: :->man' && return 0
|
|
[[ -n $state ]] || return 1
|
|
|
|
+ # Override man path
|
|
+ [[ -n ${opt_args[-M]} ]] &&
|
|
+ _manpath=( ${(s<:>)opt_args[-M]} )
|
|
+
|
|
+ # Restore cached man path to avoid $(manpath) if we can
|
|
if (( ! $#_manpath )); then
|
|
- local mp
|
|
- mp=( ${(s.:.)$(manpath 2>/dev/null)} )
|
|
- [[ "$mp" == *:* ]] && mp=( ${(s.:.)mp} )
|
|
- if (( $#mp )); then
|
|
- _manpath=( $mp )
|
|
- elif (( $#manpath )); then
|
|
- _manpath=( $manpath )
|
|
+ if (( ! $+_manpath_cache )); then
|
|
+ typeset -gHA _manpath_cache
|
|
fi
|
|
+ if [[ -z $_manpath_cache[$MANPATH] ]]; then
|
|
+ local mp
|
|
+ mp=( ${(s.:.)$({ command man -w || manpath } 2>/dev/null)} )
|
|
+ [[ "$mp" == *:* ]] && mp=( ${(s.:.)mp} )
|
|
+ if (( $#mp )); then
|
|
+ _manpath_cache[$MANPATH]=${(j.:.)mp}
|
|
+ elif (( $#manpath )); then
|
|
+ _manpath_cache[$MANPATH]=$MANPATH
|
|
+ fi
|
|
+ fi
|
|
+ _manpath=( ${(s.:.)_manpath_cache[$MANPATH]} )
|
|
+ fi
|
|
+
|
|
+ # Augment man path
|
|
+ if [[ -n ${opt_args[-m]} ]]; then
|
|
+ [[ $variant == (netbsd|openbsd)* ]] &&
|
|
+ _manpath+=( ${(s<:>)opt_args[-m]} )
|
|
+ elif [[ $variant == aix* ]]; then
|
|
+ # _manpath declared -U so no need to test
|
|
+ _manpath+=( /usr/share/man )
|
|
fi
|
|
|
|
(( $#_manpath )) ||
|
|
_manpath=( /usr/man(-/) /(opt|usr)/(pkg|dt|share|X11R6|local)/(cat|)man(-/) )
|
|
|
|
- # Override man path
|
|
- [[ -n ${opt_args[-M]} ]] &&
|
|
- _manpath=( ${(s<:>)opt_args[-M]} )
|
|
-
|
|
- # Augment man path
|
|
- [[ $variant == (netbsd|openbsd)* ]] &&
|
|
- [[ -n ${opt_args[-m]} ]] &&
|
|
- _manpath+=( ${(s<:>)opt_args[-m]} )
|
|
-
|
|
# `sman' is the SGML manual directory for Solaris 7.
|
|
# 1M is system administrator commands on SVR4
|
|
|
|
--
|
|
2.48.1
|
|
|