.gear/autobuild.update | 5 + .gear/autobuild.watch | 2 + ...build-Complete-file-arguments-after-r-b-t.patch | 25 + .../47867-promptinit-typo-RPOMPT-RPROMPT.patch | 34 ++ .../47868-promptinit-Fix-prompt-cleanups.patch | 182 ++++++ ...47918-completions-for-nsenter-and-unshare.patch | 103 ++++ ...-zsh-executable-discovery-if-proc-missing.patch | 27 + .../alt-rpm-0001-_rpm-complete-q-lastchange.patch | 24 + .gear/rules | 3 + .../tags/d165b4864d736d67a39d0c738132b501f8d4aae4 | 17 + .gear/tags/list | 1 + Completion/ALT/.distfiles | 3 + Completion/ALT/Command/.distfiles | 12 + Completion/ALT/Command/_add_changelog | 14 + Completion/ALT/Command/_buildreq | 19 + Completion/ALT/Command/_control | 29 + Completion/ALT/Command/_control_d | 21 + Completion/ALT/Command/_gear | 183 ++++++ Completion/ALT/Command/_girar | 40 ++ Completion/ALT/Command/_girar_remote | 278 +++++++++ Completion/ALT/Command/_hasher | 163 +++++ Completion/ALT/Command/_sisyphus_check | 29 + Completion/ALT/Type/.distfiles | 5 + Completion/ALT/Type/_girar_info | 149 +++++ Completion/ALT/Type/_sisyphus_check_tests | 33 ++ Completion/Debian/Command/_apt | 74 +-- Completion/Debian/Command/_aptitude | 12 +- Completion/Linux/Command/_pmount | 43 ++ Completion/Linux/Command/_vzctl | 101 ++++ Completion/Redhat/Type/_rpm_packages | 129 ++++ Completion/Unix/Command/_gdb | 34 +- Completion/Unix/Type/_hosts | 10 +- Doc/Zsh/compsys.yo | 2 +- Doc/ztexi.yo | 2 +- Src/Modules/zpty.c | 56 +- Src/Zle/complete.mdd | 2 +- Src/builtin.c | 2 +- Src/init.c | 36 +- configure.ac | 2 +- zcfg/zlerc | 77 +++ zcfg/zlogout | 16 + zcfg/zprofile | 11 + zcfg/zshenv | 10 + zcfg/zshrc | 42 ++ zsh.spec | 654 +++++++++++++++++++++ 45 files changed, 2649 insertions(+), 67 deletions(-) diff --git a/.gear/autobuild.update b/.gear/autobuild.update new file mode 100644 index 000000000..6ee89dac0 --- /dev/null +++ b/.gear/autobuild.update @@ -0,0 +1,5 @@ +#git fetch --tags git://zsh.git.sourceforge.net/gitroot/zsh/zsh && +git fetch --tags git://git.code.sf.net/p/zsh/code && +git merge zsh-$new_version && +gear-store-tags -ac && +new_source=%name-%version.tar diff --git a/.gear/autobuild.watch b/.gear/autobuild.watch new file mode 100644 index 000000000..0619593bc --- /dev/null +++ b/.gear/autobuild.watch @@ -0,0 +1,2 @@ +version=3 +https://github.com/zsh-users/zsh/releases (?:.*)/zsh-([\d.]+).tar.gz diff --git a/.gear/patches/47323-_rpmbuild-Complete-file-arguments-after-r-b-t.patch b/.gear/patches/47323-_rpmbuild-Complete-file-arguments-after-r-b-t.patch new file mode 100644 index 000000000..d1aaaf2e3 --- /dev/null +++ b/.gear/patches/47323-_rpmbuild-Complete-file-arguments-after-r-b-t.patch @@ -0,0 +1,25 @@ +From 787672949bcc9f332a958dbf29894c151ea85709 Mon Sep 17 00:00:00 2001 +From: Daniel Shahaf +Date: Tue, 18 Aug 2020 13:30:04 +0000 +Subject: [PATCH] 47323: _rpmbuild: Complete file arguments after -r/-b/-t. + +--- + Completion/Redhat/Command/_rpm | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Completion/Redhat/Command/_rpm b/Completion/Redhat/Command/_rpm +index e3469245f..db7c1145d 100644 +--- a/Completion/Redhat/Command/_rpm ++++ b/Completion/Redhat/Command/_rpm +@@ -282,7 +282,7 @@ _rpm () { + build_r) tmp=( '*:source package:_files -g "*.(#i)src.rpm(-.)"' ) ;| + build_t) tmp=( '*:tar file:_files -g "*.(#i)tar(.*|)(-.)"' ) ;| + build_?) +- _arguments -s -C $buildopts $commonopts $pathopts \ ++ _arguments -s -C $buildopts $commonopts $pathopts "${tmp[@]}" \ + ;; + checksig) + _arguments -s -C \!-K \ +-- +2.29.2 + diff --git a/.gear/patches/47867-promptinit-typo-RPOMPT-RPROMPT.patch b/.gear/patches/47867-promptinit-typo-RPOMPT-RPROMPT.patch new file mode 100644 index 000000000..6ede800b3 --- /dev/null +++ b/.gear/patches/47867-promptinit-typo-RPOMPT-RPROMPT.patch @@ -0,0 +1,34 @@ +From 145dbb4675be6826290bd0550cfc91c4c1851643 Mon Sep 17 00:00:00 2001 +From: Arseny Maslennikov +Date: Mon, 25 Jan 2021 11:16:24 +0300 +Subject: [PATCH 1/2] 47867: promptinit: typo: RPOMPT -> RPROMPT + +--- + Functions/Prompts/promptinit | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Functions/Prompts/promptinit b/Functions/Prompts/promptinit +index e27b8779a..5e42ebdd3 100644 +--- a/Functions/Prompts/promptinit ++++ b/Functions/Prompts/promptinit +@@ -49,7 +49,7 @@ prompt_preview_safely() { + + # This handles all the stuff from the default :prompt-theme cleanup + local +h PS1=$PS1 PS2=$PS2 PS3=$PS3 PS4=$PS4 RPS1=$RPS1 RPS2=$RPS2 +- local +h PROMPT=$PROMPT RPROMPT=$RPOMPT RPROMPT2=$RPROMPT2 PSVAR=$PSVAR ++ local +h PROMPT=$PROMPT RPROMPT=$RPROMPT RPROMPT2=$RPROMPT2 PSVAR=$PSVAR + local -a precmd_functions preexec_functions prompt_preview_cleanup + local -aLl +h zle_highlight + +@@ -101,7 +101,7 @@ Use prompt -h for help on specific themes.' + if [[ -z "$prompt_theme[1]" ]]; then + # Not using a prompt theme; save settings + local +h PS1=$PS1 PS2=$PS2 PS3=$PS3 PS4=$PS4 RPS1=$RPS1 RPS2=$RPS2 +- local +h PROMPT=$PROMPT RPROMPT=$RPOMPT RPROMPT2=$RPROMPT2 PSVAR=$PSVAR ++ local +h PROMPT=$PROMPT RPROMPT=$RPROMPT RPROMPT2=$RPROMPT2 PSVAR=$PSVAR + local -a precmd_functions preexec_functions + else + trap 'prompt_${prompt_theme[1]}_setup "${(@)prompt_theme[2,-1]}"' 0 +-- +2.29.2 + diff --git a/.gear/patches/47868-promptinit-Fix-prompt-cleanups.patch b/.gear/patches/47868-promptinit-Fix-prompt-cleanups.patch new file mode 100644 index 000000000..9a7c0e462 --- /dev/null +++ b/.gear/patches/47868-promptinit-Fix-prompt-cleanups.patch @@ -0,0 +1,182 @@ +From d4f48bf42b9057b5343c7ab52089d291fd540b07 Mon Sep 17 00:00:00 2001 +From: Arseny Maslennikov +Date: Mon, 25 Jan 2021 11:16:25 +0300 +Subject: [PATCH 2/2] 47868: promptinit: Fix prompt cleanups + +The Zsh documentation at Doc/Zsh/contrib, paragraph 26.6.4 "Writing +Themes", says: + +Declare cleanup + + If your function makes any other changes that should be undone when + the theme is disabled, your setup function may call + + prompt_cleanup command + + where command should be suitably quoted. If your theme is ever + disabled or replaced by another, command is executed with eval. You + may declare more than one such cleanup hook. + +The promptinit framework fails to apply cleanup commands of the current +theme on any theme change other than "prompt restore", as well as when +invoking setup functions of a certain $theme as an implementation detail +of `prompt -[hp] $theme'. + +This problem was previously brought up in zsh-users/23314, to no avail. + +We fix it in the following way, hopefully without breaking compatibility: +* Rename zstyle `cleanup' on the context `:prompt-theme' to `restore' + everywhere but in prompt_cleanup(). It is only used as a restore + mechanism now. +* Ensure prompt_cleanup() continues to store its command list in the + `cleanup' style. +* Clean up before theme switch at the end of set_prompt(). +* Prepend every use of prompt_*_setup (which might modify the shell + state in ways that require cleanup) with a cleanup run. +* Adjust `prompt restore' to do both parts of the newly split restore + mechanism, cleanup first. +--- + Functions/Prompts/prompt_restore_setup | 1 + + Functions/Prompts/promptinit | 43 ++++++++++++++++++-------- + 2 files changed, 31 insertions(+), 13 deletions(-) + +diff --git a/Functions/Prompts/prompt_restore_setup b/Functions/Prompts/prompt_restore_setup +index 54c4adbf9..b77dbe815 100644 +--- a/Functions/Prompts/prompt_restore_setup ++++ b/Functions/Prompts/prompt_restore_setup +@@ -1,2 +1,3 @@ + # Damn that was easy + zstyle -t :prompt-theme cleanup ++zstyle -t :prompt-theme restore +diff --git a/Functions/Prompts/promptinit b/Functions/Prompts/promptinit +index 5e42ebdd3..1c6d27ad7 100644 +--- a/Functions/Prompts/promptinit ++++ b/Functions/Prompts/promptinit +@@ -47,17 +47,19 @@ prompt_preview_safely() { + return + fi + +- # This handles all the stuff from the default :prompt-theme cleanup ++ # This handles all the stuff from the default :prompt-theme restore + local +h PS1=$PS1 PS2=$PS2 PS3=$PS3 PS4=$PS4 RPS1=$RPS1 RPS2=$RPS2 + local +h PROMPT=$PROMPT RPROMPT=$RPROMPT RPROMPT2=$RPROMPT2 PSVAR=$PSVAR +- local -a precmd_functions preexec_functions prompt_preview_cleanup ++ local -a precmd_functions preexec_functions prompt_preview_restore + local -aLl +h zle_highlight + + { + # Save and clear current restore-point if any +- zstyle -g prompt_preview_cleanup :prompt-theme cleanup ++ zstyle -g prompt_preview_restore :prompt-theme restore + { +- zstyle -d :prompt-theme cleanup ++ zstyle -d :prompt-theme restore ++ # Execute current cleanup sequence, if any. ++ zstyle -t :prompt-theme cleanup + + # The next line is a bit ugly. It (perhaps unnecessarily) + # runs the prompt theme setup function to ensure that if +@@ -74,8 +76,8 @@ prompt_preview_safely() { + zstyle -t :prompt-theme cleanup + } + } always { +- (( $#prompt_preview_cleanup )) && +- zstyle -e :prompt-theme cleanup "${prompt_preview_cleanup[@]}" ++ (( $#prompt_preview_restore )) && ++ zstyle -e :prompt-theme restore "${prompt_preview_restore[@]}" + } + } + +@@ -104,7 +106,7 @@ Use prompt -h for help on specific themes.' + local +h PROMPT=$PROMPT RPROMPT=$RPROMPT RPROMPT2=$RPROMPT2 PSVAR=$PSVAR + local -a precmd_functions preexec_functions + else +- trap 'prompt_${prompt_theme[1]}_setup "${(@)prompt_theme[2,-1]}"' 0 ++ trap 'zstyle -t :prompt-theme cleanup; prompt_${prompt_theme[1]}_setup "${(@)prompt_theme[2,-1]}"' 0 + fi + ;; + esac +@@ -123,6 +125,7 @@ Use prompt -h for help on specific themes.' + # The next line is a bit ugly. It (perhaps unnecessarily) + # runs the prompt theme setup function to ensure that if + # the theme has a _help function that it's been autoloaded. ++ zstyle -t :prompt-theme cleanup + prompt_$2_setup + fi + if functions prompt_$2_help >/dev/null; then +@@ -179,28 +182,41 @@ Use prompt -h for help on specific themes.' + typeset -ga zle_highlight=( ${zle_highlight:#default:*} ) + (( ${#zle_highlight} )) || unset zle_highlight + ++ zstyle -t :prompt-theme cleanup + prompt_$1_setup "$@[2,-1]" && prompt_theme=( "$@" ) + ;; + esac + } + + prompt_cleanup () { +- local -a cleanup_hooks ++ local -a cleanup_hooks theme_active + if zstyle -g cleanup_hooks :prompt-theme cleanup + then + cleanup_hooks+=(';' "$@") + zstyle -e :prompt-theme cleanup "${cleanup_hooks[@]}" +- elif (( $+prompt_preview_cleanup == 0 )) ++ return 0 ++ fi ++ ++ (( $+prompt_preview_restore == 0 )) && ++ if ! zstyle -g theme_active :prompt-theme restore + then + print -u2 "prompt_cleanup: no prompt theme active" + return 1 + fi ++ ++ # Set the cleanup sequence up. ++ zstyle -e :prompt-theme cleanup \ ++ 'zstyle -d :prompt-theme cleanup;' \ ++ 'reply=(yes)' ++ ++ # Will add the hook this time. ++ prompt_cleanup "$@" + } + + prompt () { + local -a prompt_opts theme_active + +- zstyle -g theme_active :prompt-theme cleanup || { ++ zstyle -g theme_active :prompt-theme restore || { + # This is done here rather than in set_prompt so that it + # is safe and sane for set_prompt to setopt localoptions, + # which will be cleared before we arrive back here again. +@@ -210,8 +226,8 @@ prompt () { + [[ -o promptpercent ]] && prompt_opts+=(percent) + [[ -o promptsp ]] && prompt_opts+=(sp) + [[ -o promptsubst ]] && prompt_opts+=(subst) +- zstyle -e :prompt-theme cleanup \ +- 'zstyle -d :prompt-theme cleanup;' \ ++ zstyle -e :prompt-theme restore \ ++ 'zstyle -d :prompt-theme restore;' \ + 'prompt_default_setup;' \ + ${PS1+PS1="${(q)PS1}"} \ + ${PS2+PS2="${(q)PS2}"} \ +@@ -239,7 +255,7 @@ prompt_preview_theme () { + emulate -L zsh + + # Check for proper state handling +- (( $+prompt_preview_cleanup )) || { ++ (( $+prompt_preview_restore )) || { + prompt_preview_safely "$@" + return + } +@@ -249,6 +265,7 @@ prompt_preview_theme () { + print -n "$1 theme" + (( $#* > 1 )) && print -n " with parameters \`$*[2,-1]'" + print ":" ++ zstyle -t :prompt-theme cleanup + prompt_${1}_setup "$@[2,-1]" + (( ${#prompt_opts} )) && + setopt noprompt{bang,cr,percent,sp,subst} "prompt${^prompt_opts[@]}" +-- +2.29.2 + diff --git a/.gear/patches/47918-completions-for-nsenter-and-unshare.patch b/.gear/patches/47918-completions-for-nsenter-and-unshare.patch new file mode 100644 index 000000000..417a45241 --- /dev/null +++ b/.gear/patches/47918-completions-for-nsenter-and-unshare.patch @@ -0,0 +1,103 @@ +From 3364ecbd28371d382fcddeccc4755ab604eacdeb Mon Sep 17 00:00:00 2001 +From: Oliver Kiddle +Date: Sat, 6 Feb 2021 00:01:15 +0100 +Subject: [PATCH] PATCH: completions for nsenter and unshare + +These are a couple more util-linux commands for which we lacked a +completion. Maybe not the most widely used ones but I kept trying -p +instead of -t on nsenter and completing the commands is also useful. +I made unshare fallback to _default on a non-Linux system because an +unrelated unshare command exists on some systems, e.g. Solaris for +un-sharing NFS exports. + +Oliver +--- + Completion/Linux/Command/_nsenter | 28 ++++++++++++++++++++++ + Completion/Linux/Command/_unshare | 40 +++++++++++++++++++++++++++++++ + 2 files changed, 68 insertions(+) + create mode 100644 Completion/Linux/Command/_nsenter + create mode 100644 Completion/Linux/Command/_unshare + +diff --git a/Completion/Linux/Command/_nsenter b/Completion/Linux/Command/_nsenter +new file mode 100644 +index 000000000..8e7c6bc42 +--- /dev/null ++++ b/Completion/Linux/Command/_nsenter +@@ -0,0 +1,28 @@ ++#compdef nsenter ++ ++local ign ++(( $#words > 2 )) && ign='!' ++ ++_arguments -S -s \ ++ '(-a --all)'{-a,--all}'[enter all namespaces]' \ ++ '(-t --target)'{-t+,--target=}'[specify target process to get namespaces from]:pid:_pids' \ ++ '(-m --mount)'{-m-,--mount=-}'[enter mount namespace]::file:_files' \ ++ '(-u --uts)'{-u-,--uts=-}'[enter UTS namespace (hostname etc)]::file:_files' \ ++ '(-i --ipc)'{-i-,--ipc=-}'[enter System V IPC namespace]::file:_files' \ ++ '(-n --net)'{-n-,--net=-}'[enter network namespace]::file:_files' \ ++ '(-p --pid)'{-p-,--pid=-}'[enter pid namespace]::file:_files' \ ++ '(-C --cgroup)'{-C-,--cgroup=-}'[enter cgroup namespace]::file:_files' \ ++ '(-U --user)'{-U-,--user=-}'[enter user namespace]::file:_files' \ ++ '(-T --time)'{-T-,--time=-}'[enter time namespace]::file:_files' \ ++ '(-S --setuid)'{-S+,--setuid=}'[set uid in entered namespace]:uid [0]' \ ++ '(-G --setgid)'{-G+,--setgid=}'[set gid in entered namespace]:gid [0]' \ ++ "--preserve-credentials[don't touch uids or gids]" \ ++ '(-r --root)'{-r+,--root=}'[set the root directory]:directory:_directories' \ ++ '(-w --wd)'{-w+,--wd=}'[set the working directory]:directory:_directories' \ ++ '(-F --no-fork)'{-F,--no-fork}"[don't fork]" \ ++ '(-Z --follow-context)'{-Z,--follow-context}'[set SELinux context according to --target PID]' \ ++ "${ign}(- 1 *)"{-h,--help}'[display usage information]' \ ++ "${ign}(- 1 *)"{-V,--version}'[display version information]' \ ++ '1: : _command_names -e' \ ++ '*::args :_normal' ++ +diff --git a/Completion/Linux/Command/_unshare b/Completion/Linux/Command/_unshare +new file mode 100644 +index 000000000..ff6f7042f +--- /dev/null ++++ b/Completion/Linux/Command/_unshare +@@ -0,0 +1,40 @@ ++#compdef unshare ++ ++local ign ++(( $#words > 2 )) && ign='!' ++ ++# a different unshare exists on some systems ++if [[ $OSTYPE != linux* ]]; then ++ _default ++ return ++fi ++ ++_arguments -S -s \ ++ '(-m --mount)'{-m-,--mount=-}'[enter mount namespace]::file:_files' \ ++ '(-u --uts)'{-u-,--uts=-}'[enter UTS namespace (hostname etc)]::file:_files' \ ++ '(-i --ipc)'{-i-,--ipc=-}'[enter System V IPC namespace]::file:_files' \ ++ '(-n --net)'{-n-,--net=-}'[enter network namespace]::file:_files' \ ++ '(-p --pid)'{-p-,--pid=-}'[enter pid namespace]::file:_files' \ ++ '(-U --user)'{-U-,--user=-}'[enter user namespace]::file:_files' \ ++ '(-C --cgroup)'{-C-,--cgroup=-}'[enter cgroup namespace]::file:_files' \ ++ '(-T --time)'{-T-,--time=-}'[enter time namespace]::file:_files' \ ++ '(-f --fork)'{-f,--fork}"[fork before launching]" \ ++ '(-r --map-root-user)--map-user=[map current user to uid (implies --user)]:user:_users' \ ++ '--map-group=[map current group to gid (implies --user)]:group:_groups' \ ++ '(-r --map-root-user -c --map-current-user --map-user)'{-r,--map-root-user}'[map current user to root (implies --user)]' \ ++ '(-c --map-current-user)'{-c,--map-current-user}'[map current user to itself (implies --user)]' \ ++ '(-f --fork)--kill-child=-[when dying, kill the forked child (implies --fork)]::signal [KILL]:_signals' \ ++ '--mount-proc=-[mount proc filesystem first (implies --mount)]::mount point [/proc]:_directories' \ ++ '--propagation=[modify mount propagation in mount namespace]:propagation flag:(slave shared private unchanged)' \ ++ '--setgroups=[control the setgroups syscall in user namespaces]:grant setgroups:(allow deny)' \ ++ '--keep-caps[retain capabilities granted in user namespaces]' \ ++ '(-R --root)'{-R+,--root=}'[set the root directory]:directory:_directories' \ ++ '(-w --wd)'{-w+,--wd=}'[set the working directory]:directory:_directories' \ ++ '(-S --setuid)'{-S+,--setuid=}'[set uid in entered namespace]:uid [0]' \ ++ '(-G --setgid)'{-G+,--setgid=}'[set gid in entered namespace]:gid [0]' \ ++ '--monotonic=[set clock monotonic offset in time namespaces]:offset (seconds)' \ ++ '--boottime=[set clock boottime offset in time namespaces]:offset (seconds)' \ ++ "${ign}(- 1 *)"{-h,--help}'[display usage information]' \ ++ "${ign}(- 1 *)"{-V,--version}'[display version information]' \ ++ '1: : _command_names -e' \ ++ '*::args :_normal' +-- +2.29.2 + diff --git a/.gear/patches/alt-packaging-0001-compaudit-fix-zsh-executable-discovery-if-proc-missing.patch b/.gear/patches/alt-packaging-0001-compaudit-fix-zsh-executable-discovery-if-proc-missing.patch new file mode 100644 index 000000000..cab5ea334 --- /dev/null +++ b/.gear/patches/alt-packaging-0001-compaudit-fix-zsh-executable-discovery-if-proc-missing.patch @@ -0,0 +1,27 @@ +From 2e360340ce16219bd76e2e528f51a27c9b9d035b Mon Sep 17 00:00:00 2001 +From: Arseny Maslennikov +Date: Sun, 28 Feb 2021 21:49:01 +0300 +Subject: [PATCH] Completion/compaudit: fix zsh executable discovery if /proc + missing + +@packaged_zsh_executable@ is replaced with a real file during the +package build process. +--- + Completion/compaudit | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Completion/compaudit b/Completion/compaudit +index 93a043124..6a3b0e497 100644 +--- a/Completion/compaudit ++++ b/Completion/compaudit +@@ -94,6 +94,7 @@ local -a _i_exes + _i_exes=( + /proc/$$/exe + /proc/$$/object/a.out ++ @packaged_zsh_executable@ + ) + local _i_exe + +-- +2.29.2 + diff --git a/.gear/patches/alt-rpm-0001-_rpm-complete-q-lastchange.patch b/.gear/patches/alt-rpm-0001-_rpm-complete-q-lastchange.patch new file mode 100644 index 000000000..3fcd996d0 --- /dev/null +++ b/.gear/patches/alt-rpm-0001-_rpm-complete-q-lastchange.patch @@ -0,0 +1,24 @@ +From 042ec87ebb0fc610205f60dd46b21b9a4f8f43b0 Mon Sep 17 00:00:00 2001 +From: Arseny Maslennikov +Date: Tue, 2 Nov 2021 00:01:35 +0300 +Subject: [PATCH] _rpm: complete -q --lastchange + +--- + Completion/Redhat/Command/_rpm | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Completion/Redhat/Command/_rpm b/Completion/Redhat/Command/_rpm +index e3469245f..41aafe74c 100644 +--- a/Completion/Redhat/Command/_rpm ++++ b/Completion/Redhat/Command/_rpm +@@ -227,6 +227,7 @@ _rpm () { + '(-i --info)'{-i,--info}'[display package information]' \ + '--changelog' '--changes' '--dupes' \ + '--last[order packages by install time]' \ ++ '--lastchange[(ALT specific) display last changelog entry]' \ + '--xml' \ + '--recommends[list capabilities recommended by packages]' \ + '(--requires)-R[list capabilities on which packages depend]' \ +-- +2.33.0 + diff --git a/.gear/rules b/.gear/rules new file mode 100644 index 000000000..ef9ee1923 --- /dev/null +++ b/.gear/rules @@ -0,0 +1,3 @@ +tar: zsh-@version@:. name=zsh-@version@ +diff: zsh-@version@:. . +copy: .gear/patches/* diff --git a/.gear/tags/d165b4864d736d67a39d0c738132b501f8d4aae4 b/.gear/tags/d165b4864d736d67a39d0c738132b501f8d4aae4 new file mode 100644 index 000000000..f14dd24db --- /dev/null +++ b/.gear/tags/d165b4864d736d67a39d0c738132b501f8d4aae4 @@ -0,0 +1,17 @@ +object 1a490c7050cfacd5daf8376d5a1f0e8cb14ccda5 +type commit +tag zsh-5.8.1 +tagger dana 1644673178 -0600 + +Release 5.8.1 +-----BEGIN PGP SIGNATURE----- + +iQEzBAABCAAdFiEEfKfsqvBiFrkPiUFGrPgUbK6Mu8QFAmIHuJoACgkQrPgUbK6M +u8RB1wf+P7lzXkuRKKQEnn+GY6w2u/VJgjnH+112/fj/7EMMtXXsE/t6GqWB8WYq +4kBEIGJhxBLwJWWdiJEHFM8YEw1BiRCBmnojS7tNJy6dPLnx1hp5vnhrBuefDLBI +Y/pGF4Dh/VGHVNMrnIWnrZiRHPfTY/nlsmJL0+xorfNsHv408B+4YCBV74H5WR9H +B6/PgRe8O96ZX48I+jhHudTLIeLFrvJC1Te9NLiXdXaDZY6vElLEO0irRWJGzJRc +0maA6p4K99O6y0/WGunYnmiZN/LxgHIsvVn5ZtnAHQvSo53CQ03rve3w8T9vwJY9 +1wWJ8C4++bDd9iL12G2FCC43i3kkNw== +=/IkB +-----END PGP SIGNATURE----- diff --git a/.gear/tags/list b/.gear/tags/list new file mode 100644 index 000000000..44288594c --- /dev/null +++ b/.gear/tags/list @@ -0,0 +1 @@ +d165b4864d736d67a39d0c738132b501f8d4aae4 zsh-5.8.1 diff --git a/Completion/ALT/.distfiles b/Completion/ALT/.distfiles new file mode 100644 index 000000000..9e276f99b --- /dev/null +++ b/Completion/ALT/.distfiles @@ -0,0 +1,3 @@ +DISTFILES_SRC=' +.distfiles +' diff --git a/Completion/ALT/Command/.distfiles b/Completion/ALT/Command/.distfiles new file mode 100644 index 000000000..b7b8d3a30 --- /dev/null +++ b/Completion/ALT/Command/.distfiles @@ -0,0 +1,12 @@ +DISTFILES_SRC=' +.distfiles +_add_changelog +_buildreq +_control +_control_d +_gear +_girar +_girar_remote +_hasher +_sisyphus_check +' diff --git a/Completion/ALT/Command/_add_changelog b/Completion/ALT/Command/_add_changelog new file mode 100644 index 000000000..8eb22023d --- /dev/null +++ b/Completion/ALT/Command/_add_changelog @@ -0,0 +1,14 @@ +#compdef add_changelog + +local curcontext="$curcontext" context state line ret=1 + +_arguments -S \ + '(- :)'{-h,--help}'[show usage and exit]' \ + '(-r --rpm)'{-r,--rpm}'=[path to RPM]:rpm:_files -g "*(-*)"' \ + '(-s --stamper)'{-s,--stamper}'=[path to STAMPER]:stamper:_files -g "*(-*)"' \ + '*'{-a,--args}'=[additional arguments for RPM]:rpm args' \ + '(-e --entry)'{-e,--entry}'=[changelog entry text]:changelog entry' \ + '--nocheck[do not check specfile versions]' \ + '*:spec:_files -g "*.spec"' && ret=0 + +return $ret diff --git a/Completion/ALT/Command/_buildreq b/Completion/ALT/Command/_buildreq new file mode 100644 index 000000000..4b4c9200d --- /dev/null +++ b/Completion/ALT/Command/_buildreq @@ -0,0 +1,19 @@ +#compdef buildreq + +local curcontext="$curcontext" context state line ret=1 + +_arguments -S \ + '(- :)'{-h,--help}'[show usage and exit]' \ + '(-e --essential)'{-e,--essential=}'[file with list of essential packages]:file:_files' \ + '(-i --ignore)'{-i,--ignore=}'[file with list of packages to ignore]:file:_files' \ + '(-f --filereq)'{-f,--filereq=}'[path to FILEREQ]:filereq:_files -g "*(-*)"' \ + '(-p --packagereq)'{-p,--packagereq=}'[path to PACKAGEREQ]:packagereq:_files -g "*(-*)"' \ + '(-r --rpm)'{-r,--rpm=}'[path to RPM]:rpm:_files -g "*(-*)"' \ + '-b-[RPM build stage]:stage:((p\:"%prep" c\:"%build" i\:"%install"))' \ + '(--reset-args)*--args=[additional arguments for RPM]:rpm args' \ + '(--reset-args)*--define=[define RPM macro]:macro definition' \ + '--reset-args[reset arguments list for RPM]' \ + '(-t --term)'{-t,--term=}'[redefine TERM variable]:terminal:_terminals' \ + '*:spec:_files -g "*.spec"' && ret=0 + +return $ret diff --git a/Completion/ALT/Command/_control b/Completion/ALT/Command/_control new file mode 100644 index 000000000..80b4d73ae --- /dev/null +++ b/Completion/ALT/Command/_control @@ -0,0 +1,29 @@ +#compdef control + +local expl verbose + +verbose= +zstyle -t ":completion:${curcontext}:facilities" verbose && + verbose=1 + +__control_facilities() +{ + local i + local -a facilities + facilities=() + + if [[ -n "$verbose" ]]; then + for i in /etc/control.d/facilities/*~*(.rpm*|.orig|~)(-*:t); do + facilities+=( "$i:$(/etc/control.d/facilities/$i summary 2>/dev/null)" ) + done + facilities=( "${(@)${(@)facilities/:[[:space:]]##/:}%:[[:space:]]#}" ) + _describe -t control-facilities 'control facility' facilities "$@" + else + _wanted control-facilities expl 'control facility' compadd "$@" - /etc/control.d/facilities/*~*(.rpm*|.orig|~)(-*:t) + fi +} + +_arguments -s \ + ':facility:__control_facilities' \ + '*::status: _control_d' + diff --git a/Completion/ALT/Command/_control_d b/Completion/ALT/Command/_control_d new file mode 100644 index 000000000..0cd47dd93 --- /dev/null +++ b/Completion/ALT/Command/_control_d @@ -0,0 +1,21 @@ +#compdef -p */control.d/facilities/* + +local script + +_compskip=all + +script=$words[1] +[[ $script = */* ]] || script=/etc/control.d/facilities/$script + +local -a modes +modes=( + 'help:Describe available modes' + 'list:List available modes' + 'status:Show current status' + 'summary:Show facility description' +) + +modes+=( "${(f)$($script help 2>/dev/null)}" ) +modes=( "${(@)${(@)modes/:[[:space:]]##/:}%:[[:space:]]#}" ) + +_describe -t control-modes 'control mode' modes "$@" diff --git a/Completion/ALT/Command/_gear b/Completion/ALT/Command/_gear new file mode 100644 index 000000000..48720136d --- /dev/null +++ b/Completion/ALT/Command/_gear @@ -0,0 +1,183 @@ +#compdef gear gear-commit gear-srpmimport gear-update gear-import gear-update-tag gear-merge gear-changelog gear-hsh gear-buildreq gear-rpm + +local curcontext="$curcontext" context state line ret=1 +typeset -A opt_args + +local -a opts_help +opts_help=( + '(-v --verbose -q --quiet)'{-q,--quiet}'[try to be more quiet]' + '(-v --verbose -q --quiet)'{-v,--verbose}'[print a message for each action]' + '(- :)'{-V,--version}'[print program version and exit]' + '(- :)'{-h,--help}'[show usage and exit]' +) + +local -a opts_gear +opts_gear=( + '(-r --rules)'{-r,--rules=}'[name of file with rules]:rules file:_files' + '(-t --tree-ish --commit)'{-t,--tree-ish=}'[tree, commit or tag object name]:tree-ish' + '(-t --tree-ish --commit)--commit[make temporary commit prior to extract]' +) + +local -a opts_gear_compress +opts_gear_compress=( + '(--rpmbuild --export-dir --describe --no-compress --bzip2 --gzip)--no-compress[do not compress output archive]' + '(--rpmbuild --export-dir --describe --no-compress --bzip2 --gzip)--bzip2[compress output archive using bzip2]' + '(--rpmbuild --export-dir --describe --no-compress --bzip2 --gzip)--gzip[compress output archive using gzip]' +) + +local -a opts_gear_update_spec +opts_gear_update_spec=( + '--update-spec[change specfile in repository if specfile changed]' +) + +case "$service" in +(gear) + local -a args + args=(':output tarball:_files') + if (( $words[(I)--(rpmbuild|hasher|command)] )); then + args=($opts_gear_update_spec + '(-):command: _command_names -e' + '*::args: _normal') + elif (( $words[(I)(--export-dir|--describe)] )); then + args=() + fi + + _arguments -S \ + $opts_help \ + $opts_gear \ + $opts_gear_compress \ + '(--rpmbuild --hasher --command --export-dir --describe --no-compress --bzip2 --gzip :)--export-dir=[write source files to specified directory]:directory:_directories' \ + '(--rpmbuild --hasher --command --export-dir --describe)--hasher[execute hsh-like command afterwards]' \ + '(--rpmbuild --hasher --command --export-dir --describe --no-compress --bzip2 --gzip)--rpmbuild[execute rpmbuild-like command afterwards]' \ + '(--rpmbuild --hasher --command --export-dir --describe)--command[execute arbitrary command afterwards]' \ + '(--rpmbuild --hasher --command --export-dir --no-compress --bzip2 --gzip)--describe[describe package as \"%{NAME} %{VERSION} %{RELEASE}\"]' \ + $args && ret=0 + ;; +(gear-commit) + curcontext="${curcontext%:*:*}:git-commit:" + service=git-commit + _arguments -S \ + '--spec=[spec file]:spec file:_files -g "*.spec(-.)"' \ + '*:git-commit option: _git' && ret=0 + ;; +(gear-srpmimport) + _arguments -S \ + $opts_help \ + '--branch=[branch name where to import]:branch' \ + '--import-only[do not perform a checkout after importing]' \ + '--no-untar[do not unpack source tarballs]' \ + '--rules=[name of file with rules]:rules file:_files' \ + '--spec-pattern=[specfile pattern list]:specfile pattern' \ + '(:)--stdin[read source package names from stdin]' \ + '(-)*:source package:_files -g "*.src.rpm"' && ret=0 + ;; +(gear-update) + _arguments -S \ + $opts_help \ + '--exclude=[exclude files matching posix-egrep regular expression]:pattern' \ + '--ignore-exclude[ignore .gitignore and .git/info/exclude]' \ + '(-a --all)'{-a,--all}'[extract all files and directories from archive]' \ + '(-c --create)'{-c,--create}'[create the before unpacking the ]' \ + '(-s --subdir)'{-s,--subdir=}'[extract specified directory name from archive]:directory' \ + '(-t --type)'{-t,--type=}'[define source type]:source type:(dir tar cpio cpio.gz cpio.bz2 zip)' \ + '(-f --force)'{-f,--force}'[remove files from even if untracked or modified files found]' \ + ':source:_files' \ + ':dst-directory:_directories' && ret=0 + ;; +(gear-import) + _arguments -S \ + $opts_help \ + '(-c --commit -t --tag -T --tag-message -s --sign --no-commit --no-tag --dry-run)--dry-run[show parser results and exit]' \ + '(-c --commit -t --tag -T --tag-message -s --sign --no-commit --no-tag --dry-run)--no-commit[do not commit new changes]' \ + '(-t --tag -T --tag-message --no-tag --dry-run)--no-tag[do not add tag]' \ + '--time=[use time described by STR or referenced by FILE]:time string of file:->time-or-file' \ + '--ignore-exclude[pass --ignore-exclude to gear-update]' \ + '(-C --create)'{-C,--create}'[pass --create to gear-update]' \ + '(-f --force)'{-f,--force}'[pass --force to gear-update]' \ + '(--no-commit --dry-run)'{-s,--sign}'[add sign to commit and tag]' \ + '(-S --subdir)'{-S,--subdir=}'[unpack archives into DIR]:directory:_directories' \ + '(--dry-run --no-commit -c --commit)'{-c,--commit}'[use MSG as commit message]:message' \ + '(--dry-run --no-commit --no-tag -t --tag)'{-t,--tag=}'[use NAME as tag name]:tag name' \ + '(--dry-run --no-commit --no-tag -T --tag-message)'{-T,--tag-message=}'[use MSG as tag message]:tag message' \ + '(-r --rules)'{-r,--rules=}'[override import rules file name]:rules file:_files' \ + '*:archive:_files' && ret=0 + ;; +(gear-update-tag) + _arguments -S \ + $opts_help \ + '(-a --all :)'{-a,--all}'[update all tags used in rules]' \ + '(-c --clean --no-clean :)'{-c,--clean}'[delete tags not used in rules]' \ + '(-c --clean --no-clean)--no-clean[]' \ + '(-d --delete :)'{-d,--delete}'[delete the specified tag]:tag name' \ + '(:)--verify[verify all tags used in rules]' \ + '(-r --rules)'{-r,--rules}'[override rules file name]:rules file:_files' \ + '(-):tag name' \ + '(-):tag value' && ret=0 + ;; +(gear-merge) + _arguments -S \ + $opts_help \ + '(-I --no-interactive)'{-I,--no-interactive}'[merge branches non-interactively]' \ + '(-a --add)'{-a,--add}'[add new patches in git repository]' \ + '(-r --rules)'{-r,--rules}'=[name of file with rules]:rules file:_files' \ + '(-s --stop -I --no-interactive)'{-s,--stop}'=[stop merge when BRANCH shows in ]:branch name' \ + '--ignore-changed[do not bail if index changed]' \ + '--ignore-untracked[do not bail if untracked or modified files found]' && ret=0 + ;; +(gear-changelog) + _arguments -S \ + $opts_help \ + '(-r --rules --no-rules)'{-r,--rules}'=[name of a rules file]:rules file:_files' \ + '(-r --rules)--no-rules[do not use rules, write entries without aggregation]' \ + '--no-groups[do not group entries]' \ + '--no-specfile[do not use information from specfile]' \ + '(-f --format)'{-f,--format}'[changelog output format]:format:(rpm gnu deb)' && ret=0 + ;; +(gear-hsh) + _arguments \ + $opts_help \ + $opts_gear \ + $opts_gear_update_spec \ + '*:hasher option:->hasher' && ret=0 + ;; +(gear-buildreq) + _arguments \ + $opts_help \ + $opts_gear \ + $opts_gear_update_spec \ + '*:buildreq option:->buildreq' && ret=0 + ;; +(gear-rpm) + _arguments \ + $opts_help \ + $opts_gear \ + $opts_gear_update_spec \ + '*:rpmbuild option:->rpmbuild' && ret=0 + ;; +esac + +case $state in +(hasher) + curcontext="${curcontext%:*:*}:hsh:" + service=hsh + _call_function ret _hasher + ;; +(buildreq) + curcontext="${curcontext%:*:*}:buildreq:" + service=buildreq + _call_function ret _buildreq + ;; +(rpmbuild) + curcontext="${curcontext%:*:*}:rpmbuild:" + service=rpmb + _call_function ret _rpm + ;; +(time-or-file) + _alternative \ + 'time-string:time string: ' \ + 'files:file:_files' && ret=0 + ;; +esac + +return $ret +# vim: set ft=zsh ts=4 sw=4 sts=4 : diff --git a/Completion/ALT/Command/_girar b/Completion/ALT/Command/_girar new file mode 100644 index 000000000..9b3ae22c9 --- /dev/null +++ b/Completion/ALT/Command/_girar @@ -0,0 +1,40 @@ +#compdef girar-clone girar-import girar-upload + +local curcontext="$curcontext" context state line ret=1 +typeset -A opt_args + +local -a common_opts +common_opts=( + '(-R --remote)'{-R,--remote=}'[girar remote name]:girar remote:_hosts' + '(-v --verbose -q --quiet)'{-q,--quiet}'[try to be more quiet]' + '(-v --verbose -q --quiet)'{-v,--verbose}'[print a message for each action]' + '(- :)'{-V,--version}'[print program version and exit]' + '(- :)'{-h,--help}'[show usage and exit]' +) + +case "$service" in +(girar-clone) + _arguments -S \ + $common_opts \ + ':user:_girar_info users' \ + ':repository:_girar_info directories "/people/${${words[((CURRENT-1))]}%%,*}/"' && ret=0 + ;; +(girar-import) + _arguments -S \ + $common_opts \ + '(-u --update)'{-u,--update}'[update into current repository]' \ + '(-G --gears -S --srpms)'{-G,--gears}'[only try /gears/ hierarchy]' \ + '(-G --gears -S --srpms)'{-S,--srpms}'[only try /srpms/ hierarchy]' \ + ':repository:_girar_info binary-repositories' \ + ':package:_rpm_packages avail' && ret=0 + ;; +(girar-upload) + _arguments -S \ + $common_opts \ + '(-o --origin)'{-o,--origin=}'[git remote name]:git remote' \ + ':repository:' \ + '*:refspec:' && ret=0 + ;; +esac + +return ret diff --git a/Completion/ALT/Command/_girar_remote b/Completion/ALT/Command/_girar_remote new file mode 100644 index 000000000..06e431f74 --- /dev/null +++ b/Completion/ALT/Command/_girar_remote @@ -0,0 +1,278 @@ +#compdef girar-remote + +local -a args reply +args=( + # Command word. Don't care what that is. + /$'[^\0]#\0'/ +) + +local -a charset_args +charset_args=( + /$'[^\0]#\0'/ ':git-repository:path to git repository:_girar_info directories' + /$'[^\0]#\0'/ ':character-set:charset:' +) + +local -a clone_args +clone_args=( + /$'[^\0]#\0'/ ':git-repository:source git repository:_girar_info directories' + /$'[^\0]#\0'/ ':git-directory:destination directory:_girar_info directories' +) + +local -a default_branch_args +default_branch_args=( + /$'[^\0]#\0'/ ':git-repository:git repository:_girar_info directories' + /$'[^\0]#\0'/ ':repository-branch:repository branch:_girar_info repository-branches "${words[((CURRENT-1))]}"' +) + +local -a find_package_args +find_package_args=( + /$'[^\0]#\0'/ ':pattern:search pattern:' +) + +local -a init_db_args +init_db_args=( + /$'((packages|private|public)/)#[A-Za-z0-9][-A-Za-z0-9_.]##\0'/ ':repository-name:repository name:' +) + +local -a ls_args +ls_args=( + /$'[^\0]#\0'/ ':git-directory:girar directory:_girar_info directories' +) + +local -a mv_db_args +mv_db_args=( + /$'[^\0]#\0'/ ':git-repository:source git repository:_girar_info directories' + /$'[^\0]#\0'/ ':git-directory:destination directory:_girar_info directories' +) + +local -a rm_db_args +rm_db_args=( + /$'[^\0]#\0'/ ':git-repository:git repository:_girar_info directories' +) + +local -a login_arg +login_arg=( + /$'[a-z_0-9]##\0'/ ':users:maintainer:_girar_info user' +) + +local -a binary_repo_arg +binary_repo_arg=( + /$'[^\0]#\0'/ ':binary-repository:binary repository:_girar_info binary-repositories' +) + +local -a state_args +state_args=( + /$'(awaiting|building|committing|done|failed|new|pending|tested|ALL)\0'/ + ':state:state:(awaiting building committing done failed new pending tested ALL)' +) + +local -a ALL_arg +ALL_arg=( + /$'ALL\0'/ ':ALL:ALL:(ALL)' +) + +local -a task_ls_args +_regex_words \ + task-ls-args "task ls argument" \ + '--repo:binary repository name:\( $binary_repo_arg \| $ALL_arg \)' \ + '--state:task state:$state_args' \ + '--user:task owner:\( $login_arg \| $ALL_arg \)' +task_ls_args=( "$reply[@]" '#' ) + +local -a task_id_arg +task_id_arg=( + /$'[[:digit:]]##\0'/ ':task-id:task id:_girar_info tasks' +) + +local -a task_any_id_arg +task_any_id_arg=( + /$'[[:digit:]]##\0'/ ':task-id:task id:_girar_info all-tasks' +) + +local -a repo_tag_args +repo_tag_args=( + /$'[A-Za-z0-9][-A-Za-z0-9_.]##\0'/ ':package-repository:package repository:_girar_info package-repositories' + /$'[^\0]##-alt[^\0]##\0'/ ':package-tag:package tag:_girar_info package-tags "${words[((CURRENT-1))]}"' +) + +local -a source_rpm_arg +source_rpm_arg=( + /$'[^\0]##.src.rpm\0'/ ':source-rpm:source rpm:_girar_info srpms' +) + +local -a package_name_arg +package_name_arg=( + /$'[^@\0]##\0'/ ':package-name:package name:' +) + +local -a group_name_arg +group_name_arg=( + /$'@[a-z_0-9]##\0'/ ':group-id:group name:' +) + +local -a task_subtask_id_arg +task_subtask_id_arg=( + /$'[[:digit:]]##\0'/ ':subtask-id:subtask id:_girar_info subtasks "$words[((CURRENT-1))]"' +) + +local -a task_add_subcmd +_regex_words \ + task-add-commands "task add command" \ + 'repo:build from git repository:$repo_tag_args' \ + 'srpm:build source rpm:$source_rpm_arg' \ + 'del:delete package:$package_name_arg' \ + 'copy:copy from another repository:$package_name_arg $binary_repo_arg' +task_add_subcmd=( '(' $task_id_arg '(' $task_subtask_id_arg '|' ')' '|' ')' "$reply[@]") + +local -a task_deps_subcmd +_regex_words \ + task-deps-comands "task deps command" \ + 'show:show deps' \ + 'clear:clear deps' \ + 'add:add deps:\( $task_any_id_arg \) \#' \ + 'del:del deps:\( $task_any_id_arg \) \#' \ + 'set:set deps:\( $task_any_id_arg \) \#' +task_deps_subcmd=( '(' $task_id_arg '|' ')' "$reply[@]" ) + +local -a task_share_args +_regex_words \ + task-share-command "task share command" \ + 'status:show status' \ + 'enabled:share task' \ + 'disabled:unshare task' +task_share_args=( + '(' $task_id_arg '|' ')' + "$reply[@]" +) + +local -a disable_arg +disable_arg=( + /$'disable\0'/ ':disable:disable:(disable)' +) + +local -a commit_sha_arg +commit_sha_arg=( + /$'[^@\0]##\0'/ ':commit:commit sha:' +) + +local -a task_commands +_regex_words \ + task-commands "task command" \ + 'ls:list tasks:$task_ls_args' \ + 'show:show task:\( $task_any_id_arg \| \)' \ + 'new:new task:$binary_repo_arg' \ + 'add:add subtask:$task_add_subcmd' \ + 'delsub:delete subtask:$task_id_arg $task_subtask_id_arg' \ + 'deps:task dependencies:$task_deps_subcmd' \ + 'run:run task:\( $task_id_arg \| \)' \ + 'share:share task:$task_share_args' \ + 'approve:approve subtask:$task_any_id_arg $task_subtask_id_arg' \ + 'rm:delete task:\( $task_id_arg \| \)' \ + 'abort:abort task:\( $task_id_arg \| \)' \ + 'check-git-inheritance:disable git inheritance check:$task_id_arg $task_subtask_id_arg $disable_arg $commit_sha_arg' +task_commands=("$reply[@]") + +local -a build_args +_regex_words \ + build-options "build option" \ + '-b:binary repository name:$binary_repo_arg' \ + '--deps:deps list:$task_any_id_arg' +build_args=( + '(' "$reply[@]" '|' ')' +) +_regex_words \ + build-command "build command" \ + 'srpm:build source rpm:$source_rpm_arg' \ + 'del:delete package:$package_name_arg' \ + 'copy:copy from another repository:$package_name_arg $binary_repo_arg' +build_args+=('(' "$reply[@]" '|' $repo_tag_args ')' '#') + +local -a acl_login_group_arg +acl_login_group_arg=( + '(' + $group_name_arg + '|' + $login_arg + ')' +) + +local -a acl_package_group_arg +acl_package_group_arg=( + '(' + $group_name_arg + '|' + $package_name_arg + ')' +) + +local -a timestamp +timestamp=( + /$'[[:digit:]]##\0'/ ':timestamp:timestamp:' +) + +local -a acl_nmu_cmds +_regex_words \ + acl-nmu-command "acl nmu command" \ + 'show:show nmu status' \ + 'add:add nmu rights:$login_arg $timestamp $timestamp' \ + 'del:delete nmu rights:$login_arg $timestamp $timestamp' +acl_nmu_cmds=("$reply[@]") + +local -a acl_cmds +_regex_words \ + acl-command "acl command" \ + 'nmu:nmu management:$acl_nmu_cmds' \ + 'check:check acl' \ + 'show:show acl' \ + 'add:add acl:\( $acl_login_group_arg \# \)' \ + 'del:delete acl:\( $acl_login_group_arg \# \)' \ + 'leader:set leader:$acl_login_group_arg' \ + 'replace:replace acl:\( $acl_login_group_arg \# \)' +acl_cmds=("$reply[@]") + +local -a acl_list_arg +_regex_words \ + acl-option "acl option" \ + '--list:list binary repositories' +acl_list_arg=("$reply[@]") + +local -a acl_args +acl_args=( + '(' + $acl_list_arg + '|' + $binary_repo_arg + $acl_package_group_arg + $acl_cmds + ')' +) + +local -a remote_arg +remote_arg=( + /$'[^\0]#\0'/ ':host:host:_hosts' +) +_regex_words \ + options "girar-utils option" \ + '-R:remote name:$remote_arg' +args+=( '(' "$reply[@]" '|' ')' ) + +_regex_words \ + commands "girar command" \ + 'help:show girar command reference' \ + 'charset:set default character encoding for repository:$charset_args' \ + 'clone:clone repository:$clone_args' \ + 'default-branch:set default branch:$default_branch_args' \ + 'find-package:search repository:$find_package_args' \ + 'init-db:create new repository:$init_db_args' \ + 'ls:list girar directory:$ls_args' \ + 'mv-db:rename/move repository:$mv_db_args' \ + 'quota:show user quota information' \ + 'rm-db:delete repository:$rm_db_args' \ + 'task:manage tasks:$task_commands' \ + 'build:build package:$build_args' \ + 'acl:manage package access control lists:$acl_args' +args+=("$reply[@]") + +_regex_arguments _girar_remote "${args[@]}" + +_girar_remote "$@" diff --git a/Completion/ALT/Command/_hasher b/Completion/ALT/Command/_hasher new file mode 100644 index 000000000..1d054b245 --- /dev/null +++ b/Completion/ALT/Command/_hasher @@ -0,0 +1,163 @@ +#compdef hsh hsh-install hsh-rebuild hsh-run hsh-shell mkaptbox +# vim: et tw=4 sw=4 + +local curcontext="$curcontext" packages ret=1 +local -a help_opts common_opts aptbox_opts __repo builder_opts nonsh_opts + +help_opts=( +'(-v --verbose -q --quiet)'{-q,--quiet}'[try to be more quiet]' +'(-v --verbose -q --quiet)'{-v,--verbose}'[print a message for each action]' +'(- :)'{-V,--version}'[print program version and exit]' +'(- :)'{-h,--help}'[show usage and exit]' +) + +# options suitable for /hsh.*/ +common_opts=( +'--hasher-priv-dir=[hasher-priv directory]:hasher-priv:_directories' +'--mountpoints=[comma-separated list of known mount points]:mountpoints' +'--number=[subconfig identifier]:number' +'(--no-wait-lock)--wait-lock[wait for workdir and hasher-priv locks]' +'(--wait-lock)--no-wait-lock[do not wait for workdir and hasher-priv locks]' +) + +__repo=( +'(--repo,--repo-bin,--repo-src)--repo=[destination repository directory]: :_directories' +'(--repo)--repo-bin=[binary packages destination directory]: :_directories' +'(--repo)--repo-src=[source packages destination directory]: :_directories' +) + +# aptbox-exclusive +aptbox_opts=( +'--apt-config=[path to custom apt.conf file]:apt-config:_files' +'--apt-prefix=[path to apt directory prefix]:apt-prefix:_directories' +$__repo +'--target=[target architecture]:architecture' +) + + +# options for hsh, hsh-rebuild +builder_opts=( +'--build-srpm-only[do not build binary packages]' +'--rebuild-prog=[program to run to query for rebuild]:rebuild-prog:_files -g "*(-*)"' +'(--query-req-prog)--query-repackage[repackage the source before query for requirements]' +'(--query-repackage)--query-req-prog=[program to run to query for requirements]:query-req-prog:_files -g "*(-*)"' +$__repo +'--target=[target architecture]:architecture: ' +) + +# options for non-runners: hsh, -install, -rebuild +nonsh_opts=( +'--excludedocs[do not install documentation files]' + +) + +no_sis_check_opts=( +'(--no-sisyphus-check'{,-in,-out}')--no-sisyphus-check-in=[do not run sisyphus_check input tests]::sisyphus_check tests:_sisyphus_check_tests' +'(--no-sisyphus-check'{,-in,-out}')--no-sisyphus-check=[do not run sisyphus_check tests]::sisyphus_check tests:_sisyphus_check_tests' +'(--no-sisyphus-check'{,-in,-out}')--no-sisyphus-check-out=[do not run sisyphus_check output tests]::sisyphus_check tests:_sisyphus_check_tests' +) + +srcrpm_or_pkgtar='"*.(src.rpm|tar)"' + +case "$service" in + hsh) + if (( $words[(I)--(initroot|cleanup)-only] )); then + packages= + else + packages='*:source package:_files -g '"$srcrpm_or_pkgtar" + fi + # TODO: replace --args and --build-args with --rpmbuild-args on completion attempt, + # possibly -M 'm:--build-args=--rpmbuild-args r:|[_-]=* r:|=*' + _arguments -S \ + $help_opts \ + $common_opts \ + $builder_opts \ + $nonsh_opts \ + $aptbox_opts \ + '--'{rpm,}'build-args=[extra arguments for rpmbuild]:rpmbuild args:' \ + '--cache-compress[specify executable to compress cache with]:_normal -e' \ + '(--initroot-only)--cleanup-only[do not build at all, just cleanup workdir]' \ + '--eager-cleanup[cleanup build environment after each successful build]' \ + '--lazy-cleanup[cleanup build environment before each new build]' \ + '(--cleanup-only)--initroot-only[do not build, stop after initroot stage]' \ + '--install-langs=[colon-separated list of languages to install]:languages' \ + '--no-cache[do not use initroot cache]' \ + '--no-contents-indices[do not use content indices]' \ + '(--repackage-source)--no-repackage-source[do not repackage source along with binaries]' \ + $no_sis_check_opts \ + '--nprocs=[number of CPUs to use]:number' \ + '--packager=[override default RPM packager tag]:packager:' \ + '--printenv[show configuration environment variables]' \ + '--pkg-build-list=[override default build package file list]:packages' \ + '--pkg-init-list=[override default initial package file list]:packages' \ + '(--no-repackage-source)--repackage-source[repackage source along with binaries]' \ + '--save-fakeroot[save fakeroot state]' \ + '(--with-stuff)--without-stuff[do not use built packages]' \ + '(--without-stuff)--with-stuff[allow use of built packages]' \ + '::workdir:_directories' \ + $packages && ret=0 + ;; + hsh-install) + _arguments -S \ + $help_opts \ + $common_opts \ + $nonsh_opts \ + '::workdir:_directories' \ + '*:package name' && ret=0 + ;; + hsh-rebuild) + _arguments -S \ + $help_opts \ + $common_opts \ + $builder_opts \ + $nonsh_opts \ + '--'{rpmbuild-,}'args=[extra arguments for rpmbuild]: : ' \ + '--install-only[do not build, stop after installing build dependencies]' \ + '--nodeps[ignore package dependencies (dangerous)]' \ + $no_sis_check_opts \ + '--source-only[do not build, stop after installing source package]' \ + '(--with-stuff)--without-stuff[do not generate apt index files]' \ + '(--without-stuff)--with-stuff[generate apt index files]' \ + '::workdir:_directories' \ + ':source package:_files -g '"$srcrpm_or_pkgtar" && ret=0 + ;; + hsh-run|hsh-shell) + _arguments -S \ + $help_opts \ + $common_opts \ + '(--rooter)--builder[run program as builder]' \ + '--execute=[copy given script to workdir and execute it]:script:_files' \ + '--pty[redirect standard descriptors to controlling pty]' \ + '(--builder)--rooter=[run program as pseudoroot]' \ + '--shell=[run interactive shell]::shell:_files -g "*(-*)"' \ + '--x11-timeout=[how long X11 authorization will be valid]:seconds' \ + '(-x -X -Y)-x[disable X11 forwarding]' \ + '(-x -X -Y)-X[enable X11 forwarding]' \ + '(-x -X -Y)-Y[enable trusted X11 forwarding]' \ + '::workdir:_directories' \ + '*::command:= _normal -e' && ret=0 + + case "$state" in + command) + shift 1 words + (( CURRENT-- )) + _normal -e + return + ;; + esac + ;; + mkaptbox) + _arguments -S \ + $help_opts \ + $aptbox_opts \ + '(-f --force)'{-f,--force}'[force aptbox creation]' \ + '(-u --update)--no-update[do not run "apt-get update" after creation]' \ + '(-u --update --no-update)'{-u,--update}'[run "apt-get update" after creation]' \ + '(--with-stuff)--without-stuff[do not configure sources.list for the work repository]' \ + '(--without-stuff)--with-stuff[configure sources.list for the work repository]' \ + ':workdir:_directories' && ret=0 + ;; + + esac + + return $ret diff --git a/Completion/ALT/Command/_sisyphus_check b/Completion/ALT/Command/_sisyphus_check new file mode 100644 index 000000000..b3d0e1d97 --- /dev/null +++ b/Completion/ALT/Command/_sisyphus_check @@ -0,0 +1,29 @@ +#compdef sisyphus_check + +local curcontext="$curcontext" context state line ret=1 + +local -a opts_help +opts_help=( + '(-v --verbose -q --quiet)'{-q,--quiet}'[try to be more quiet]' + '(-v --verbose -q --quiet)'{-v,--verbose}'[print a message for each action]' + '(- :)'{-h,--help}'[show usage and exit]' +) + +local -a args +args=('*:directory:_directories') +if (( $words[(I)--files] )); then + args=('*:package:_files -g "*.rpm"') +fi + +_arguments -S \ + $opts_help \ + '--fast-check[stop checking after first error]' \ + '(--files --directories)--files[treat as a packages]' \ + '(--files --directories)--directories[treat as a directory]' \ + '--recursive[search packages recursively]' \ + '--show-bad-files[print bad packages]' \ + '--trust-gpg-names=[change the list of trusted gpg names]::' \ + '--'{no-,}'check=[change the list of checks]::sisyphus_check tests:_sisyphus_check_tests' \ + $args && ret=0 + +return $ret diff --git a/Completion/ALT/Type/.distfiles b/Completion/ALT/Type/.distfiles new file mode 100644 index 000000000..9a8e64fb9 --- /dev/null +++ b/Completion/ALT/Type/.distfiles @@ -0,0 +1,5 @@ +DISTFILES_SRC=' +.distfiles +_girar_info +_sisyphus_check_tests +' diff --git a/Completion/ALT/Type/_girar_info b/Completion/ALT/Type/_girar_info new file mode 100644 index 000000000..adf000cd0 --- /dev/null +++ b/Completion/ALT/Type/_girar_info @@ -0,0 +1,149 @@ +#autoload + +__girar_command() +{ + local cmd tag remote idx + + remote=() + idx=${words[(I)-R|-remote|--remote=*]} + (( idx )) && case ${words[$idx]} in + (-R|--remote) remote=(-R "${words[((idx+1))]}");; + (--remote=*) remote=(-R "${${words[$idx]}#--remote=}");; + esac + + if zstyle -s ":completion:${curcontext}:${1}" command cmd || + cmd="$2" + + "$cmd" "$remote[@]" "${@[3,-1]}" +} + +_girar_info-directories() +{ + local expl + local -a remfiles + + if compset -P '?*/'; then + remfiles=(${${${${${${${(M)${${(f)"$(__girar_command package-repository girar-remote ls $1${words[CURRENT]%/*})"}:#total *}:#d*}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}) + elif compset -P /; then + remfiles=(people archive gears) + else + remfiles=(${${${${${${${(M)${${(f)"$(__girar_command package-repository girar-remote ls $1)"}:#total *}:#d*}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}) + fi + + _wanted files expl 'girar directories' \ + compadd -S/ -q -- "$remfiles[@]" +} + +_girar_info-tasks() +{ + local -a tasks + + tasks=(${${${${(f)"$(__girar_command task-id girar-remote task ls --repo=ALL --state=ALL)"}#\#}//:/\\:}/ /:}) + _describe -t task-id 'task id' tasks -V tasks +} + +_girar_info-all-tasks() +{ + local -a tasks + + tasks=(${${${${(f)"$(__girar_command any-task-id girar-remote task ls --repo=ALL --state=ALL --user=ALL)"}#\#}//:/\\:}/ /:}) + _describe -t any-task-id 'task id' tasks -V tasks +} + +_girar_info-subtasks() +{ + local -a subtasks + + # Assumes that task id comes right before subtask id + subtasks=(${(M)${${(f)"$(__girar_command subtask-id girar-remote task show --brief "$@")"}# }:#<->*}) + _describe -t subtask-id 'subtask id' subtasks -V subtasks +} + +_girar_info-binary-repositories() +{ + local -a repos + + repos=( ${(f)"$(__girar_command binary-repository girar-remote acl --list)"} ) + _describe -t binary-repository 'binary repository' repos -V repos +} + +_girar_info-package-repositories() +{ + local -a repos + + repos=( ${${${${${${${${(M)${${(f)"$(__girar_command package-repository girar-remote ls packages)"}:#total *}:#d*}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}%.git} ) + _describe -t package-repository 'package repository' repos +} + +_girar_info-package-tags() +{ + local uri pattern + local -a tags + + if zstyle -s ":completion:${curcontext}:package-tag" tag-pattern pattern || + pattern="*-alt*" + + uri="$(__girar_command uri girar-remote-uri "$@")" + tags=( ${(M)${${${${(f)"$(_call_program package-tag git ls-remote -t "$uri")"}:#*\^\{\}}##* }#refs/tags/}:#$~pattern} ) + _describe -t package-tag 'package tag' tags -V tags +} + +_girar_info-repository-branches() +{ + local uri + local -a tags + + uri="$(__girar_command uri girar-remote-uri "$@")" + branches=( ${${${(f)"$(_call_program package-tag git ls-remote -h "$uri")"}##* }#refs/heads/} ) + _describe -t repository-branch 'repository branch' branches +} + +_girar_info-srpms() +{ + local -a srpms + + srpms=( ${${${${${${${${(M)${${(f)"$(__girar_command source-rpm girar-remote ls incoming)"}:#total *}:#*.src.rpm}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}%.git} ) + _describe -t source-rpm 'source rpm' srpms +} + +_girar_info-user() +{ + local expl + local -a remusers + + remusers=(${${${${${${${(M)${${(f)"$(__girar_command users girar-remote ls /people)"}:#total *}:#d*}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}) + + _wanted users expl 'girar users' \ + compadd -- "$remusers[@]" +} + +_girar_info-users() +{ + local expl + local -a remusers + + remusers=(${${${${${${${(M)${${(f)"$(__girar_command users girar-remote ls /people)"}:#total *}:#d*}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}) + + _wanted users expl 'girar users' \ + compadd -S, -q -- "$remusers[@]" +} + +_girar_info() +{ + local what ret + local -a expl + + zparseopts -D -a expl q n 1 2 P: S: r: R: W: X+: M+: F: J+: V+: + + what="$1" + [[ "$what" = (directories|tasks|all-tasks|subtasks|binary-repositories|package-repositories|package-tags|repository-branches|srpms|user|users) ]] || { + _message "unknown command: $what" + return + } + + _call_function ret _girar_info-$what "${@[2,-1]}" + + return ret +} + +_girar_info "$@" diff --git a/Completion/ALT/Type/_sisyphus_check_tests b/Completion/ALT/Type/_sisyphus_check_tests new file mode 100644 index 000000000..1dce296c8 --- /dev/null +++ b/Completion/ALT/Type/_sisyphus_check_tests @@ -0,0 +1,33 @@ +#autoload + +_sisyphus_check_tests () { + local expl tests + + tests=( + '(buildhost buildtime changelog content deps description dirlist fhs gpg group intersects libtool locales nvr packager perms pkgconfig printable subdirs summary)all[all tests]' + '(all)buildhost' + '(all)buildtime' + '(all)changelog' + '(all)content' + '(all)deps' + '(all)description' + '(all)dirlist' + '(all)fhs' + '(all)gpg' + '(all)group' + '(all)intersects' + '(all)libtool' + '(all)locales' + '(all)nvr' + '(all)packager' + '(all)perms' + '(all)pkgconfig' + '(all)printable' + '(all)subdirs' + '(all)summary' + ) + + _values -s , 'tests' "$tests[@]" +} + +_sisyphus_check_tests "$@" diff --git a/Completion/Debian/Command/_apt b/Completion/Debian/Command/_apt index 4d60cd249..7cfacbc21 100644 --- a/Completion/Debian/Command/_apt +++ b/Completion/Debian/Command/_apt @@ -1,6 +1,8 @@ #compdef apt apt-get apt-cache apt-cdrom apt-config apt-mark _apt () { + local deb=deb + [ -f /etc/debian_version ] || deb=rpm case "$service" in apt) _apt-cmd "$@";; apt-get) _apt-get "$@";; @@ -401,31 +403,31 @@ _apt-cmd () { -- \ /$'list\0'/ \( \ \( \ - /$'--installed\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# /'[]'/ \| \ + /$'--installed\0'/ ':packages::_${deb}_packages "$expl_packages[@]" installed' \# /'[]'/ \| \ // %-% /$'--[^\0]#\0'/ ':options:option:(--installed --upgradable --all-versions)' \ \| \) \ - /$'[^-\0][^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \ + /$'[^-\0][^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" avail' \# \ \) \| \ /$'search\0'/ /$'[^\0]#\0'/ ':strings:pattern:' \| \ - /$'showsrc\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \ - /$'show\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \ - /$'depends\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \ - /$'rdepends\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \ - /$'policy\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \ + /$'showsrc\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" avail' \# \| \ + /$'show\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" avail' \# \| \ + /$'depends\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" avail' \# \| \ + /$'rdepends\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" avail' \# \| \ + /$'policy\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" avail' \# \| \ /$'update\0'/ \| \ \( \ /$'(install|download|source|build-dep)\0'/ -'subcmd=${match%?}' \ - /$'[^\0]#\0'/ ':packages::_deb_packages -qr "\n\t\- /=+-" "$expl_packages[@]" avail' \# \ + /$'[^\0]#\0'/ ':packages::_${deb}_packages -qr "\n\t\- /=+-" "$expl_packages[@]" avail' \# \ \( \ - // '%(.|)/%' -'[[ $subcmd = install ]]' /'[]'/ ':files: :_deb_files -c' \| \ + // '%(.|)/%' -'[[ $subcmd = install ]]' /'[]'/ ':files: :_${deb}_files -c' \| \ /$'[^\0/=]#\/'/ /'[]'/ ':apt-releases:release name:_apt_releases' \| \ /$'[^\0/=]#='/ /'[]'/ ':apt-package-versions:package version:_apt_versions_of_binary_package' \| \ \) \ \) \| \ - /$'(remove|reinstall|purge)\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ + /$'(remove|reinstall|purge)\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" installed' \# \| \ /$'upgrade\0'/ \| \ /$'autoclean\0'/ \| \ - /$'changelog\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \ + /$'changelog\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" avail' \# \| \ /$'autoremove\0'/ \| \ /$'full-upgrade\0'/ \| \ /$'dist-upgrade\0'/ \| \ @@ -481,25 +483,27 @@ _apt-get () { /$'upgrade\0'/ \| \ \( \ /$'install\0'\|$'download\0'\|$'source\0'\|$'build-dep\0'/ \ - /$'[^\0]#\0'/ ':packages::_deb_packages -qr "\n\t\- /=" "$expl_packages[@]" avail' \# \ + /$'[^\0]#\0'/ ':packages::_${deb}_packages -qr "\n\t\- /=" "$expl_packages[@]" avail' \# \ \( \ /$'[^\0/=]#/'/ /'[]'/ ':apt-releases:release name:_apt_releases' \| \ /$'[^\0/=]#='/ /'[]'/ ':apt-package-versions:package version:_apt_versions_of_binary_package' \ \) \ \) \| \ - /$'remove\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ - /$'purge\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ + /$'reinstall\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" installed' \# \| \ + /$'remove\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" installed' \# \| \ + /$'purge\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" installed' \# \| \ /$'dist-upgrade\0'/ \| \ /$'dselect-upgrade\0'/ \| \ /$'clean\0'/ \| \ /$'autoclean\0'/ \| \ - /$'changelog\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \ /$'check\0'/ \| \ - /$'autoremove\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ + /$'source\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" avail' \# \| \ + /$'build-dep\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" avail' \# \| \ + /$'autoremove\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" installed' \# \| \ /$'help\0/' \| \ - /$'markauto\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ - /$'unmarkauto\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ - /"[]"/ ':argument-1::compadd "$expl_action[@]" update upgrade install remove purge dist-upgrade dselect-upgrade clean autoclean changelog check source build-dep autoremove help markauto unmarkauto download' + /$'markauto\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" installed' \# \| \ + /$'unmarkauto\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" installed' \# \| \ + /"[]"/ ':argument-1::compadd "$expl_action[@]" update upgrade install reinstall remove purge dist-upgrade dselect-upgrade clean autoclean check source build-dep autoremove help markauto unmarkauto' _apt-get () { local expl_action expl_packages @@ -533,21 +537,21 @@ _apt-cache () { /$'help\0'/ \| \ /$'add\0'/ /$'[^\0]#\0'/ ':files:index files:_files' \# \| \ /$'gencaches\0'/ \| \ - /$'showpkg\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \ - /$'showsrc\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \ + /$'showpkg\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" avail' \# \| \ + /$'showsrc\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" avail' \# \| \ /$'stats\0'/ \| \ /$'dump\0'/ \| \ /$'dumpavail\0'/ \| \ /$'unmet\0'/ \| \ /$'search\0'/ /$'[^\0]#\0'/ ':strings:pattern:' \| \ - /$'show\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \ - /$'depends\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \ - /$'rdepends\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \ + /$'show\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" avail' \# \| \ + /$'depends\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" avail' \# \| \ + /$'rdepends\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" avail' \# \| \ /$'pkgnames\0'/ /$'[^\0]#\0'/ ':strings:prefix:' \| \ - /$'dotty\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \ - /$'xvcg\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \ - /$'policy\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \ - /$'madison\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" avail' \# \| \ + /$'dotty\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" avail' \# \| \ + /$'xvcg\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" avail' \# \| \ + /$'policy\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" avail' \# \| \ + /$'madison\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" avail' \# \| \ /"[]"/ ':argument-1::compadd "$expl_action[@]" help add gencaches showpkg showsrc stats dump dumpavail unmet search show depends rdepends pkgnames dotty policy xvcg madison' _apt-cache () { @@ -691,13 +695,13 @@ _apt-mark () { -qq:bool \ -s:bool \ -- \ - /$'auto\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ - /$'manual\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ - /$'hold\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ - /$'unhold\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ - /$'showauto\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ - /$'showmanual\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ - /$'showhold\0'/ /$'[^\0]#\0'/ ':packages::_deb_packages "$expl_packages[@]" installed' \# \| \ + /$'auto\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" installed' \# \| \ + /$'manual\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" installed' \# \| \ + /$'hold\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" installed' \# \| \ + /$'unhold\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" installed' \# \| \ + /$'showauto\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" installed' \# \| \ + /$'showmanual\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" installed' \# \| \ + /$'showhold\0'/ /$'[^\0]#\0'/ ':packages::_${deb}_packages "$expl_packages[@]" installed' \# \| \ /"[]"/ ':argument-1::compadd "$expl_action[@]" auto manual hold unhold showauto showmanual showhold' _apt-mark () { diff --git a/Completion/Debian/Command/_aptitude b/Completion/Debian/Command/_aptitude index bbaa8ebbd..32110acd5 100644 --- a/Completion/Debian/Command/_aptitude +++ b/Completion/Debian/Command/_aptitude @@ -1,13 +1,15 @@ #compdef aptitude local curcontext="$curcontext" state line cmds ret=1 +local deb=deb +[ -f /etc/debian_version ] || deb=rpm function _aptitude_release() { #{{{ local expl releases releases=( ${${(M)${(f)"$( +#ifdef HAVE_STROPTS_H +#include +#endif +#include +#include /* The number of bytes we normally read when given no pattern and the * upper bound on the number of bytes we read (even if we are give a @@ -154,12 +162,8 @@ getptycmd(char *name) return NULL; } -/* posix_openpt() seems to have some problem on OpenBSD */ -#if defined(USE_DEV_PTMX) && !defined(__OpenBSD__) - -#ifdef HAVE_SYS_STROPTS_H -#include -#endif +#if 0 /* use GLIBC API */ +#ifdef USE_DEV_PTMX #if defined(I_FIND) && defined(I_PUSH) /* @@ -298,6 +302,7 @@ get_pty(int master, int *retfd) } #endif /* /dev/ptmx or alternatives */ +#endif /* 0 */ static int newptycmd(char *nam, char *pname, char **args, int echo, int nblock) @@ -320,12 +325,22 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock) return 1; } - if (get_pty(1, &master)) { + master = getpt(); + if (master < 0) { zwarnnam(nam, "can't open pseudo terminal: %e", errno); scriptname = oscriptname; ineval = oineval; return 1; } + if (grantpt(master) < 0) { + zwarnnam(nam, "grantpt: %e", errno); + return 1; + } + if (unlockpt(master) < 0) { + zwarnnam(nam, "unlockpt: %e", errno); + return 1; + } + if ((pid = fork()) == -1) { zwarnnam(nam, "can't create pty command %s: %e", pname, errno); close(master); @@ -353,10 +368,25 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock) } #endif - if (get_pty(0, &slave)) - exit(1); - SHTTY = slave; - attachtty(mypid); + { + const char *name = ptsname(master); + if (!name) + exit(1); + slave = open(name, O_RDWR|O_NOCTTY); + if (slave < 0) + exit(1); +#ifdef HAVE_STROPTS_H + if (isastream(slave)) + { + if (ioctl(slave, I_PUSH, "ptem") < 0 + || ioctl(slave, I_PUSH, "ldterm") < 0) + exit(1); + } +#endif + SHTTY = slave; + attachtty(mypid); + } + #ifdef TIOCGWINSZ /* Set the window size before associating with the terminal * * so that we don't get hit with a SIGWINCH. I'm paranoid. */ @@ -392,10 +422,6 @@ newptycmd(char *nam, char *pname, char **args, int echo, int nblock) ioctl(slave, TIOCSCTTY, 0); #endif - close(0); - close(1); - close(2); - dup2(slave, 0); dup2(slave, 1); dup2(slave, 2); diff --git a/Src/Zle/complete.mdd b/Src/Zle/complete.mdd index 77e33504d..0e3c30a26 100644 --- a/Src/Zle/complete.mdd +++ b/Src/Zle/complete.mdd @@ -1,7 +1,7 @@ name=zsh/complete link=either load=yes -functions='Completion/*comp* Completion/AIX/*/* Completion/BSD/*/* Completion/Base/*/* Completion/Cygwin/*/* Completion/Darwin/*/* Completion/Debian/*/* Completion/Linux/*/* Completion/Mandriva/*/* Completion/Redhat/*/* Completion/Solaris/*/* Completion/openSUSE/*/* Completion/Unix/*/* Completion/X/*/* Completion/Zsh/*/*' +functions='Completion/*comp* Completion/AIX/*/* Completion/ALT/*/* Completion/BSD/*/* Completion/Base/*/* Completion/Cygwin/*/* Completion/Darwin/*/* Completion/Debian/*/* Completion/Linux/*/* Completion/Mandriva/*/* Completion/Redhat/*/* Completion/Solaris/*/* Completion/Unix/*/* Completion/X/*/* Completion/Zsh/*/*' moddeps="zsh/zle" diff --git a/Src/builtin.c b/Src/builtin.c index aa5767cf1..b968b879f 100644 --- a/Src/builtin.c +++ b/Src/builtin.c @@ -6272,7 +6272,7 @@ bin_read(char *name, char **args, Options ops, UNUSED(int func)) if (!zleactive) { if (SHTTY == -1) { /* need to open /dev/tty specially */ - if ((SHTTY = open("/dev/tty", O_RDWR|O_NOCTTY)) != -1) { + if ((SHTTY = block_open("/dev/tty", O_RDWR|O_NOCTTY)) != -1) { haso = 1; oshout = shout; init_shout(); diff --git a/Src/init.c b/Src/init.c index 99ccc16cf..f37ad63e1 100644 --- a/Src/init.c +++ b/Src/init.c @@ -616,7 +616,7 @@ init_io(char *cmd) if (isatty(0)) { zsfree(ttystrname); if ((ttystrname = ztrdup(ttyname(0)))) { - SHTTY = movefd(open(ttystrname, O_RDWR | O_NOCTTY)); + SHTTY = movefd(block_open(ttystrname, O_RDWR | O_NOCTTY)); #ifdef TIOCNXCL /* * See if the terminal claims to be busy. If so, and fd 0 @@ -657,7 +657,7 @@ init_io(char *cmd) ttystrname = ztrdup(ttyname(1)); } if (SHTTY == -1 && - (SHTTY = movefd(open("/dev/tty", O_RDWR | O_NOCTTY))) != -1) { + (SHTTY = movefd(block_open("/dev/tty", O_RDWR | O_NOCTTY))) != -1) { zsfree(ttystrname); ttystrname = ztrdup(ttyname(SHTTY)); } @@ -972,7 +972,7 @@ setupvals(char *cmd, char *runscript, char *zsh_name) path = (char **) zalloc(sizeof(*path) * 5); path[0] = ztrdup("/bin"); path[1] = ztrdup("/usr/bin"); - path[2] = ztrdup("/usr/ucb"); + path[2] = ztrdup("/usr/X11R6/bin"); path[3] = ztrdup("/usr/local/bin"); path[4] = NULL; @@ -1812,3 +1812,33 @@ zsh_main(UNUSED(int argc), char **argv) : "use 'logout' to logout."); } } + +/**/ +int +block_open (const char *tty, int flags) +{ + int saved_errno; + int fd; + + if ((flags & O_NONBLOCK) == 0) { + fd = open (tty, flags | O_NONBLOCK); + if (fd == -1) + return fd; + flags = fcntl(fd, F_GETFL); + if (flags == -1) + goto bad; + flags &= ~O_NONBLOCK; + if (fcntl(fd, F_SETFL, flags) == -1) + goto bad; + } + else + fd = open (tty, flags); + + return fd; + +bad: + saved_errno = errno; + close (fd); + errno = saved_errno; + return -1; +} diff --git a/configure.ac b/configure.ac index af8c5bba8..1c3f28b74 100644 --- a/configure.ac +++ b/configure.ac @@ -680,7 +680,7 @@ AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \ unistd.h sys/capability.h \ utmp.h utmpx.h sys/types.h pwd.h grp.h poll.h sys/mman.h \ netinet/in_systm.h pcre.h langinfo.h wchar.h stddef.h \ - sys/stropts.h iconv.h ncurses.h ncursesw/ncurses.h \ + stropts.h iconv.h ncurses.h ncursesw/ncurses.h \ ncurses/ncurses.h) if test x$dynamic = xyes; then AC_CHECK_HEADERS(dlfcn.h) diff --git a/zcfg/zlerc b/zcfg/zlerc new file mode 100644 index 000000000..092562f30 --- /dev/null +++ b/zcfg/zlerc @@ -0,0 +1,77 @@ +# +# ALT Linux zle configuration file (zsh(1) key bindings). +# In sync with /etc/inputrc (libreadline configuration). +# This file is sourced from /etc/zshrc. +# + +[[ -o zle ]] && zmodload -i zsh/zle || return + +bindkey -d # reset +# bindkey -v # vi key bindings +bindkey -e # emacs key bindings + +# Keyboard configuration +bindkey "\e[2~" quoted-insert # Insert +bindkey "\e[3~" delete-char # Suppr +bindkey "\e[1~" beginning-of-line # Home +bindkey "\e[4~" end-of-line # End +bindkey "\e[5~" up-line-or-history # Previous +bindkey "\e[6~" down-line-or-history # Next + +# those two are for rxvt +bindkey "\e[7~" beginning-of-line +bindkey "\e[8~" end-of-line + +# some xterms, freebsd console +bindkey "\e[H" beginning-of-line +bindkey "\e[F" end-of-line + +# on some exotic xterms +bindkey "\eOH" beginning-of-line +bindkey "\eOF" end-of-line +bindkey "\eOd" backward-word +bindkey "\eOc" forward-word + +# on nxterms +bindkey "\e[\C-@" beginning-of-line +bindkey "\e[e" end-of-line + +#if [ "${TERM%%-*}" = xterm ]; then +# +# Application keypad and cursor of xterm +# with NumLock ON +# +# Operators +bindkey -s "\eOo" "/" +bindkey -s "\eOj" "*" +bindkey -s "\eOm" "-" +bindkey -s "\eOk" "+" +bindkey -s "\eOl" "+" +bindkey "\eOM" accept-line + +# Colon and dot +# bindkey -s "\eOl" "," +bindkey -s "\eOn" "." + +# Numbers +bindkey -s "\eOp" "0" +bindkey -s "\eOq" "1" +bindkey -s "\eOr" "2" +bindkey -s "\eOs" "3" +bindkey -s "\eOt" "4" +bindkey -s "\eOu" "5" +bindkey -s "\eOv" "6" +bindkey -s "\eOw" "7" +bindkey -s "\eOx" "8" +bindkey -s "\eOy" "9" + +#fi + +# +# Application keypad and cursor of xterm +# +bindkey "\eOD" backward-char +bindkey "\eOC" forward-char +bindkey "\eOA" up-line-or-history +bindkey "\eOB" down-line-or-history +# bindkey -s "\eOE" "" diff --git a/zcfg/zlogout b/zcfg/zlogout new file mode 100644 index 000000000..9ecba84ad --- /dev/null +++ b/zcfg/zlogout @@ -0,0 +1,16 @@ +# +# ALT Linux zlogout configuration file for zsh(1). +# This file is run when an interactive session ends. +# Place custom options into ~/.zlogout. +# + +if [ "${TERM-}" = linux ]; then + case "$TTY" in + /dev/tty[0-9]*|/dev/vc/*|/dev/xvc*) + # Historically some VT environments on ALT Linux did + # not reset the VT on logout. To be fair, nowadays + # they should; still, we're leaning on the safe side, + # just as bash does as of 2021-02-27. + clear ;; + esac +fi diff --git a/zcfg/zprofile b/zcfg/zprofile new file mode 100644 index 000000000..b96c88b19 --- /dev/null +++ b/zcfg/zprofile @@ -0,0 +1,11 @@ +# +# ALT Linux zprofile configuration file for zsh(1). +# This file is sourced in login shell only. +# + +# Load essential files: +emulate sh +[ -f /etc/profile ] && . /etc/profile +[ -f "$HOME"/.profile ] && . "$HOME"/.profile + +emulate zsh diff --git a/zcfg/zshenv b/zcfg/zshenv new file mode 100644 index 000000000..6087e0b0e --- /dev/null +++ b/zcfg/zshenv @@ -0,0 +1,10 @@ +# +# ALT Linux zshenv configuration file for zsh(1). +# This file is sourced on all invocations of the shell. +# This file should not contain commands that product output or assume the shell is attached to a tty. +# Place custom options into ~/.zshenv. +# + +# Secure TMPDIR and set TMPPREFIX according to TMPDIR. +[ -f /etc/profile.d/tmpdir.sh ] && . /etc/profile.d/tmpdir.sh && + TMPPREFIX="${TMPDIR:-/tmp}/zsh" diff --git a/zcfg/zshrc b/zcfg/zshrc new file mode 100644 index 000000000..a233bfb53 --- /dev/null +++ b/zcfg/zshrc @@ -0,0 +1,42 @@ +# +# ALT Linux zshrc configuration file for zsh(1). +# This file is sourced in interactive mode only. +# For feature-rich sample zshrc, see /usr/share/doc/zsh-*/zshrc. +# Place custom options into ~/.zshrc. +# + +# Load keyboard bindings. +[ -f /etc/zlerc ] && . /etc/zlerc + +# Set prompts +PROMPT="%n@%m %3~ %(!.#.$) " # default prompt + +# history options +HISTFILE="${ZDOTDIR:-$HOME}/.zsh_history" +HISTSIZE=11111 +SAVEHIST=9999 + +# more history options; this makes history more convenient +setopt INC_APPEND_HISTORY +setopt HIST_IGNORE_ALL_DUPS +setopt HIST_SAVE_NO_DUPS +setopt HIST_REDUCE_BLANKS + +# Completion functions +autoload -U compinit && compinit + +# Cache for _rpm_packages, _perl_modules, etc. +zstyle ':completion:*' use-cache on + +# Set sudo's command-path to it's real command search path. +zstyle ':completion:*:sudo:*' command-path /sbin /usr/sbin /usr/local/sbin /bin /usr/bin /usr/local/bin + +() { +local f +setopt localoptions extendedglob +[[ -n /etc/zshrc.d/*.zsh(#qN) ]] && for f in /etc/zshrc.d/*.zsh; do + if [ -r "$f" ]; then + . "$f" + fi +done +} diff --git a/zsh.spec b/zsh.spec new file mode 100644 index 000000000..9bce9823b --- /dev/null +++ b/zsh.spec @@ -0,0 +1,654 @@ +Name: zsh +Version: 5.8.1 +Release: alt2 +Epoch: 1 + +Summary: A shell with lots of features +License: ALT-Zsh +Group: Shells + +Url: http://www.zsh.org +Source: %name-%version.tar +Patch: zsh-%version-%release.patch +# present on master branch +Patch1: 47867-promptinit-typo-RPOMPT-RPROMPT.patch +# present on master branch +Patch2: 47868-promptinit-Fix-prompt-cleanups.patch +# present on master branch +Patch3: 47918-completions-for-nsenter-and-unshare.patch +# present on master branch +Patch4: 47323-_rpmbuild-Complete-file-arguments-after-r-b-t.patch +Patch5: alt-packaging-0001-compaudit-fix-zsh-executable-discovery-if-proc-missing.patch + +Patch101: alt-rpm-0001-_rpm-complete-q-lastchange.patch + +Provides: zsh-doc = %epoch:%version +Obsoletes: zsh-doc < %epoch:%version + +# Automatically added by buildreq on Thu Jan 16 2014 +# optimized out: gnu-config groff-base less libncurses-devel libtinfo-devel makeinfo +BuildRequires: libcap-devel libgdbm-devel libncursesw-devel libpcre-devel man yodl makeinfo + +# For make check +BuildPreReq: /dev/pts + +%description +Zsh is a UNIX command interpreter (shell) usable as an interactive +login shell and as a shell script command processor. Of the standard +shells, zsh most closely resembles ksh but includes many enhancements. +Zsh has command-line editing, built-in spelling correction, programmable +command completion, shell functions (with autoloading), a history +mechanism, and a lots of other features. + +%prep +%setup +%patch -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch101 -p1 +rm config.guess config.sub + +%build +%autoreconf +cp -f %_datadir/automake/config.{guess,sub} . + +# Disable libnsl/NIS support. +export ac_cv_search_yp_all=no zsh_cv_sys_nis=no zsh_cv_sys_nis_plus=no + +# YODL is not required, pre-generated man pages are shipped. +export YODL=yodl PDFETEX=pdfetex TEXI2PDF=texi2pdf + +# Avoid autoconf thinking it should strip when linking. +export LDFLAGS= + +# Use getcwd(3). +export zsh_cv_use_getcwd=yes + +%configure \ + --enable-cflags="%optflags" \ + --enable-etcdir=%_sysconfdir \ + --enable-fndir=%_datadir/zsh \ + --enable-scriptdir=%_datadir/zsh/scripts \ + --enable-site-fndir=/usr/local/share/zsh \ + --enable-site-scriptdir=/usr/local/share/zsh/scripts \ + --enable-additional-fpath=%_datadir/zsh/site-functions \ + --enable-function-subdirs \ + --enable-maildir-support \ + --with-curses-terminfo \ + --with-tcsetpgrp \ + --enable-cap \ + --enable-pcre \ + --enable-multibyte \ + %{?_enable_debug: --enable-zsh-{,mem-,hash-}debug } \ + %{?_enable_debug: --enable-zsh-{mem-warning,secure-free} } \ + # + +# We don't expect that something is broken. +grep '^#define.*BROKEN' config.h && exit 1 + +%make_build MODDIR=%_libdir all info +%make_build MODDIR=%_libdir -C Etc + +%install +# That script hardcodes the locale for col(1). Sad! +sed -i "/LANG/s/'C'/'C.UTF-8'/" Util/helpfiles + +%makeinstall_std MODDIR=%_libdir install.info + +# Relocate to /bin. +mkdir -p %buildroot/bin +mv %buildroot%_bindir/zsh %buildroot/bin/zsh +ln -s "$(relative /bin/zsh %_bindir/zsh)" %buildroot%_bindir/zsh + +# Configuration files. +mkdir -p %buildroot%_sysconfdir/zshrc.d +for f in zshenv zprofile zshrc zlerc zlogout; do + install -p -m644 zcfg/$f %buildroot%_sysconfdir/$f +done + +# Fix paths. +find %buildroot%_datadir/zsh -type f -print0 | + xargs -r0 grep -FZl /usr/local/bin/zsh | + xargs -r0 subst -p s:/usr/local/bin/zsh:/bin/zsh:g + +# Resolve absolute path of zsh binary in compaudit to power Patch5. +find %buildroot%_datadir/zsh -type f -name compaudit -print0 | + xargs -r0 -n1 sed -i s:@packaged_zsh_executable@:%_bindir/zsh: + +# Drop useless crap +rm -f %buildroot%_datadir/zsh/Completion/Linux/_rpmbuild + +%check +# Tests use egrep/fgrep and ensure standard error contents are fixed. +mkdir -p %_tmppath/progs +cat >%_tmppath/progs/egrep <%_tmppath/progs/fgrep < 1:5.8.1-alt2 +- Fixed ftbfs (egrep/fgrep warnings in test suite). + +* Sat Feb 12 2022 Arseny Maslennikov 1:5.8.1-alt1 +- 5.8 -> 5.8.1. +- Fixes: + + CVE-2021-45444 + +* Tue Nov 02 2021 Arseny Maslennikov 1:5.8-alt3 +- New patches: + + compaudit: fix zsh executable discovery if /proc missing + + _rpm: complete -q --lastchange (Closes: 41261) + +* Sat Feb 27 2021 Arseny Maslennikov 1:5.8-alt2 +- Applied zsh-workers/47323 to fix Completion/Redhat/Command/_rpm. +- /etc/zlogout now only clears the screen on Linux VTs. + +* Sun Feb 07 2021 Arseny Maslennikov 1:5.8-alt1 +- 5.6.2 -> 5.8. +- Applied posted patches: + + zsh-workers/47867 + + zsh-workers/47868 + + zsh-workers/47918 +- Completion/ALT: updated _hasher. + +* Thu Nov 15 2018 Fr. Br. George 1:5.6.2-alt1 +- Autobuild version bump to 5.6.2 +- Provide /etc/zshrc.d + +* Tue Aug 14 2018 Fr. Br. George 1:5.5.1-alt1 +- Autobuild version bump to 5.5.1 (closes: #34248) + +* Mon Sep 04 2017 Fr. Br. George 1:5.4.2-alt1 +- Autobuild version bump to 5.4.2 +- ALT: improve _hasher completion (thanks to arseny@) + +* Wed Apr 05 2017 Gleb F-Malinovskiy 1:5.3.1-alt2 +- Switched builtin pwd -P to use getcwd(3). + +* Thu Feb 09 2017 Fr. Br. George 1:5.3.1-alt1 +- Autobuild version bump to 5.3.1 + +* Wed Jan 13 2016 Fr. Br. George 1:5.2-alt3 +- Fix _rpm completion + +* Wed Jan 13 2016 Fr. Br. George 1:5.2-alt2 +- Temporary restore upstream _rpm completion (ALT one is broken for now) + +* Wed Jan 13 2016 Fr. Br. George 1:5.2-alt1 +- Autobuild version bump to 5.2 + +* Fri Sep 25 2015 Fr. Br. George 1:5.1.1-alt1 +- Autobuild version bump to 5.1.1 + +* Mon Sep 07 2015 Fr. Br. George 1:5.1-alt1 +- Upgrade to 5.1 + +* Wed Oct 22 2014 Fr. Br. George 1:5.0.7-alt1 +- Autobuild version bump to 5.0.7 + +* Thu Sep 25 2014 Fr. Br. George 1:5.0.6-alt1 +- Autobuild version bump to 5.0.6 + +* Mon Jun 23 2014 Fr. Br. George 1:5.0.5-alt2 +- Provide additional fpath (for 3d-party completion etc.) + +* Thu Jan 16 2014 Fr. Br. George 1:5.0.5-alt1 +- Autobuild version bump to 5.0.5 +- Fix merge script + +* Sun Mar 31 2013 Fr. Br. George 1:5.0.2-alt1 +- Autobuild version bump to 5.0.2 + +* Thu Nov 15 2012 Fr. Br. George 1:5.0.0-alt1 +- Autobuild version bump to 5.0.0 +- Exclude upstream-privided systemd completion + +* Mon Apr 16 2012 Fr. Br. George 1:4.3.17-alt1 +- Autobuild version bump to 4.3.17 +- _vzctl completion bt mike@ +- remove noatime check in test (doesn't work in hasher anyway) + +* Tue Jan 10 2012 Fr. Br. George 1:4.3.15-alt6 +- New version (alt5uxx clone) + +* Wed Dec 21 2011 Alexey I. Froloff 1024:4.3.15-alt5uxx +- [4.3.15] + +* Thu Dec 01 2011 Alexey I. Froloff 1024:4.3.13-alt5uxx +- [4.3.13] + +* Tue Sep 27 2011 Alexey I. Froloff 1024:4.3.12-alt5uxx.135.g748bd73 +- [4.3.12-135-g748bd73] + +* Tue Sep 06 2011 Alexey I. Froloff 1024:4.3.12-alt5uxx.115.g7e528b4 +- [4.3.12-115-g7e528b4] + +* Thu Sep 01 2011 Alexey I. Froloff 1024:4.3.12-alt5uxx.1 +- [4.3.12-114-g2dbde98] + +* Tue May 31 2011 Alexey I. Froloff 1024:4.3.12-alt5uxx +- [4.3.12] +- Completion changes: + + _girar_remote: updated for "task add [task_id [subtask_id]]" syntax + +* Wed May 11 2011 Alexey I. Froloff 1024:4.3.11-alt3 +- [4.3.11-135-gd770d25] +- zshrc: dropped cp/mv/rm aliases +- Completion changes: + + _girar_info, _girar_remote: updated for new "task ls" syntax + +* Fri Dec 31 2010 Alexey I. Froloff 1:4.3.11-alt2 +- Completion changes: + + _ri: updated for Ruby 1.9.2 + +* Fri Dec 24 2010 Alexey I. Froloff 1:4.3.11-alt1 +- 4.3.10+cvs20100813 -> 4.3.11+cvs20101221 +- spec cleanup + +* Sat Aug 14 2010 Alexey I. Froloff 1:4.3.10-alt6 +- 4.3.10+cvs20100603 -> 4.3.10+cvs20100813 + +* Sat Jun 05 2010 Alexey I. Froloff 1:4.3.10-alt5 +- 4.3.10+cvs20100312 -> 4.3.10+cvs20100603 + +* Fri Mar 12 2010 Alexey I. Froloff 1:4.3.10-alt4 +- 4.3.10 release -> 4.3.10+cvs20100312 +- Enabled POSIX capability module (zsh/cap) +- Relocated tests to %%check section, enabled by default +- Completon: + + sudo: fixed -e option processing (closes: #22354) + +* Sat Nov 21 2009 Alexey I. Froloff 1:4.3.10-alt3 +- Completion changes: + + _girar: fixed typos, updated for new girar-utils + + _girar_remote: updated for recent girar changes + + _ri: rewritten for Ruby 1.9 support +- Startup files: + + zshrc: do not process /etc/bashrc (closes: #14641) + +* Sun Jul 19 2009 Alexey I. Froloff 1:4.3.10-alt2 +- New completion: gear-import, girar-remote, girar-clone and girar-import +- Do not package Completion/Linux/_rpmbuild, we have better completion + in _rpm function. + +* Sun Jun 21 2009 Alexey Tourbin 1:4.3.10-alt1 +- 4.3.9+cvs20081211 -> 4.3.10 release +- removed install_info scriptlets + +* Sun Jun 21 2009 Alexey I. Froloff 1:4.3.9-alt3 +- fixed building with new toolchain +- _apt: dropped "install package/release" syntax (closes: #19590) + +* Mon Apr 13 2009 Alexey I. Froloff 1:4.3.9-alt2 +- Completion fixes and improvements: + + rpm: fix --target option argument completion (closes: #9478) + + rsync: fix rsync remote file completion (closes: #12958) + + screen: fix session completion (closes: #16702) + + man: strip section and extension from all manual pages + + sudo: use it's built-in "secure path" for command completion + + gear-changelog: add -r/--rules option, --no-spec -> --no-specfile + + added (somewhat buggy) gear-buildreq, gear-hsh and gear-rpm + + aptitude: use _deb_packages on Debian, _rpm_packages otherwise + + aptitude: on "install" offer "avail" packages instead of "uninstalled" + + apt,aptitude: on "install" also offer package files (closes: #19590) + +* Mon Dec 15 2008 Alexey Tourbin 1:4.3.9-alt1 +- 4.3.6+cvs20080814 -> 4.3.9+cvs20081211 +- fixed building with new glibc/without stropts.h + +* Wed Aug 20 2008 Alexey Tourbin 1:4.3.6-alt2 +- 4.3.6 -> 4.3.6+cvs20080814 +- enabled new gdbm module +- new and updated ALT completion (Alexey I. Froloff): _add_changelog, + _control, _control_d, _gear, _sisyphus_check, _sisyphus_check_tests + +* Sun Apr 13 2008 Alexey Tourbin 1:4.3.6-alt1 +- 4.3.4/20070419 -> 4.3.6 +- _files: new style "list-dirs-first" (Sir Raorn) + +* Sat Jul 21 2007 Alexey Tourbin 1:4.3.4-alt3 +- fixed 'use-ip 1' completion for ssh hosts (Sir Raorn) +- changed src.rpm packaging to keep separate tarball with cvs snapshot + +* Thu Jun 14 2007 Alexey Tourbin 1:4.3.4-alt2 +- 4.3.4/20070419 -> 4.3.4/20070612 + +* Fri Apr 20 2007 Alexey Tourbin 1:4.3.4-alt1 +- 4.3.2/20070402 -> 4.3.4/20070419 + +* Thu Apr 05 2007 Alexey Tourbin 1:4.3.2-alt7 +- updated git completion (Nikolai Weibull, Sergey Vlasov) + +* Tue Apr 03 2007 Alexey Tourbin 1:4.3.2-alt6 +- updated to 4.3.2/20070402 +- fixed gdb completion (Sir Raorn) + +* Sun Jan 28 2007 Alexey Tourbin 1:4.3.2-alt5 +- following immediately after alt4, this release fixes a few recently + introduced problems with $'...' POSIX quotes + +* Sat Jan 27 2007 Alexey Tourbin 1:4.3.2-alt4 +- 4.3.2/20061219 -> 4.3.2/20070126 + +* Wed Dec 20 2006 Alexey Tourbin 1:4.3.2-alt3 +- zsh-4_3_2 at change 23071 (20061219) + +* Tue Nov 14 2006 Alexey Tourbin 1:4.3.2-alt2 +- zsh-4_3_2 at change 22998 (20061113) +- fixes for git completion (Sergey Vlasov) +- gear completion (Sir Raorn) + +* Sun Oct 22 2006 Alexey Tourbin 1:4.3.2-alt1 +- imported cvs sources with parsecvs, applied my changes to the source + tree and built with gear +- this release is based on the most recent cvs snapshot; among other + changes, multibyte IO is now the default; if you have any problems + in non-utf8 console, try "unsetopt multibyte" +- added completion for rpm-utils and hasher (Sir Raorn) + +* Sun Jul 30 2006 Alexey Tourbin 1:4.3.2-alt0.2 +- 4.3.2/20060414 -> 4.3.2/20060619 (20060730 snapshot has problems) +- added _pmount completion (Sir Raorn, #9501) +- updated _git completion from http://git.bitwi.se/dot-home.git (#9696) +- added setsid(1) compmletion (#9791) + +* Mon Apr 17 2006 Alexey Tourbin 1:4.3.2-alt0.1 +- 4.3.0/20051014 -> 4.3.2/20060414 + +* Sat Oct 15 2005 Alexey Tourbin 1:4.3.0-alt0.4 +- 4.3.0/20050926 -> 4.3.0/20051014 +- disabled POSIX capabilities (see #8142) +- added nodeps facility to _rpm completion in rpmb mode (#8193) + +* Mon Sep 26 2005 Alexey Tourbin 1:4.3.0-alt0.3 +- 4.3.0/20050718 -> 4.3.0/20050926 +- enabled unicode support (#7655) +- fixed typo in _rpm completion (#7398) +- added _ri completion (Sir Raorn, #7593) +- added reinstall facility to _apt completion (Sir Raorn, #7406) + +* Tue Jul 19 2005 Alexey Tourbin 1:4.3.0-alt0.2 +- 4.3.0/20050611 -> 4.3.0/20050718 (no unicode support yet) +- builtin "mkdir -p" failure on symlinks fixed upstream (#7368) +- added _known_hosts completion to _ssh (Sir Raorn, #5429) + +* Sat Jun 11 2005 Alexey Tourbin 1:4.3.0-alt0.1 +- 4.2.5/20050506 -> 4.3.0/20050611 (no unicode support yet) + +* Mon May 09 2005 Alexey Tourbin 1:4.2.5-alt2 +- 4.2.5 -> 4.2.5/cvs-20050506.patch (zsh-4_2-patches branch) +- rh-make-test-fail.patch: make "make test" failure not go ignored + +* Wed Apr 06 2005 Alexey Tourbin 1:4.2.5-alt1 +- 4.2.4/cvs-20050316.patch -> 4.2.5 + +* Wed Mar 16 2005 Alexey Tourbin 1:4.2.4-alt1 +- 4.2.1 -> 4.2.4/cvs-20050316.patch (zsh-4_2-patches branch) +- improved greatly apt and rpm completion (#5235) +- zlerc: enabled application keypad aliases for all terms (#1671) +- zshrc: enabled completion caching layer (affects apt, rpm, perldoc, etc.) +- alt-texinfo.patch: fixed @dircategory (Utilities -> Shells) +- packaged zshguide separately + +* Mon Aug 23 2004 Alexey Tourbin 1:4.2.1-alt1 +- 4.2.0 -> 4.2.1 +- build explicitly --with-tcsetpgrp +- ssh remote_files problem was fixed upstream +- enhanced tla completion accepted upstream (#3887) +- mdk-rebootin-completion.patch: completion for rebootin(8) +- mdk-default-path.patch: /usr/ucb -> /usr/X11R6/bin +- removed PATH assignment from zshenv + +* Wed Mar 24 2004 Alexey Tourbin 1:4.2.0-alt1 +- 4.2.0-pre-4 -> 4.2.0 +- %%_datadir/zsh/functions -> %%_datadir/zsh, + /usr/local/zsh/site-functions -> /usr/local/share/zsh +- ssh-remote_files.patch: enhance quoting because of _call_program/eval +- zshrc et al: a bit more tolerant of unmounted /usr + +* Sun Mar 14 2004 Alexey Tourbin 1:4.2.0-alt0.3 +- 4.2.0-pre-4 +- explicitly --enable-cap + +* Fri Mar 05 2004 Alexey Tourbin 1:4.2.0-alt0.2 +- 4.2.0-pre-2 +- explicitly --enable-pcre + +* Sat Feb 28 2004 Alexey Tourbin 1:4.2.0-alt0.1 +- 4.2.0-pre-1 +- updated patches; alt-tinfo.patch needed no more +- reworked apt4rpm completion stuff + +* Thu Feb 12 2004 Alexey Tourbin 1:4.1.1-alt4 +- fixed a bug introduced by apt4rpm.patch optimization (#3458) +- enabled maildir support in MAIL and MAILPATH +- updated dependencies on install/uninstall_info +- fixed _customdocdir misusage +- yodl is not required to build docs (pre-generated stuff is used) +- old changelogs (for 3.x) and other stuff from zsh-doc not packaged +- zsh-doc merged into zsh package + +* Thu Nov 06 2003 Alexey Tourbin 1:4.1.1-alt3 +- rh-serial.patch: make it work on serial ports (rh bug #56353) +- apt4rpm.patch: optimized for speed (2x gain) +- built explicitly without libnsl/NIS support +- pcre module built, with dependency tuning, so that zsh can reside in /bin +- /etc/zshrc: + + history size increased: 1000 -> 9999 + + more history options enabled + + use ~/.zsh_history instead of ~/.bash_history + + moved zle configuration options to /etc/zlerc + + synchronized /etc/zlerc with /etc/inputrc + + dropped ZLS_COLORS stuff as it caused problems + +* Sat Aug 23 2003 Alexey Tourbin 1:4.1.1-alt2 +- alt-zpty.patch: pty handling reworked, all tests pass; Sisyphus release +- alt-rpm-specific.patch: --lastchange option +- /etc/zshrc: + + additional key bindings (#0001609) + + /etc/bashrc is now sourced in interactive mode +- cvs-20030819-completion.patch: new completion functions available for + iptables, cdrecord, chmod, nice, nmap, rar, sabcmd, and ogg* +- zsh and zsh-doc packages use the same docdir + +* Sun Aug 03 2003 Alexey Tourbin 1:4.1.1-alt1 +- 4.1.1; revision of all patches: + + dropped: sigpipe.patch, cd.patch (needed no more) + + updated: apt4rpm.patch +- zshenv: TMPPREFIX=$HOME/tmp/zsh +- path versioning dropped (/usr/lib/zsh/%%version/zsh -> /usr/lib/zsh etc.) +- Daedalus release (some tests fail) + +* Fri Sep 27 2002 Rider 1:4.0.6-alt1 +- 4.0.6 + +* Mon Jul 01 2002 Dmitry V. Levin 4.0.4-alt5 +- Patched to link with libtinfo. +- Fixed %%pre/%%preun/%%postun scripts. +- Resurrected %%serial to enable upgrades (lost by rider). + +* Wed Jan 09 2002 Rider 4.0.4-alt4 +- _apt bugfix + +* Sun Jan 06 2002 Rider 4.0.4-alt3 +- apt-get completion fix (specific for ALT) +- /etc/zshrc cleanup + +* Thu Jan 03 2002 Rider 4.0.4-alt2 +- russian summary and description + +* Sat Nov 03 2001 Rider 4.0.4-alt1 +- 4.0.4 + +* Fri Aug 24 2001 Sergey Budnevitch 4.0.2-alt2 +- Updated user guide +- minor changes in config files + +* Sun Jul 15 2001 Sergey Budnevitch 4.0.2-alt1 +- 4.0.2 +- Remove duplicated documentation +- Sigpipe patch +- Several patches from development branch + +* Wed Feb 07 2001 Dmitry V. Levin 3.1.9-ipl5mdk +- Fixed invalid dependences on /usr/local/*. + +* Fri Jan 26 2001 Peter 'Nidd' Novodvorsky 3.1.9-ipl4mdk +- IPLabs Linux Team adaptations. + +* Sat Aug 26 2000 Chmouel Boudjnah 3.1.9-4mdk +- Set some %%config file to (noreplace). +- Make -A to complete spec file for _rpm. + +* Thu Jul 20 2000 Chmouel Boudjnah 3.1.9-3mdk +- Get /usr/share/man also in the completion for perl manpages. +- BM. + +* Wed Jul 5 2000 Chmouel Boudjnah 3.1.9-2mdk +- Fix buildroot hardcoded in binary. + +* Wed Jun 21 2000 Chmouel Boudjnah 3.1.9-1mdk +- Use makeinstall macros (not easy this one :\). +- 3.1.9. + +* Mon Jun 5 2000 Chmouel Boudjnah 3.1.8-1mdk +- 3.1.8. + +* Sun May 28 2000 Chmouel Boudjnah 3.1.6dev22-3mdk +- Fix path (%%prefix/ucb -> %%_bindir/X11) +- Fix keys (home-end-suppr-delete) directly in the zsh binary. + +* Sun Apr 16 2000 Chmouel Boudjnah 3.1.6dev22-2mdk +- Remove doble .so in %%_libdir/zsh/*. + +* Thu Apr 13 2000 Chmouel Boudjnah 3.1.6dev22-1mdk +- 3.1.6dev22. + +* Fri Mar 31 2000 Chmouel Boudjnah 3.1.6dev20-3mdk +- Fix completion of rpm with -qp*. + +* Mon Mar 27 2000 Chmouel Boudjnah 3.1.6dev20-2mdk +- Upgrade zshguide. + +* Sat Mar 25 2000 Chmouel Boudjnah 3.1.6dev20-1mdk +- 3.1.6-dev20 + +* Wed Mar 22 2000 Chmouel Boudjnah 3.1.6dev19-3mdk +- Move global configuration here. +- Adjust groups. + +* Tue Feb 22 2000 Chmouel Boudjnah 3.1.6dev19-2mdk +- Add new zshguide from pws. +- Separate the doc to the doc package + +* Sun Feb 20 2000 Chmouel Boudjnah 3.1.6dev19-1mdk +- Clean Up spec (thanks specs-helper). +- Remove all our patchs (now all is commited to upstream main). +- 3.1.6dev19. + +* Fri Feb 18 2000 Chmouel Boudjnah 3.1.6dev18-3mdk +- Recompile with glibc2.1.3 (first one). + +* Thu Feb 17 2000 Chmouel Boudjnah 3.1.6dev18-2mdk +- Add --freshen completion. + +* Tue Feb 15 2000 Chmouel Boudjnah 3.1.6dev18-1mdk +- Fix descriptions and summary. +- 3.1.6dev18. + +* Thu Feb 10 2000 Chmouel Boudjnah 3.1.6dev17-2mdk +- Remove Makefile in %%doc. +- BuildRequires: autoconf tetex. +- Lot of modications in the default config as suggested by Bart + Schaefer . +- 3.1.6dev17. + +* Mon Jan 24 2000 Chmouel Boudjnah 3.1.6dev16-1mdk +- dev16. +- Redo the tar_archive patchs. + +* Tue Jan 18 2000 Chmouel Boudjnah 3.1.6dev15-1mdk +- dev15. +- Fix doc generation with dev15. +- remove META-FAQ. +- disable lfs on sparc. + +* Thu Jan 6 2000 Chmouel Boudjnah 3.1.6dev14-1mdk +- dev14 (note the name change). + +* Mon Jan 3 2000 Chmouel Boudjnah 3.1.6pws13-3mdk +- Remove temporary files. + +* Fri Dec 31 1999 Chmouel Boudjnah +- 3.1.6pws13 (mainly bug fixes). +- fix %%post. +- fix rpm completion + +* Thu Dec 09 1999 Chmouel Boudjnah +- 3.1.6pws11 (mainly bug fixes). + +* Tue Dec 7 1999 Chmouel Boudjnah +- Add run-help and perl-build the documentation. + +* Tue Nov 30 1999 Francis Galiegue +- Completion machine patch - we use GNU make and GNU tar +- Small fix to %%post script + +* Tue Nov 30 1999 Chmouel Boudjnah +- 3.1.6pws10 +- Fix zprofile. +- Clean-up Franciseries. +- Clean-up specs. + +* Mon Nov 29 1999 Francis Galiegue +- Grrr... Rebuilt on kenobi, toy ain't a cooker + +* Mon Nov 29 1999 Francis Galiegue +- Completion system now handles bzip2'ed manpages and tarballs +- Some cool options + +* Wed Nov 10 1999 Chmouel Boudjnah +- Add zshguide.txt to documentation. + +* Thu Oct 07 1999 Chmouel Boudjnah +- Fix bug in %%_sysconfdir/zsh use USERNAME instead of USER. +- Improve %%_sysconfdir/z* to source the /etc/profile.d/ files. + +* Mon Oct 04 1999 Chmouel Boudjnah +- 3.1.6-pws6 +- Fix bad link. +- Fix bad manpages. + +* Tue Aug 17 1999 Thierry Vignaud +- fix typo in examples directory name + +* Sun Aug 8 1999 Chmouel Boudjnah +- Copy documentation (yes a lot). +- Remove the completion machine and put them in [[ {etc,root}(skel|files) ]] package. + +* Sat Aug 7 1999 Chmouel Boudjnah +- By defaut we launch the completion machine. +- Put zsh in %%_bindir/ +- Rewrite of Spec file for this new major version.