- Backport zsh-ab4d62eb975a4c4c51dd35822665050e2ddc6918.patch
and zsh-4c89849c98172c951a9def3690e8647dae76308f.patch and add autoconf to build requirements to make the package build with GCC 14. [boo#1225958] If the request is OK, please forward it to Factory soon so that we can switch the default compiler. OBS-URL: https://build.opensuse.org/package/show/shells/zsh?expand=0&rev=251
This commit is contained in:
commit
5b73c0aed4
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
## Default LFS
|
||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.gem filter=lfs diff=lfs merge=lfs -text
|
||||
*.gz filter=lfs diff=lfs merge=lfs -text
|
||||
*.jar filter=lfs diff=lfs merge=lfs -text
|
||||
*.lz filter=lfs diff=lfs merge=lfs -text
|
||||
*.lzma filter=lfs diff=lfs merge=lfs -text
|
||||
*.obscpio filter=lfs diff=lfs merge=lfs -text
|
||||
*.oxt filter=lfs diff=lfs merge=lfs -text
|
||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.txz filter=lfs diff=lfs merge=lfs -text
|
||||
*.whl filter=lfs diff=lfs merge=lfs -text
|
||||
*.xz filter=lfs diff=lfs merge=lfs -text
|
||||
*.zip filter=lfs diff=lfs merge=lfs -text
|
||||
*.zst filter=lfs diff=lfs merge=lfs -text
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
34
dotzshrc.rh
Normal file
34
dotzshrc.rh
Normal file
@ -0,0 +1,34 @@
|
||||
#
|
||||
# .zshrc is sourced in interactive shells.
|
||||
# It should contain commands to set up aliases,
|
||||
# functions, options, key bindings, etc.
|
||||
#
|
||||
|
||||
autoload -U compinit
|
||||
compinit
|
||||
|
||||
#allow tab completion in the middle of a word
|
||||
setopt COMPLETE_IN_WORD
|
||||
|
||||
## keep background processes at full speed
|
||||
#setopt NOBGNICE
|
||||
## restart running processes on exit
|
||||
#setopt HUP
|
||||
|
||||
## history
|
||||
#setopt APPEND_HISTORY
|
||||
## for sharing history between zsh processes
|
||||
#setopt INC_APPEND_HISTORY
|
||||
#setopt SHARE_HISTORY
|
||||
|
||||
## never ever beep ever
|
||||
#setopt NO_BEEP
|
||||
|
||||
## automatically decide when to page a list of completions
|
||||
#LISTMAX=0
|
||||
|
||||
## disable mail checking
|
||||
#MAILCHECK=0
|
||||
|
||||
# autoload -U colors
|
||||
#colors
|
26
egrep-deprecation.patch
Normal file
26
egrep-deprecation.patch
Normal file
@ -0,0 +1,26 @@
|
||||
Index: zsh-5.9/Test/D07multibyte.ztst
|
||||
===================================================================
|
||||
--- zsh-5.9.orig/Test/D07multibyte.ztst
|
||||
+++ zsh-5.9/Test/D07multibyte.ztst
|
||||
@@ -6,7 +6,7 @@
|
||||
unset -m LC_\*
|
||||
mb_ok=
|
||||
langs=(en_{US,GB}.{UTF-,utf}8 en.UTF-8
|
||||
- $(locale -a 2>/dev/null | egrep 'utf8|UTF-8'))
|
||||
+ ${(M)$(locale -a 2>/dev/null):#*.(utf8|UTF-8)} )
|
||||
for LANG in $langs; do
|
||||
if [[ é = ? ]]; then
|
||||
mb_ok=1
|
||||
Index: zsh-5.9/Test/E01options.ztst
|
||||
===================================================================
|
||||
--- zsh-5.9.orig/Test/E01options.ztst
|
||||
+++ zsh-5.9/Test/E01options.ztst
|
||||
@@ -651,7 +651,7 @@
|
||||
>noktarg1
|
||||
>0 1
|
||||
|
||||
- showopt() { setopt | egrep 'localoptions|ksharrays'; }
|
||||
+ showopt() { setopt | grep -E 'localoptions|ksharrays'; }
|
||||
f1() { setopt localoptions ksharrays; showopt }
|
||||
f2() { setopt ksharrays; showopt }
|
||||
setopt kshoptionprint
|
104
pipe-less-and-signals-handling.patch
Normal file
104
pipe-less-and-signals-handling.patch
Normal file
@ -0,0 +1,104 @@
|
||||
diff --git a/Src/jobs.c b/Src/jobs.c
|
||||
index 707374297..76c762ee5 100644
|
||||
--- a/Src/jobs.c
|
||||
+++ b/Src/jobs.c
|
||||
@@ -544,16 +544,14 @@ update_job(Job jn)
|
||||
|
||||
if (isset(MONITOR)) {
|
||||
pid_t pgrp = gettygrp(); /* get process group of tty */
|
||||
+ int deadpgrp = (mypgrp != pgrp && inforeground && pgrp > 1 &&
|
||||
+ kill(-pgrp, 0) == -1 && errno == ESRCH);
|
||||
|
||||
/* is this job in the foreground of an interactive shell? */
|
||||
if (mypgrp != pgrp && inforeground &&
|
||||
- (jn->gleader == pgrp ||
|
||||
- (pgrp > 1 &&
|
||||
- (kill(-pgrp, 0) == -1 && errno == ESRCH)))) {
|
||||
+ ((jn->gleader == pgrp && signalled) || deadpgrp)) {
|
||||
if (list_pipe) {
|
||||
- if (somestopped || (pgrp > 1 &&
|
||||
- kill(-pgrp, 0) == -1 &&
|
||||
- errno == ESRCH)) {
|
||||
+ if (somestopped || deadpgrp) {
|
||||
attachtty(mypgrp);
|
||||
/* check window size and adjust if necessary */
|
||||
adjustwinsize(0);
|
||||
@@ -566,6 +564,12 @@ update_job(Job jn)
|
||||
* when the job is finally deleted.
|
||||
*/
|
||||
jn->stat |= STAT_ATTACH;
|
||||
+ /*
|
||||
+ * If we're in shell jobs on the right side of a pipeline
|
||||
+ * we should treat it like a job in the current shell.
|
||||
+ */
|
||||
+ if (inforeground == 2)
|
||||
+ inforeground = 1;
|
||||
}
|
||||
/* If we have `foo|while true; (( x++ )); done', and hit
|
||||
* ^C, we have to stop the loop, too. */
|
||||
@@ -1488,10 +1492,7 @@ addproc(pid_t pid, char *text, int aux, struct timeval *bgtime,
|
||||
* set it for that, too.
|
||||
*/
|
||||
if (gleader != -1) {
|
||||
- if (jobtab[thisjob].stat & STAT_CURSH)
|
||||
- jobtab[thisjob].gleader = gleader;
|
||||
- else
|
||||
- jobtab[thisjob].gleader = pid;
|
||||
+ jobtab[thisjob].gleader = gleader;
|
||||
if (list_pipe_job_used != -1)
|
||||
jobtab[list_pipe_job_used].gleader = gleader;
|
||||
/*
|
||||
@@ -1500,7 +1501,7 @@ addproc(pid_t pid, char *text, int aux, struct timeval *bgtime,
|
||||
*/
|
||||
last_attached_pgrp = gleader;
|
||||
} else if (!jobtab[thisjob].gleader)
|
||||
- jobtab[thisjob].gleader = pid;
|
||||
+ jobtab[thisjob].gleader = pid;
|
||||
/* attach this process to end of process list of current job */
|
||||
pnlist = &jobtab[thisjob].procs;
|
||||
}
|
||||
@@ -2506,6 +2507,7 @@ bin_fg(char *name, char **argv, Options ops, int func)
|
||||
jobtab[job].stat &= ~STAT_CURSH;
|
||||
}
|
||||
if ((stopped = (jobtab[job].stat & STAT_STOPPED))) {
|
||||
+ /* WIFCONTINUED will makerunning() again at killjb() */
|
||||
makerunning(jobtab + job);
|
||||
if (func == BIN_BG) {
|
||||
/* Set $! to indicate this was backgrounded */
|
||||
|
||||
diff --git a/Src/exec.c b/Src/exec.c
|
||||
index 2422dae91..d4e681887 100644
|
||||
--- a/Src/exec.c
|
||||
+++ b/Src/exec.c
|
||||
@@ -1899,8 +1899,12 @@ execpline(Estate state, wordcode slcode, int how, int last1)
|
||||
break;
|
||||
}
|
||||
}
|
||||
- else if (subsh && jn->stat & STAT_STOPPED)
|
||||
- thisjob = newjob;
|
||||
+ else if (subsh && jn->stat & STAT_STOPPED) {
|
||||
+ if (thisjob == newjob)
|
||||
+ makerunning(jn);
|
||||
+ else
|
||||
+ thisjob = newjob;
|
||||
+ }
|
||||
else
|
||||
break;
|
||||
}
|
||||
diff --git a/Src/jobs.c b/Src/jobs.c
|
||||
index 76c762ee5..4863962b9 100644
|
||||
--- a/Src/jobs.c
|
||||
+++ b/Src/jobs.c
|
||||
@@ -564,12 +564,6 @@ update_job(Job jn)
|
||||
* when the job is finally deleted.
|
||||
*/
|
||||
jn->stat |= STAT_ATTACH;
|
||||
- /*
|
||||
- * If we're in shell jobs on the right side of a pipeline
|
||||
- * we should treat it like a job in the current shell.
|
||||
- */
|
||||
- if (inforeground == 2)
|
||||
- inforeground = 1;
|
||||
}
|
||||
/* If we have `foo|while true; (( x++ )); done', and hit
|
||||
* ^C, we have to stop the loop, too. */
|
13
trim-unneeded-completions.patch
Normal file
13
trim-unneeded-completions.patch
Normal file
@ -0,0 +1,13 @@
|
||||
Index: zsh-5.0.2/Src/Zle/complete.mdd
|
||||
===================================================================
|
||||
--- zsh-5.0.2.orig/Src/Zle/complete.mdd
|
||||
+++ zsh-5.0.2/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/Base/*/* Completion/Linux/*/* Completion/openSUSE/*/* Completion/Unix/*/* Completion/X/*/* Completion/Zsh/*/*'
|
||||
|
||||
moddeps="zsh/zle"
|
||||
|
8
zlogin.rhs
Normal file
8
zlogin.rhs
Normal file
@ -0,0 +1,8 @@
|
||||
#
|
||||
# /etc/zlogin and .zlogin are sourced in login shells. It should
|
||||
# contain commands that should be executed only in
|
||||
# login shells. It should be used to set the terminal
|
||||
# type and run a series of external commands (fortune,
|
||||
# msgs, from, etc).
|
||||
#
|
||||
|
7
zlogout.rhs
Normal file
7
zlogout.rhs
Normal file
@ -0,0 +1,7 @@
|
||||
#
|
||||
#
|
||||
# /etc/zlogout and ~/.zlogout are run when an interactive session ends
|
||||
#
|
||||
#
|
||||
|
||||
clear
|
7
zprofile
Normal file
7
zprofile
Normal file
@ -0,0 +1,7 @@
|
||||
# we source the general profile here so we dont have to
|
||||
# reimplement it
|
||||
setopt nonomatch
|
||||
source /etc/profile
|
||||
unsetopt nonomatch
|
||||
# put your own login shell specific configuration below
|
||||
# this line
|
22
zprofile.rhs
Normal file
22
zprofile.rhs
Normal file
@ -0,0 +1,22 @@
|
||||
#
|
||||
# /etc/zprofile and ~/.zprofile are run for login shells
|
||||
#
|
||||
|
||||
PATH="$PATH:$HOME/bin"
|
||||
export PATH
|
||||
|
||||
_src_etc_profile()
|
||||
{
|
||||
# Make /etc/profile happier, and have possible ~/.zshenv options like
|
||||
# NOMATCH ignored.
|
||||
#
|
||||
emulate -L ksh
|
||||
|
||||
# source profile
|
||||
if [ -f /etc/profile ]; then
|
||||
source /etc/profile
|
||||
fi
|
||||
}
|
||||
_src_etc_profile
|
||||
|
||||
unset -f _src_etc_profile
|
53
zsh-4c89849c98172c951a9def3690e8647dae76308f.patch
Normal file
53
zsh-4c89849c98172c951a9def3690e8647dae76308f.patch
Normal file
@ -0,0 +1,53 @@
|
||||
From 4c89849c98172c951a9def3690e8647dae76308f Mon Sep 17 00:00:00 2001
|
||||
From: Florian Weimer <fweimer@redhat.com>
|
||||
Date: Fri, 8 Dec 2023 21:58:07 +0100
|
||||
Subject: [PATCH] 52383: Avoid incompatible pointer types in terminfo global variable checks
|
||||
Upstream: Committed, this is a backport
|
||||
References: boo#1225958
|
||||
|
||||
* Florian Weimer: 52383: configure.ac: Avoid incompatible pointer
|
||||
types in terminfo global variable checks
|
||||
|
||||
|
||||
---
|
||||
configure.ac | 12 ++++++------
|
||||
2 files changed, 9 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 2a8221e1f..2871dcb7c 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -1768,27 +1768,27 @@ if test x$zsh_cv_path_term_header != xnone; then
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(if boolcodes is available)
|
||||
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = boolcodes; puts(*test);]])],[AC_DEFINE(HAVE_BOOLCODES) boolcodes=yes],[boolcodes=no])
|
||||
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)boolcodes; puts(*test);]])],[AC_DEFINE(HAVE_BOOLCODES) boolcodes=yes],[boolcodes=no])
|
||||
AC_MSG_RESULT($boolcodes)
|
||||
|
||||
AC_MSG_CHECKING(if numcodes is available)
|
||||
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = numcodes; puts(*test);]])],[AC_DEFINE(HAVE_NUMCODES) numcodes=yes],[numcodes=no])
|
||||
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)numcodes; puts(*test);]])],[AC_DEFINE(HAVE_NUMCODES) numcodes=yes],[numcodes=no])
|
||||
AC_MSG_RESULT($numcodes)
|
||||
|
||||
AC_MSG_CHECKING(if strcodes is available)
|
||||
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = strcodes; puts(*test);]])],[AC_DEFINE(HAVE_STRCODES) strcodes=yes],[strcodes=no])
|
||||
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)strcodes; puts(*test);]])],[AC_DEFINE(HAVE_STRCODES) strcodes=yes],[strcodes=no])
|
||||
AC_MSG_RESULT($strcodes)
|
||||
|
||||
AC_MSG_CHECKING(if boolnames is available)
|
||||
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = boolnames; puts(*test);]])],[AC_DEFINE(HAVE_BOOLNAMES) boolnames=yes],[boolnames=no])
|
||||
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)boolnames; puts(*test);]])],[AC_DEFINE(HAVE_BOOLNAMES) boolnames=yes],[boolnames=no])
|
||||
AC_MSG_RESULT($boolnames)
|
||||
|
||||
AC_MSG_CHECKING(if numnames is available)
|
||||
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = numnames; puts(*test);]])],[AC_DEFINE(HAVE_NUMNAMES) numnames=yes],[numnames=no])
|
||||
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)numnames; puts(*test);]])],[AC_DEFINE(HAVE_NUMNAMES) numnames=yes],[numnames=no])
|
||||
AC_MSG_RESULT($numnames)
|
||||
|
||||
AC_MSG_CHECKING(if strnames is available)
|
||||
- AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = strnames; puts(*test);]])],[AC_DEFINE(HAVE_STRNAMES) strnames=yes],[strnames=no])
|
||||
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[$term_includes]], [[char **test = (char **)strnames; puts(*test);]])],[AC_DEFINE(HAVE_STRNAMES) strnames=yes],[strnames=no])
|
||||
AC_MSG_RESULT($strnames)
|
||||
|
||||
dnl There are apparently defective terminal library headers on some
|
BIN
zsh-5.9.tar.xz
(Stored with Git LFS)
Normal file
BIN
zsh-5.9.tar.xz
(Stored with Git LFS)
Normal file
Binary file not shown.
11
zsh-5.9.tar.xz.asc
Normal file
11
zsh-5.9.tar.xz.asc
Normal file
@ -0,0 +1,11 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQEzBAABCAAdFiEEfKfsqvBiFrkPiUFGrPgUbK6Mu8QFAmJ///QACgkQrPgUbK6M
|
||||
u8RgPgf+N/yJ+ltJouICaa8fYiYxN0uuYhCeBDVmHuPdwFBPl/Fa5npXkuvo2s/0
|
||||
1ho5VfuU08B856GcBpraeuNqN74WNaaZ1E2P8ZFFg1Uw3xjxyg1lqjvkJZrrYURm
|
||||
tZNoov33jeyKbyTaNxTHgIujyBE3Uu40wpLoIOL3jO4PV0useJyw1jj5CsnvhN1b
|
||||
3S4X99gre3J0SahNDTGltmCwtO/nL3uZh0+FYNagJMF9ZTV9/BQEjBlozBWU+sPa
|
||||
rBpbr9A4p/AY2GQti03EmP/HXicaX397aRlBqgfjSRkMJpvaDnVnuXY53uLVOKdW
|
||||
sg6FYiIrO54Q6bEzJV9JfhdvqQtU4A==
|
||||
=BNV9
|
||||
-----END PGP SIGNATURE-----
|
553
zsh-ab4d62eb975a4c4c51dd35822665050e2ddc6918.patch
Normal file
553
zsh-ab4d62eb975a4c4c51dd35822665050e2ddc6918.patch
Normal file
@ -0,0 +1,553 @@
|
||||
From ab4d62eb975a4c4c51dd35822665050e2ddc6918 Mon Sep 17 00:00:00 2001
|
||||
From: Nicholas Vinson <nvinson234@gmail.com>
|
||||
Date: Wed, 21 Sep 2022 09:22:11 +0900
|
||||
Subject: [PATCH] 50641: use 'int main()' in test C-codes in configure
|
||||
Upstream: Committed, this is a backport
|
||||
References: boo#1225958
|
||||
|
||||
2022-09-21 Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
|
||||
|
||||
* Nicholas Vinson: 50641: aczsh.m4, configure.ac: use 'int main()'
|
||||
in test C-codes in configure
|
||||
|
||||
|
||||
---
|
||||
aczsh.m4 | 64 +++++++++++++++++------------------
|
||||
configure.ac | 94 ++++++++++++++++++++++------------------------------
|
||||
3 files changed, 77 insertions(+), 86 deletions(-)
|
||||
|
||||
diff --git a/aczsh.m4 b/aczsh.m4
|
||||
index 1209ac6140..b31236020c 100644
|
||||
--- a/aczsh.m4
|
||||
+++ b/aczsh.m4
|
||||
@@ -44,6 +44,7 @@ AC_DEFUN(zsh_64_BIT_TYPE,
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
+int
|
||||
main()
|
||||
{
|
||||
$1 foo = 0;
|
||||
@@ -118,7 +119,6 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS
|
||||
AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AS_MESSAGE_LOG_FD) &&
|
||||
AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AS_MESSAGE_LOG_FD); then
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
-#include <stdlib.h>
|
||||
#ifdef HPUX10DYNAMIC
|
||||
#include <dl.h>
|
||||
#define RTLD_LAZY BIND_DEFERRED
|
||||
@@ -146,29 +146,30 @@ char *zsh_gl_sym_addr ;
|
||||
#define RTLD_GLOBAL 0
|
||||
#endif
|
||||
|
||||
+int
|
||||
main()
|
||||
{
|
||||
void *handle1, *handle2;
|
||||
void *(*zsh_getaddr1)(), *(*zsh_getaddr2)();
|
||||
void *sym1, *sym2;
|
||||
handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
|
||||
- if(!handle1) exit(1);
|
||||
+ if(!handle1) return(1);
|
||||
handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
|
||||
- if(!handle2) exit(1);
|
||||
+ if(!handle2) return(1);
|
||||
zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1");
|
||||
zsh_getaddr2 = (void *(*)()) dlsym(handle2, "${us}zsh_getaddr2");
|
||||
sym1 = zsh_getaddr1();
|
||||
sym2 = zsh_getaddr2();
|
||||
- if(!sym1 || !sym2) exit(1);
|
||||
- if(sym1 != sym2) exit(1);
|
||||
+ if(!sym1 || !sym2) return(1);
|
||||
+ if(sym1 != sym2) return(1);
|
||||
dlclose(handle1);
|
||||
handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
|
||||
- if(!handle1) exit(1);
|
||||
+ if(!handle1) return(1);
|
||||
zsh_getaddr1 = (void *(*)()) dlsym(handle1, "${us}zsh_getaddr1");
|
||||
sym1 = zsh_getaddr1();
|
||||
- if(!sym1) exit(1);
|
||||
- if(sym1 != sym2) exit(1);
|
||||
- exit(0);
|
||||
+ if(!sym1) return(1);
|
||||
+ if(sym1 != sym2) return(1);
|
||||
+ return(0);
|
||||
}
|
||||
]])],[zsh_cv_shared_$1=yes],
|
||||
[zsh_cv_shared_$1=no],
|
||||
@@ -200,7 +201,6 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS
|
||||
AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AS_MESSAGE_LOG_FD) &&
|
||||
AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AS_MESSAGE_LOG_FD); then
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
-#include <stdlib.h>
|
||||
#ifdef HPUX10DYNAMIC
|
||||
#include <dl.h>
|
||||
#define RTLD_LAZY BIND_DEFERRED
|
||||
@@ -228,19 +228,19 @@ char *zsh_gl_sym_addr ;
|
||||
#define RTLD_GLOBAL 0
|
||||
#endif
|
||||
|
||||
-
|
||||
+int
|
||||
main()
|
||||
{
|
||||
void *handle1, *handle2;
|
||||
int (*fred1)(), (*fred2)();
|
||||
handle1 = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
|
||||
- if(!handle1) exit(1);
|
||||
+ if(!handle1) return(1);
|
||||
handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
|
||||
- if(!handle2) exit(1);
|
||||
+ if(!handle2) return(1);
|
||||
fred1 = (int (*)()) dlsym(handle1, "${us}fred");
|
||||
fred2 = (int (*)()) dlsym(handle2, "${us}fred");
|
||||
- if(!fred1 || !fred2) exit(1);
|
||||
- exit((*fred1)() != 42 || (*fred2)() != 69);
|
||||
+ if(!fred1 || !fred2) return(1);
|
||||
+ return((*fred1)() != 42 || (*fred2)() != 69);
|
||||
}
|
||||
]])],[zsh_cv_sys_dynamic_clash_ok=yes],
|
||||
[zsh_cv_sys_dynamic_clash_ok=no],
|
||||
@@ -276,7 +276,6 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS
|
||||
AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest2.c 1>&AS_MESSAGE_LOG_FD) &&
|
||||
AC_TRY_COMMAND($DLLD -o conftest2.$DL_EXT $LDFLAGS $DLLDFLAGS conftest2.o $LIBS 1>&AS_MESSAGE_LOG_FD); then
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
-#include <stdlib.h>
|
||||
#ifdef HPUX10DYNAMIC
|
||||
#include <dl.h>
|
||||
#define RTLD_LAZY BIND_DEFERRED
|
||||
@@ -304,17 +303,18 @@ char *zsh_gl_sym_addr ;
|
||||
#define RTLD_GLOBAL 0
|
||||
#endif
|
||||
|
||||
+int
|
||||
main()
|
||||
{
|
||||
void *handle;
|
||||
int (*barneysym)();
|
||||
handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
|
||||
- if(!handle) exit(1);
|
||||
+ if(!handle) return(1);
|
||||
handle = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
|
||||
- if(!handle) exit(1);
|
||||
+ if(!handle) return(1);
|
||||
barneysym = (int (*)()) dlsym(handle, "${us}barney");
|
||||
- if(!barneysym) exit(1);
|
||||
- exit((*barneysym)() != 69);
|
||||
+ if(!barneysym) return(1);
|
||||
+ return((*barneysym)() != 69);
|
||||
}
|
||||
]])],[zsh_cv_sys_dynamic_rtld_global=yes],
|
||||
[zsh_cv_sys_dynamic_rtld_global=no],
|
||||
@@ -346,7 +346,6 @@ AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS conftest1.o $LIBS
|
||||
save_ldflags=$LDFLAGS
|
||||
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS"
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
-#include <stdlib.h>
|
||||
#ifdef HPUX10DYNAMIC
|
||||
#include <dl.h>
|
||||
#define RTLD_LAZY BIND_DEFERRED
|
||||
@@ -374,15 +373,16 @@ char *zsh_gl_sym_addr ;
|
||||
#define RTLD_GLOBAL 0
|
||||
#endif
|
||||
|
||||
+int
|
||||
main()
|
||||
{
|
||||
void *handle;
|
||||
int (*barneysym)();
|
||||
handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
|
||||
- if(!handle) exit(1);
|
||||
+ if(!handle) return(1);
|
||||
barneysym = (int (*)()) dlsym(handle, "${us}barney");
|
||||
- if(!barneysym) exit(1);
|
||||
- exit((*barneysym)() != 69);
|
||||
+ if(!barneysym) return(1);
|
||||
+ return((*barneysym)() != 69);
|
||||
}
|
||||
|
||||
int fred () { return 42; }
|
||||
@@ -420,7 +420,6 @@ elif
|
||||
save_ldflags=$LDFLAGS
|
||||
LDFLAGS="$LDFLAGS $EXTRA_LDFLAGS -s"
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
-#include <stdlib.h>
|
||||
#ifdef HPUX10DYNAMIC
|
||||
#include <dl.h>
|
||||
#define RTLD_LAZY BIND_DEFERRED
|
||||
@@ -448,15 +447,16 @@ char *zsh_gl_sym_addr ;
|
||||
#define RTLD_GLOBAL 0
|
||||
#endif
|
||||
|
||||
+int
|
||||
main()
|
||||
{
|
||||
void *handle;
|
||||
int (*barneysym)();
|
||||
handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
|
||||
- if(!handle) exit(1);
|
||||
+ if(!handle) return(1);
|
||||
barneysym = (int (*)()) dlsym(handle, "${us}barney");
|
||||
- if(!barneysym) exit(1);
|
||||
- exit((*barneysym)() != 69);
|
||||
+ if(!barneysym) return(1);
|
||||
+ return((*barneysym)() != 69);
|
||||
}
|
||||
|
||||
int fred () { return 42; }
|
||||
@@ -488,7 +488,6 @@ echo 'int fred () { return 42; }' > conftest1.c
|
||||
if AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest1.c 1>&AS_MESSAGE_LOG_FD) &&
|
||||
AC_TRY_COMMAND($DLLD -o conftest1.$DL_EXT $LDFLAGS $DLLDFLAGS -s conftest1.o $LIBS 1>&AS_MESSAGE_LOG_FD); then
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
-#include <stdlib.h>
|
||||
#ifdef HPUX10DYNAMIC
|
||||
#include <dl.h>
|
||||
#define RTLD_LAZY BIND_DEFERRED
|
||||
@@ -516,15 +515,16 @@ char *zsh_gl_sym_addr ;
|
||||
#define RTLD_GLOBAL 0
|
||||
#endif
|
||||
|
||||
+int
|
||||
main()
|
||||
{
|
||||
void *handle;
|
||||
int (*fredsym)();
|
||||
handle = dlopen("./conftest1.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL);
|
||||
- if(!handle) exit(1);
|
||||
+ if(!handle) return(1);
|
||||
fredsym = (int (*)()) dlsym(handle, "${us}fred");
|
||||
- if(!fredsym) exit(1);
|
||||
- exit((*fredsym)() != 42);
|
||||
+ if(!fredsym) return(1);
|
||||
+ return((*fredsym)() != 42);
|
||||
}
|
||||
]])],[zsh_cv_sys_dynamic_strip_lib=yes],
|
||||
[zsh_cv_sys_dynamic_strip_lib=no],
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 890ef8dd27..074141d38d 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -585,7 +585,7 @@ fi
|
||||
dnl Checking if compiler correctly cast signed to unsigned.
|
||||
AC_CACHE_CHECK(if signed to unsigned casting is broken,
|
||||
zsh_cv_c_broken_signed_to_unsigned_casting,
|
||||
-[AC_RUN_IFELSE([AC_LANG_SOURCE([[main(){return((int)(unsigned char)((char) -1) == 255);}]])],[zsh_cv_c_broken_signed_to_unsigned_casting=yes],[zsh_cv_c_broken_signed_to_unsigned_casting=no],[zsh_cv_c_broken_signed_to_unsigned_casting=no])])
|
||||
+[AC_RUN_IFELSE([AC_LANG_SOURCE([[int main(){return((int)(unsigned char)((char) -1) == 255);}]])],[zsh_cv_c_broken_signed_to_unsigned_casting=yes],[zsh_cv_c_broken_signed_to_unsigned_casting=no],[zsh_cv_c_broken_signed_to_unsigned_casting=no])])
|
||||
AH_TEMPLATE([BROKEN_SIGNED_TO_UNSIGNED_CASTING],
|
||||
[Define to 1 if compiler incorrectly cast signed to unsigned.])
|
||||
if test x$zsh_cv_c_broken_signed_to_unsigned_casting = xyes; then
|
||||
@@ -1046,7 +1046,7 @@ else
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/types.h>
|
||||
|
||||
-main() { return sizeof(off_t) < 8; }
|
||||
+int main() { return sizeof(off_t) < 8; }
|
||||
]])],[zsh_cv_off_t_is_64_bit=yes],[zsh_cv_off_t_is_64_bit=no],[zsh_cv_off_t_is_64_bit=no])])
|
||||
if test x$zsh_cv_off_t_is_64_bit = xyes; then
|
||||
AC_DEFINE(OFF_T_IS_64_BIT)
|
||||
@@ -1056,7 +1056,7 @@ main() { return sizeof(off_t) < 8; }
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <sys/types.h>
|
||||
|
||||
-main() { return sizeof(ino_t) < 8; }
|
||||
+int main() { return sizeof(ino_t) < 8; }
|
||||
]])],[zsh_cv_ino_t_is_64_bit=yes],[zsh_cv_ino_t_is_64_bit=no],[zsh_cv_ino_t_is_64_bit=no])])
|
||||
if test x$zsh_cv_ino_t_is_64_bit = xyes; then
|
||||
AC_DEFINE(INO_T_IS_64_BIT)
|
||||
@@ -1369,7 +1369,7 @@ zsh_cv_func_realpath_accepts_null,
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
],[
|
||||
-exit(!realpath("/", (char*)0));
|
||||
+return(!realpath("/", (char*)0));
|
||||
])],
|
||||
[zsh_cv_func_realpath_accepts_null=yes],
|
||||
[zsh_cv_func_realpath_accepts_null=no],
|
||||
@@ -1393,10 +1393,9 @@ AC_CACHE_CHECK(if tgetent accepts NULL,
|
||||
zsh_cv_func_tgetent_accepts_null,
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <fcntl.h>
|
||||
-#include <stdlib.h>
|
||||
int tgetent(char *, char *);
|
||||
char *tgetstr(char *, char **);
|
||||
-main()
|
||||
+int main()
|
||||
{
|
||||
char buf[4096];
|
||||
int r1 = tgetent(buf, "vt100");
|
||||
@@ -1407,7 +1406,7 @@ main()
|
||||
tgetstr("cl", &u);
|
||||
creat("conftest.tgetent", 0640);
|
||||
}
|
||||
- exit((r1 != r2) || r2 == -1);
|
||||
+ return((r1 != r2) || r2 == -1);
|
||||
}
|
||||
]])],[if test -f conftest.tgetent; then
|
||||
zsh_cv_func_tgetent_accepts_null=yes
|
||||
@@ -1421,10 +1420,9 @@ AC_CACHE_CHECK(if tgetent returns 0 on success,
|
||||
zsh_cv_func_tgetent_zero_success,
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <fcntl.h>
|
||||
-#include <stdlib.h>
|
||||
int tgetent(char *, char*);
|
||||
char *tgetstr(char *, char **);
|
||||
-main()
|
||||
+int main()
|
||||
{
|
||||
char buf[4096];
|
||||
int r1 = tgetent(buf, "!@#$%^&*");
|
||||
@@ -1435,7 +1433,7 @@ main()
|
||||
tgetstr("cl", &u);
|
||||
creat("conftest.tgetent0", 0640);
|
||||
}
|
||||
- exit(r1 == r2);
|
||||
+ return(r1 == r2);
|
||||
}
|
||||
]])],[if test -f conftest.tgetent0; then
|
||||
zsh_cv_func_tgetent_zero_success=yes
|
||||
@@ -1869,8 +1867,7 @@ zsh_cv_rlim_t_is_longer,
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include <sys/resource.h>
|
||||
-#include <stdlib.h>
|
||||
-main(){struct rlimit r;exit(sizeof(r.rlim_cur) <= sizeof(long));}]])],[zsh_cv_rlim_t_is_longer=yes],[zsh_cv_rlim_t_is_longer=no],[zsh_cv_rlim_t_is_longer=yes])])
|
||||
+int main(){struct rlimit r;return(sizeof(r.rlim_cur) <= sizeof(long));}]])],[zsh_cv_rlim_t_is_longer=yes],[zsh_cv_rlim_t_is_longer=no],[zsh_cv_rlim_t_is_longer=yes])])
|
||||
if test x$zsh_cv_rlim_t_is_longer = xyes; then
|
||||
AC_CACHE_CHECK(if rlim_t is a quad,
|
||||
zsh_cv_rlim_t_is_quad_t,
|
||||
@@ -1880,13 +1877,12 @@ if test x$zsh_cv_rlim_t_is_longer = xyes; then
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <sys/resource.h>
|
||||
-#include <stdlib.h>
|
||||
-main() {
|
||||
+int main() {
|
||||
struct rlimit r;
|
||||
char buf[20];
|
||||
r.rlim_cur = 0;
|
||||
sprintf(buf, "%qd", r.rlim_cur);
|
||||
- exit(strcmp(buf, "0"));
|
||||
+ return(strcmp(buf, "0"));
|
||||
}]])],[zsh_cv_rlim_t_is_quad_t=yes],[zsh_cv_rlim_t_is_quad_t=no],[zsh_cv_rlim_t_is_quad_t=no])])
|
||||
if test x$zsh_cv_rlim_t_is_quad_t = xyes; then
|
||||
AC_DEFINE(RLIM_T_IS_QUAD_T)
|
||||
@@ -1903,8 +1899,7 @@ else
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include <sys/resource.h>
|
||||
-#include <stdlib.h>
|
||||
- main(){struct rlimit r;r.rlim_cur=-1;exit(r.rlim_cur<0);}]])],[zsh_cv_type_rlim_t_is_unsigned=yes],[zsh_cv_type_rlim_t_is_unsigned=no],[zsh_cv_type_rlim_t_is_unsigned=no])])
|
||||
+ int main(){struct rlimit r;r.rlim_cur=-1;return(r.rlim_cur<0);}]])],[zsh_cv_type_rlim_t_is_unsigned=yes],[zsh_cv_type_rlim_t_is_unsigned=no],[zsh_cv_type_rlim_t_is_unsigned=no])])
|
||||
if test x$zsh_cv_type_rlim_t_is_unsigned = xyes; then
|
||||
AC_DEFINE(RLIM_T_IS_UNSIGNED)
|
||||
DEFAULT_RLIM_T="unsigned $DEFAULT_RLIM_T"
|
||||
@@ -2187,9 +2182,8 @@ zsh_cv_sys_fifo,
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
-#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
-main()
|
||||
+int main()
|
||||
{
|
||||
char c;
|
||||
int fd;
|
||||
@@ -2200,18 +2194,18 @@ main()
|
||||
#else
|
||||
if(mknod("/tmp/fifo$$", 0010600, 0) < 0)
|
||||
#endif
|
||||
- exit(1);
|
||||
+ return(1);
|
||||
pid = fork();
|
||||
if(pid < 0)
|
||||
- exit(1);
|
||||
+ return(1);
|
||||
if(pid) {
|
||||
fd = open("/tmp/fifo$$", O_RDONLY);
|
||||
- exit(fd < 0 || read(fd, &c, 1) != 1 || c != 'x');
|
||||
+ return(fd < 0 || read(fd, &c, 1) != 1 || c != 'x');
|
||||
}
|
||||
fd = open("/tmp/fifo$$", O_WRONLY);
|
||||
ret = (fd < 0 || write(fd, "x", 1) < 1);
|
||||
unlink("/tmp/fifo$$");
|
||||
- exit(ret);
|
||||
+ return(ret);
|
||||
}
|
||||
]])],[zsh_cv_sys_fifo=yes],[zsh_cv_sys_fifo=no],[zsh_cv_sys_fifo=yes])
|
||||
])
|
||||
@@ -2289,8 +2283,7 @@ zsh_cv_sys_link,
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
-#include <stdlib.h>
|
||||
-main()
|
||||
+int main()
|
||||
{
|
||||
int ret;
|
||||
char *tmpfile, *newfile;
|
||||
@@ -2299,11 +2292,11 @@ main()
|
||||
unlink(tmpfile);
|
||||
unlink(newfile);
|
||||
if(creat(tmpfile, 0644) < 0)
|
||||
- exit(1);
|
||||
+ return(1);
|
||||
ret = link(tmpfile, newfile);
|
||||
unlink(tmpfile);
|
||||
unlink(newfile);
|
||||
- exit(ret<0);
|
||||
+ return(ret<0);
|
||||
}
|
||||
]])],[zsh_cv_sys_link=yes],[zsh_cv_sys_link=no],[zsh_cv_sys_link=yes])])
|
||||
AH_TEMPLATE([HAVE_LINK],
|
||||
@@ -2322,12 +2315,11 @@ zsh_cv_sys_killesrch,
|
||||
#include <unistd.h>
|
||||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
-#include <stdlib.h>
|
||||
-main()
|
||||
+int main()
|
||||
{
|
||||
int pid = (getpid() + 10000) & 0xffffff;
|
||||
while (pid && (kill(pid, 0) == 0 || errno != ESRCH)) pid >>= 1;
|
||||
- exit(errno!=ESRCH);
|
||||
+ return(errno!=ESRCH);
|
||||
}
|
||||
]])],[zsh_cv_sys_killesrch=yes],[zsh_cv_sys_killesrch=no],[zsh_cv_sys_killesrch=yes])])
|
||||
AH_TEMPLATE([BROKEN_KILL_ESRCH],
|
||||
@@ -2348,12 +2340,11 @@ if test x$signals_style = xPOSIX_SIGNALS; then
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
-#include <stdlib.h>
|
||||
int child=0;
|
||||
void handler(sig)
|
||||
int sig;
|
||||
{if(sig==SIGCHLD) child=1;}
|
||||
-main() {
|
||||
+int main() {
|
||||
struct sigaction act;
|
||||
sigset_t set;
|
||||
int pid, ret;
|
||||
@@ -2368,7 +2359,7 @@ main() {
|
||||
if(pid>0) {
|
||||
sigemptyset(&set);
|
||||
ret=sigsuspend(&set);
|
||||
- exit(child==0);
|
||||
+ return(child==0);
|
||||
}
|
||||
}
|
||||
]])],[zsh_cv_sys_sigsuspend=yes],[zsh_cv_sys_sigsuspend=no],[zsh_cv_sys_sigsuspend=yes])])
|
||||
@@ -2400,15 +2391,14 @@ case "x$zsh_working_tcsetpgrp" in
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
-#include <stdlib.h>
|
||||
-main() {
|
||||
+int main() {
|
||||
int fd;
|
||||
int ret;
|
||||
fd=open("/dev/tty", O_RDWR);
|
||||
- if (fd < 0) exit(2);
|
||||
+ if (fd < 0) return(2);
|
||||
ret=tcsetpgrp(fd, tcgetpgrp(fd));
|
||||
- if (ret < 0) exit(1);
|
||||
- exit(0);
|
||||
+ if (ret < 0) return(1);
|
||||
+ return(0);
|
||||
}
|
||||
]])],[zsh_cv_sys_tcsetpgrp=yes],[
|
||||
case $? in
|
||||
@@ -2448,7 +2438,7 @@ if test x$ac_cv_func_getpwnam = xyes; then
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
-main() {
|
||||
+int main() {
|
||||
struct passwd *pw1, *pw2;
|
||||
char buf[1024], name[1024];
|
||||
sprintf(buf, "%d:%d", getpid(), rand());
|
||||
@@ -2456,7 +2446,7 @@ main() {
|
||||
if (pw1) strcpy(name, pw1->pw_name);
|
||||
sprintf(buf, "%d:%d", rand(), getpid());
|
||||
pw2=getpwnam(buf);
|
||||
- exit(pw1!=0 && pw2!=0 && !strcmp(name, pw2->pw_name));
|
||||
+ return(pw1!=0 && pw2!=0 && !strcmp(name, pw2->pw_name));
|
||||
}
|
||||
]])],[zsh_cv_sys_getpwnam_faked=no],[zsh_cv_sys_getpwnam_faked=yes],[zsh_cv_sys_getpwnam_faked=no])])
|
||||
if test x$zsh_cv_sys_getpwnam_faked = xyes; then
|
||||
@@ -2775,20 +2765,17 @@ elif test "x$dynamic" = xyes; then
|
||||
zsh_cv_sys_elf,
|
||||
[AC_RUN_IFELSE([AC_LANG_SOURCE([[/* Test for whether ELF binaries are produced */
|
||||
#include <fcntl.h>
|
||||
-#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
-main(argc, argv)
|
||||
-int argc;
|
||||
-char *argv[];
|
||||
+int main(int argc, char *argv[])
|
||||
{
|
||||
char b[4];
|
||||
int i = open(argv[0],O_RDONLY);
|
||||
if(i == -1)
|
||||
- exit(1); /* fail */
|
||||
+ return(1); /* fail */
|
||||
if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
|
||||
- exit(0); /* succeed (yes, it's ELF) */
|
||||
+ return(0); /* succeed (yes, it's ELF) */
|
||||
else
|
||||
- exit(1); /* fail */
|
||||
+ return(1); /* fail */
|
||||
}]])],[zsh_cv_sys_elf=yes],[zsh_cv_sys_elf=no],[zsh_cv_sys_elf=yes])])
|
||||
|
||||
# We use [0-9]* in case statements, so need to change quoting
|
||||
@@ -2924,13 +2911,12 @@ LDFLAGS="$old_LDFLAGS")
|
||||
AC_CACHE_CHECK(if your dlsym() needs a leading underscore,
|
||||
zsh_cv_func_dlsym_needs_underscore,
|
||||
[echo failed >conftestval && cat >conftest.c <<EOM
|
||||
-fred () { }
|
||||
+void fred () { }
|
||||
EOM
|
||||
AC_TRY_COMMAND($CC -c $CFLAGS $CPPFLAGS $DLCFLAGS conftest.c 1>&AS_MESSAGE_LOG_FD) &&
|
||||
AC_TRY_COMMAND($DLLD $LDFLAGS $DLLDFLAGS -o conftest.$DL_EXT conftest.o 1>&AS_MESSAGE_LOG_FD) &&
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include <stdio.h>
|
||||
-#include <stdlib.h>
|
||||
#ifdef HPUX10DYNAMIC
|
||||
#include <dl.h>
|
||||
#define RTLD_LAZY BIND_DEFERRED
|
||||
@@ -2957,16 +2943,16 @@ char *zsh_gl_sym_addr ;
|
||||
|
||||
extern int fred() ;
|
||||
|
||||
-main()
|
||||
+int main()
|
||||
{
|
||||
void * handle ;
|
||||
void * symbol ;
|
||||
FILE *f=fopen("conftestval", "w");
|
||||
- if (!f) exit(1);
|
||||
+ if (!f) return(1);
|
||||
handle = dlopen("./conftest.$DL_EXT", RTLD_LAZY) ;
|
||||
if (handle == NULL) {
|
||||
fprintf (f, "dlopen failed") ;
|
||||
- exit(1);
|
||||
+ return(1);
|
||||
}
|
||||
symbol = dlsym(handle, "fred") ;
|
||||
if (symbol == NULL) {
|
||||
@@ -2974,13 +2960,13 @@ main()
|
||||
symbol = dlsym(handle, "_fred") ;
|
||||
if (symbol == NULL) {
|
||||
fprintf (f, "dlsym failed") ;
|
||||
- exit(1);
|
||||
+ return(1);
|
||||
}
|
||||
fprintf (f, "yes") ;
|
||||
}
|
||||
else
|
||||
fprintf (f, "no") ;
|
||||
- exit(0);
|
||||
+ return(0);
|
||||
}]])],[zsh_cv_func_dlsym_needs_underscore=`cat conftestval`],[zsh_cv_func_dlsym_needs_underscore=failed
|
||||
dynamic=no],[zsh_cv_func_dlsym_needs_underscore=no])])
|
||||
if test "x$zsh_cv_func_dlsym_needs_underscore" = xyes; then
|
15
zsh-osc-completion.patch
Normal file
15
zsh-osc-completion.patch
Normal file
@ -0,0 +1,15 @@
|
||||
Index: zsh-5.0.7/Completion/openSUSE/Command/_osc
|
||||
===================================================================
|
||||
--- zsh-5.0.7.orig/Completion/openSUSE/Command/_osc
|
||||
+++ zsh-5.0.7/Completion/openSUSE/Command/_osc
|
||||
@@ -16,8 +16,8 @@
|
||||
# version 0.2
|
||||
#
|
||||
|
||||
-OSC_BUILD_TARGETS="openSUSE_12.1 openSUSE_12.2 openSUSE_12.3 openSUSE_Tumbleweed openSUSE_Factory SLE_11_SP2"
|
||||
-OSC_PROJECTS="openSUSE:Factory openSUSE:Tumbleweed openSUSE:12.3 openSUSE:12.2 openSUSE:12.1"
|
||||
+OSC_BUILD_TARGETS="openSUSE_13.1 openSUSE_13.2 openSUSE_Tumbleweed openSUSE_Factory SLE_11_SP3 SLE_12"
|
||||
+OSC_PROJECTS="openSUSE:Factory openSUSE:Tumbleweed openSUSE:13.2 openSUSE:13.1"
|
||||
|
||||
# user defined variables $OSC_BUILD_TARGETS_EXTRA and
|
||||
# $OSC_PROJECTS_EXTRA can add to the project/build target list
|
1324
zsh.changes
Normal file
1324
zsh.changes
Normal file
File diff suppressed because it is too large
Load Diff
30
zsh.keyring
Normal file
30
zsh.keyring
Normal file
@ -0,0 +1,30 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
mQENBFwswugBCADdkzua9HwC8Ip5zh7Z0/nJGKbMyq+cobXArhHos40taeidn0+v
|
||||
HRES5y6PHR+h56c9TpmJEp/bLCHP5pLvcSz/ETz7+Kk82pld63pOHejSxAQCu7Wv
|
||||
1NwrTu6TyKlZsNG1oZBxx2LkEN6k8Wy+88DlQqZoXOXafmhF+Sms6gv9DXa029sv
|
||||
B07EehAx02T+b02QwVVG/Pq9austmsTd9EcNcVNRDneD2LcdxCllbS5IamjVa+NW
|
||||
oeKZVqbsO71uUolwBvshFSBLPsSY8EZdGApjazQcY0lgkaRA/QlMOisyq2mjV6FY
|
||||
JXHrlI3WWWK2vROjb35AHiHEE/EVgb5RVpxxABEBAAG0E2RhbmEgPGRhbmFAZGFu
|
||||
YS5pcz6JAU4EEwEIADgWIQR8p+yq8GIWuQ+JQUas+BRsroy7xAUCXCzC6AIbAwUL
|
||||
CQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRCs+BRsroy7xA5XB/93EQqzs0as07U+
|
||||
gmPDpvE7JwIY4TrcvAS7RHgJ4sE+arR5uTziHixiHBQQMedbfV51Jxgws6WL0Ko8
|
||||
7K8h9sN2UGnXIc1lWuQ2FDshrcpSHZvLxL4Z7WC3Rj/Dq3/nuZZyljWQNHxg4BlO
|
||||
EJqe67F5kT2OI591oxB6L1E6F8sVsgxD7gBCPVl/8CsyZ7wkyW/gMRqrlYolJhpS
|
||||
B5C1zKJzvULQJKXDCh9DUyi7cKFtPyYfYtRWfWhKGz5Dhtt9qvBlxJzZufZ9QNQt
|
||||
oPhNGF34QaLWTCLRbtoVbNq2NlxalZ5Byhg/0pBcQc2w4C70jSxF3c+2oMEGQIbc
|
||||
5GJFgLpZuQENBFwswugBCAD5rIYdlLWHOMw+stWTRNquu3SZr+v7RRzreV9fOKN+
|
||||
lUiqwicU2uCX39s/q+2wtF536r+IS/53DrMAW8sxf8eroK+MBnJYtP3U8BnB3mag
|
||||
bTJXMjng2ZqZXvxzetXLyXR+38f+6WbJtV0ByDeFQQJYsFxOag3r6etxrzpwRFm0
|
||||
PL440fc0nxOxhxWWJcR0RKTMX87ymipi9mETYeZi7h9B3cDw8aIUz2O3s45TtNlA
|
||||
NI1MNMU4sAsc5i+w0zJON9gT+rWDYFj6BiEqnRoSK2XDm+WaJa3FwgW1WnHPTe+E
|
||||
RJFGT58DICU3ta6cCQPavZz/KALyj8GBJ+PydelIAv2rABEBAAGJATYEGAEIACAW
|
||||
IQR8p+yq8GIWuQ+JQUas+BRsroy7xAUCXCzC6AIbDAAKCRCs+BRsroy7xOgxB/40
|
||||
sp9xFq8L/59yRTeXSskOsGk3aUlSnACofcRCGgDSXV5GwWJ/G0O8krhHOISJKuxc
|
||||
vA0wLFq0WB/EafrKAPTSkrnxmq8noT3c8MpnFRSXHq3sOXkB4nqVEmUu/AAA0TbC
|
||||
HcwhFQExvK7O+funxIGU5vqHFeQGJ0VcgC/KZUEMNtVV8aZGvn7JzSxEIwHVXGLu
|
||||
5H7TnNWzLzkzIDVY9IJpTutsc6RMvv6BV8ooWBHSgzmh0MTqEjwNarHAMuffrAjE
|
||||
zIO3qi0YCaxSDVf2jrWyYpB2QntplmUoubB9s/ngCqVb4A3B7JxPmJuL/0XMUThn
|
||||
WZLWFpbLimyoUCfHoehZ
|
||||
=dR/Y
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
306
zsh.spec
Normal file
306
zsh.spec
Normal file
@ -0,0 +1,306 @@
|
||||
#
|
||||
# spec file for package zsh
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
|
||||
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}
|
||||
%if 0%{?rhel_version} >= 700 || 0%{?centos_version} >= 700
|
||||
%global __requires_exclude ^/bin/zsh$
|
||||
%endif
|
||||
BuildRequires: libtermcap-devel
|
||||
BuildRequires: texi2html
|
||||
BuildRequires: texinfo
|
||||
%endif
|
||||
Name: zsh
|
||||
Version: 5.9
|
||||
Release: 0%{?dist}
|
||||
Summary: Shell with comprehensive completion
|
||||
License: MIT
|
||||
Group: System/Shells
|
||||
URL: https://www.zsh.org
|
||||
Source0: https://downloads.sourceforge.net/project/zsh/zsh/%{version}/zsh-%{version}.tar.xz
|
||||
Source1: https://downloads.sourceforge.net/project/zsh/zsh/%{version}/zsh-%{version}.tar.xz.asc
|
||||
Source2: %{name}.keyring
|
||||
Source3: zshrc
|
||||
Source4: zshenv
|
||||
Source5: zprofile
|
||||
Patch1: trim-unneeded-completions.patch
|
||||
# PATCH-FIX-OPENSUSE zsh-osc-completion.patch -- Fix openSUSE versions in osc completion
|
||||
Patch2: zsh-osc-completion.patch
|
||||
# PATCH-FIX-OPENSUSE: taken from https://www.zsh.org/mla/workers/2022/msg00956.html
|
||||
Patch3: egrep-deprecation.patch
|
||||
Patch4: pipe-less-and-signals-handling.patch
|
||||
Patch5: zsh-ab4d62eb975a4c4c51dd35822665050e2ddc6918.patch
|
||||
Patch6: zsh-4c89849c98172c951a9def3690e8647dae76308f.patch
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: groff
|
||||
BuildRequires: libcap-devel
|
||||
BuildRequires: ncurses-devel
|
||||
BuildRequires: pcre-devel
|
||||
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}
|
||||
Source11: zlogin.rhs
|
||||
Source12: zlogout.rhs
|
||||
Source13: zprofile.rhs
|
||||
Source14: zshrc.rhs
|
||||
Source15: zshenv.rhs
|
||||
Source16: dotzshrc.rh
|
||||
%endif
|
||||
%if 0%{?suse_version}
|
||||
BuildRequires: fdupes
|
||||
Requires(pre): %{install_info_prereq}
|
||||
%if 0%{?suse_version} >= 1210
|
||||
BuildRequires: makeinfo
|
||||
BuildRequires: texi2html
|
||||
%endif
|
||||
%else
|
||||
Requires(pre): /sbin/install-info
|
||||
Requires(pre): fileutils
|
||||
Requires(pre): grep
|
||||
%endif
|
||||
%if 0%{?suse_version} >= 1550
|
||||
Provides: /bin/zsh
|
||||
%endif
|
||||
|
||||
%description
|
||||
Zsh is a UNIX command interpreter (shell) that resembles the Korn shell
|
||||
(ksh). It is not completely compatible. It includes many enhancements,
|
||||
notably in the command-line editor, options for customizing its
|
||||
behavior, file name globbing, features to make C-shell (csh) users feel
|
||||
at home, and extra features drawn from tcsh (another `custom' shell).
|
||||
Zsh is well known for its command line completion.
|
||||
|
||||
%package htmldoc
|
||||
Summary: Zsh shell manual in HTML format
|
||||
Group: Documentation/HTML
|
||||
Provides: %{name}-html = %{version}
|
||||
Obsoletes: %{name}-html < %{version}
|
||||
|
||||
%description htmldoc
|
||||
The zsh shell is a command interpreter usable as an interactive login
|
||||
shell and as a shell script command processor. Zsh resembles the ksh
|
||||
shell (the Korn shell), but includes many enhancements. Zsh supports
|
||||
command line editing, built-in spelling correction, programmable
|
||||
command completion, shell functions (with autoloading), a history
|
||||
mechanism, and more.
|
||||
|
||||
This package contains the Zsh manual in HTML format.
|
||||
|
||||
%if 0%{?suse_version} >= 1550
|
||||
%package sh
|
||||
Summary: Handle behaviour of /bin/sh
|
||||
Group: System/Shells
|
||||
Requires: zsh = %{version}
|
||||
Conflicts: alternative(sh)
|
||||
Provides: alternative(sh)
|
||||
BuildArch: noarch
|
||||
|
||||
%description sh
|
||||
Use zsh as /bin/sh implementation.
|
||||
%endif
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%if 0%{?suse_version}
|
||||
%patch -P 1 -p1
|
||||
%endif
|
||||
%patch -P 2 -p1
|
||||
%patch -P 3 -p1
|
||||
%patch -P 4 -p1
|
||||
%patch -P 5 -p1
|
||||
%patch -P 6 -p1
|
||||
|
||||
# Remove executable bit
|
||||
chmod 0644 Etc/changelog2html.pl
|
||||
|
||||
# Fix bindir path in some files
|
||||
perl -p -i -e 's|%{_prefix}/local/bin|%{_bindir}|' \
|
||||
Doc/intro.ms Misc/globtests.ksh Misc/globtests \
|
||||
Misc/lete2ctl Util/check_exports Util/helpfiles \
|
||||
Util/reporter Functions/VCS_Info/test-repo-git-rebase-*
|
||||
|
||||
%build
|
||||
|
||||
%configure \
|
||||
%if 0%{?suse_version}
|
||||
--with-term-lib="ncursesw" \
|
||||
--enable-cflags="%{optflags} -fPIE %(ncursesw6-config --cflags)" \
|
||||
--enable-ldflags="%(ncursesw6-config --libs) -pie -Wl,-z,relro" \
|
||||
%endif
|
||||
--enable-fndir=%{_datadir}/%{name}/${version}/functions \
|
||||
--enable-site-fndir=%{_datadir}/%{name}/site-functions \
|
||||
--enable-function-subdirs \
|
||||
--enable-maildir-support \
|
||||
--with-tcsetpgrp \
|
||||
--enable-cap \
|
||||
--enable-multibyte \
|
||||
--enable-pcre \
|
||||
--enable-unicode9
|
||||
|
||||
# Copy _rpm completion from Redhat (bnc#900424)
|
||||
%if 0%{?suse_version}
|
||||
cp Completion/Redhat/Command/_rpm Completion/openSUSE/Command/_rpm
|
||||
%endif
|
||||
|
||||
make %{?_smp_mflags} all info html
|
||||
|
||||
# generate intro.ps
|
||||
groff -Tps -ms Doc/intro.ms > intro.ps
|
||||
|
||||
# better name for html documentation
|
||||
install -d -m 0755 Doc/htmldoc/
|
||||
mv Doc/*.html Doc/htmldoc
|
||||
|
||||
# remove some unwanted files in Etc/
|
||||
rm -f Etc/Makefile* Etc/*.yo
|
||||
|
||||
%install
|
||||
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version}
|
||||
%make_install install.info
|
||||
%else
|
||||
make DESTDIR=%{buildroot} install install.info
|
||||
%endif
|
||||
|
||||
install -m 0755 -Dd %{buildroot}/{etc,bin}
|
||||
|
||||
%if 0%{?suse_version}
|
||||
# install SUSE configuration
|
||||
install -m 0644 %{SOURCE3} %{SOURCE4} %{SOURCE5} %{buildroot}%{_sysconfdir}
|
||||
|
||||
# Create custom completion directory
|
||||
mkdir %{buildroot}%{_sysconfdir}/zsh_completion.d
|
||||
%endif
|
||||
|
||||
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}
|
||||
# install RHEL || CentOS || Fedora configuration
|
||||
for i in zlogin zlogout zprofile zshrc zshenv; do
|
||||
install -m 0644 $RPM_SOURCE_DIR/${i}.rhs %{buildroot}%{_sysconfdir}/$i
|
||||
done
|
||||
install -D -m 0644 %{SOURCE16} %{buildroot}%{_sysconfdir}/skel/.zshrc
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version} < 1550
|
||||
# link zsh binary
|
||||
%if 0%{?suse_version} || 0%{?rhel} <= 6
|
||||
ln -sf %{_bindir}/zsh %{buildroot}/bin/zsh
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# Remove versioned zsh binary
|
||||
rm -f %{buildroot}%{_bindir}/zsh-*
|
||||
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}
|
||||
rm -f %{buildroot}/%{_infodir}/dir
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version} >= 1110
|
||||
%fdupes %{buildroot}
|
||||
%endif
|
||||
|
||||
#
|
||||
# Create the symlink required for zsh-sh to handle /bin/sh
|
||||
#
|
||||
%if 0%{?suse_version} >= 1550
|
||||
ln -s %{_bindir}/zsh %{buildroot}%{_bindir}/sh
|
||||
%endif
|
||||
|
||||
%check
|
||||
%if 0%{?suse_version}
|
||||
make %{?_smp_mflags} check
|
||||
%else
|
||||
# FixMe: sometimes failing Test
|
||||
#+ fn:echo:2: write error: broken pipe
|
||||
#+ fn:2: write error: inappropriate ioctl for device
|
||||
mv Test/E01options.ztst Test/E01options.ztst.mvd
|
||||
%ifarch s390 s390x ppc ppc64
|
||||
( cd Test
|
||||
mkdir skipped
|
||||
mv Y*.ztst skipped )
|
||||
%endif
|
||||
ZTST_verbose=0 make test
|
||||
%endif
|
||||
|
||||
%preun
|
||||
%if ! 0%{?suse_version}
|
||||
if [ "$1" = 0 ] ; then
|
||||
/sbin/install-info --delete %{_infodir}/zsh.info.gz %{_infodir}/dir \
|
||||
--entry="* zsh: (zsh). An enhanced bourne shell."
|
||||
fi
|
||||
%endif
|
||||
|
||||
%post
|
||||
%if ! 0%{?suse_version}
|
||||
if [ ! -f %{_sysconfdir}/shells ]; then
|
||||
echo "%{_bindir}/zsh" > %{_sysconfdir}/shells
|
||||
else
|
||||
grep -q "^%{_bindir}/zsh$" %{_sysconfdir}/shells \
|
||||
|| echo "%{_bindir}/zsh" >> %{_sysconfdir}/shells
|
||||
fi
|
||||
|
||||
/sbin/install-info %{_infodir}/zsh.info.gz %{_infodir}/dir \
|
||||
--entry="* zsh: (zsh). An enhanced bourne shell."
|
||||
%endif
|
||||
|
||||
%postun
|
||||
%if ! 0%{?suse_version}
|
||||
if [ "$1" = 0 ] ; then
|
||||
if [ -f %{_sysconfdir}/shells ] ; then
|
||||
TmpFile=`%{_bindir}/mktemp /tmp/.zshrpmXXXXXX`
|
||||
grep -v '^%{_bindir}/zsh$' %{_sysconfdir}/shells > $TmpFile
|
||||
cp -f $TmpFile %{_sysconfdir}/shells
|
||||
rm -f $TmpFile
|
||||
chmod 644 %{_sysconfdir}/shells
|
||||
fi
|
||||
fi
|
||||
%endif
|
||||
|
||||
%files
|
||||
%doc ChangeLog FEATURES LICENCE MACHINES META-FAQ NEWS README
|
||||
%doc Etc/* intro.ps Misc/compctl-examples
|
||||
%config(noreplace) %{_sysconfdir}/zshrc
|
||||
%config(noreplace) %{_sysconfdir}/zshenv
|
||||
%config(noreplace) %{_sysconfdir}/zprofile
|
||||
%if 0%{?rhel_version} || 0%{?centos_version} || 0%{?fedora_version}
|
||||
%config(noreplace) %{_sysconfdir}/zlogin
|
||||
%config(noreplace) %{_sysconfdir}/zlogout
|
||||
%config(noreplace) %{_sysconfdir}/skel/.zshrc
|
||||
%endif
|
||||
|
||||
%if 0%{?suse_version}
|
||||
%dir %{_sysconfdir}/zsh_completion.d
|
||||
%endif
|
||||
|
||||
%{_bindir}/zsh
|
||||
%if 0%{?suse_version} < 1550
|
||||
%if 0%{?suse_version} || 0%{?rhel} <= 6
|
||||
/bin/zsh
|
||||
%endif
|
||||
%endif
|
||||
%{_libdir}/zsh/
|
||||
%{_datadir}/zsh/
|
||||
%{_infodir}/zsh.info*%{ext_info}
|
||||
%{_mandir}/man1/zsh*.1%{ext_man}
|
||||
|
||||
%files htmldoc
|
||||
%doc Doc/htmldoc/*
|
||||
|
||||
%if 0%{?suse_version} >= 1550
|
||||
%files sh
|
||||
%{_bindir}/sh
|
||||
%endif
|
||||
|
||||
%changelog
|
9
zshenv.rhs
Normal file
9
zshenv.rhs
Normal file
@ -0,0 +1,9 @@
|
||||
#
|
||||
# /etc/zshenv is sourced on all invocations of the
|
||||
# shell, unless the -f option is set. It should
|
||||
# contain commands to set the command search path,
|
||||
# plus other important environment variables.
|
||||
# .zshenv should not contain commands that produce
|
||||
# output or assume the shell is attached to a tty.
|
||||
#
|
||||
|
315
zshrc
Normal file
315
zshrc
Normal file
@ -0,0 +1,315 @@
|
||||
# Custom completion support via /etc/zsh_completion.d
|
||||
fpath=( $fpath /etc/zsh_completion.d )
|
||||
|
||||
# zsh line editing
|
||||
: ${ZSHEDIT:="emacs"}
|
||||
: ${TERM:=linux}
|
||||
|
||||
if [[ "$ZSHEDIT" == "vi" ]] then
|
||||
bindkey -v
|
||||
else
|
||||
bindkey -e
|
||||
bindkey "^[ " magic-space
|
||||
bindkey "^[!" expand-history
|
||||
fi
|
||||
|
||||
# Environment
|
||||
HISTSIZE=1000
|
||||
HISTFILE=${HOME}/.zsh_history
|
||||
SAVEHIST=500
|
||||
|
||||
# Prompt on the right side. zsh feature
|
||||
#RPROMPT="[%T]"
|
||||
|
||||
# Set/unset shell options
|
||||
setopt nocorrect
|
||||
setopt pushdtohome
|
||||
setopt autolist
|
||||
setopt nopromptcr
|
||||
setopt nocorrectall
|
||||
setopt autocd
|
||||
setopt recexact
|
||||
setopt longlistjobs
|
||||
setopt histignoredups
|
||||
setopt pushdsilent
|
||||
setopt appendhistory
|
||||
setopt histexpiredupsfirst
|
||||
setopt autopushd
|
||||
setopt pushdminus
|
||||
setopt extendedglob
|
||||
setopt rcquotes
|
||||
unsetopt bgnice
|
||||
unsetopt autoparamslash
|
||||
unsetopt hup
|
||||
|
||||
# Setup some basic programmable completions. To see more examples
|
||||
# of these, check out /usr/doc/packages/zsh/compctl-examples.
|
||||
# You you have a slow machine, you might want to comment the lines below
|
||||
# with compctl in, and comment the below two lines out.
|
||||
#
|
||||
# compctl -g '*(-/)' cd pushd
|
||||
# compctl -g '*(/)' rmdir dircmp
|
||||
# compctl -j -P % -x 's[-] p[1]' -k signals -- kill
|
||||
# compctl -j -P % fg bg wait jobs disown
|
||||
# compctl -A shift
|
||||
# compctl -caF type whence which
|
||||
# compctl -F unfunction
|
||||
# compctl -a unalias
|
||||
# compctl -v unset typeset declare vared readonly export integer
|
||||
# compctl -e disable
|
||||
# compctl -d enable
|
||||
#
|
||||
# The default way is the usage of the zsh built-in completer
|
||||
# Comment the two below lines out, if you are on a slow machine, and
|
||||
# comment the above compctl lines in.
|
||||
|
||||
autoload -U compinit
|
||||
compinit
|
||||
|
||||
# Completion so "cd ..<TAB>" -> "cd ../"
|
||||
# zstyle ':completion:*' special-dirs ..
|
||||
|
||||
# Online help
|
||||
unalias run-help 2>/dev/null || true
|
||||
autoload run-help
|
||||
|
||||
# Don't use zsh builtin which
|
||||
alias which >/dev/null && unalias which
|
||||
|
||||
# Common standard keypad and cursor
|
||||
bindkey "^[[2~" yank
|
||||
bindkey "^[[3~" delete-char
|
||||
|
||||
# History completion on pgup and pgdown
|
||||
autoload -U history-search-end
|
||||
zle -N history-beginning-search-backward-end history-search-end
|
||||
zle -N history-beginning-search-forward-end history-search-end
|
||||
bindkey "^[[5~" history-beginning-search-backward-end
|
||||
bindkey "^[[6~" history-beginning-search-forward-end
|
||||
|
||||
if [[ "$TERM" == "xterm" || "$TERM" == "xterm-256color" ]] then
|
||||
bindkey "^[2;5~" yank
|
||||
bindkey "^[3;5~" delete-char
|
||||
bindkey "^[5;5~" up-history
|
||||
bindkey "^[6;5~" down-history
|
||||
fi
|
||||
bindkey "^[[C" forward-char
|
||||
bindkey "^[[D" backward-char
|
||||
bindkey "^[[A" up-history
|
||||
bindkey "^[[B" down-history
|
||||
|
||||
# Avoid network problems
|
||||
# ... \177 (ASCII-DEL) and \010 (ASCII-BS)
|
||||
# do `backward-delete-char'
|
||||
# Note: `delete-char' is maped to \033[3~
|
||||
# Therefore xterm's responce on pressing
|
||||
# key Delete or KP-Delete should be
|
||||
# \033[3~ ... NOT \177
|
||||
bindkey "^?" backward-delete-char
|
||||
bindkey "^H" backward-delete-char
|
||||
|
||||
# Home and End
|
||||
if [[ "$TERM" == "xterm" || "$TERM" == "xterm-256color" ]] then
|
||||
# Normal keypad and cursor of xterm
|
||||
bindkey "^[[1~" history-search-backward
|
||||
bindkey "^[[4~" set-mark-command
|
||||
bindkey "^[[H" beginning-of-line
|
||||
bindkey "^[[F" end-of-line
|
||||
# Home and End of application keypad and cursor of xterm
|
||||
bindkey "^[OH" beginning-of-line
|
||||
bindkey "^[OF" end-of-line
|
||||
bindkey "^[O5H" beginning-of-line
|
||||
bindkey "^[O5F" end-of-line
|
||||
else
|
||||
if [[ "$TERM" == "kvt" ]] then
|
||||
bindkey "^[[1~" history-search-backward
|
||||
bindkey "^[[4~" set-mark-command
|
||||
bindkey "^[OH" beginning-of-line
|
||||
bindkey "^[OF" end-of-line
|
||||
else
|
||||
# TERM=linux or console
|
||||
bindkey "^[[1~" beginning-of-line
|
||||
bindkey "^[[4~" end-of-line
|
||||
fi
|
||||
fi
|
||||
|
||||
# Application keypad and cursor of xterm
|
||||
if [[ "$TERM" == "xterm" || "$TERM" == "xterm-256color" ]] then
|
||||
bindkey "^[OD" backward-char
|
||||
bindkey "^[OC" forward-char
|
||||
bindkey "^[OA" up-history
|
||||
bindkey "^[OB" down-history
|
||||
# DEC keyboard KP_F1 - KP_F4
|
||||
bindkey -s "^[OP" "^["
|
||||
bindkey "^[OQ" undo
|
||||
bindkey "^[OR" undefined-key
|
||||
bindkey "^[OS" kill-line
|
||||
fi
|
||||
if [[ "$TERM" == "gnome" ]] then
|
||||
# or gnome terminal F1 - F4
|
||||
bindkey -s "^[OP" "^["
|
||||
bindkey "^[OQ" undo
|
||||
bindkey "^[OR" undefined-key
|
||||
bindkey "^[OS" kill-line
|
||||
fi
|
||||
# Function keys F1 - F12
|
||||
if [[ "$TERM" == "linux" ]] then
|
||||
# On console the first five function keys
|
||||
bindkey "^[[[A" undefined-key
|
||||
bindkey "^[[[B" undefined-key
|
||||
bindkey "^[[[C" undefined-key
|
||||
bindkey "^[[[D" undefined-key
|
||||
bindkey "^[[[E" undefined-key
|
||||
else
|
||||
# The first five standard function keys
|
||||
bindkey "^[[11~" undefined-key
|
||||
bindkey "^[[12~" undefined-key
|
||||
bindkey "^[[13~" undefined-key
|
||||
bindkey "^[[14~" undefined-key
|
||||
bindkey "^[[15~" undefined-key
|
||||
fi
|
||||
bindkey "^[[17~" undefined-key
|
||||
bindkey "^[[18~" undefined-key
|
||||
bindkey "^[[19~" undefined-key
|
||||
bindkey "^[[20~" undefined-key
|
||||
bindkey "^[[21~" undefined-key
|
||||
# Note: F11, F12 are identical with Shift_F1 and Shift_F2
|
||||
bindkey "^[[23~" undefined-key
|
||||
bindkey "^[[24~" undefined-key
|
||||
|
||||
# Shift Function keys F1 - F12
|
||||
# identical with F11 - F22
|
||||
#
|
||||
# bindkey "^[[23~" undefined-key
|
||||
# bindkey "^[[24~" undefined-key
|
||||
bindkey "^[[25~" undefined-key
|
||||
bindkey "^[[26~" undefined-key
|
||||
# DEC keyboard: F15=^[[28~ is Help
|
||||
bindkey "^[[28~" undefined-key
|
||||
# DEC keyboard: F16=^[[29~ is Menu
|
||||
bindkey "^[[29~" undefined-key
|
||||
bindkey "^[[31~" undefined-key
|
||||
bindkey "^[[32~" undefined-key
|
||||
bindkey "^[[33~" undefined-key
|
||||
bindkey "^[[34~" undefined-key
|
||||
if [[ "$TERM" == "xterm" || "$TERM" == "xterm-256color" ]] then
|
||||
# Not common
|
||||
bindkey "^[[35~" undefined-key
|
||||
bindkey "^[[36~" undefined-key
|
||||
fi
|
||||
|
||||
if [[ "$TERM" == "xterm" || "$TERM" == "xterm-256color" ]] then
|
||||
# Application keypad and cursor of xterm
|
||||
# with NumLock ON
|
||||
#
|
||||
# Operators
|
||||
bindkey -s "^[Oo" "/"
|
||||
bindkey -s "^[Oj" "*"
|
||||
bindkey -s "^[Om" "-"
|
||||
bindkey -s "^[Ok" "+"
|
||||
bindkey -s "^[Ol" ","
|
||||
bindkey -s "^[OM" "\n"
|
||||
bindkey -s "^[On" "."
|
||||
# Numbers
|
||||
bindkey -s "^[Op" "0"
|
||||
bindkey -s "^[Oq" "1"
|
||||
bindkey -s "^[Or" "2"
|
||||
bindkey -s "^[Os" "3"
|
||||
bindkey -s "^[Ot" "4"
|
||||
bindkey -s "^[Ou" "5"
|
||||
bindkey -s "^[Ov" "6"
|
||||
bindkey -s "^[Ow" "7"
|
||||
bindkey -s "^[Ox" "8"
|
||||
bindkey -s "^[Oy" "9"
|
||||
fi
|
||||
|
||||
# EMACS line editing
|
||||
if [[ "$ZSHEDIT" == "emacs" ]] then
|
||||
# ... xterm application cursor
|
||||
if [[ "$TERM" == "xterm" || "$TERM" == "xterm-256color" ]] then
|
||||
bindkey "^[^[OD" backward-word
|
||||
bindkey "^[^[OC" forward-word
|
||||
bindkey "^[^[OA" up-history
|
||||
bindkey "^[^[OB" down-history
|
||||
bindkey "^^[OD" backward-char
|
||||
bindkey "^^[OC" forward-char
|
||||
bindkey "^^[OA" up-history
|
||||
bindkey "^^[OB" down-history
|
||||
fi
|
||||
# Standard cursor
|
||||
bindkey "^[^[[D" backward-word
|
||||
bindkey "^[^[[C" forward-word
|
||||
bindkey "^[^[[A" up-history
|
||||
bindkey "^[^[[B" down-history
|
||||
bindkey "^^[[D" backward-char
|
||||
bindkey "^^[[C" forward-char
|
||||
bindkey "^^[[A" up-history
|
||||
bindkey "^^[[B" down-history
|
||||
fi
|
||||
|
||||
# Aliases exported from /etc/bash.bashrc
|
||||
alias ..='cd ..'
|
||||
alias ...='cd ../..'
|
||||
alias beep='echo -en "\007"'
|
||||
alias cd..='cd ..'
|
||||
alias dir='ls -l'
|
||||
alias egrep='egrep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias grep='grep --color=auto'
|
||||
alias ip='ip --color=auto'
|
||||
alias l='ls -alF'
|
||||
alias la='ls -la'
|
||||
alias ll='ls -l'
|
||||
alias ls-l='ls -l'
|
||||
alias md='mkdir -p'
|
||||
alias o=less
|
||||
alias rd=rmdir
|
||||
alias unmount='echo "Error: Try the command: umount" 1>&2; false'
|
||||
alias which-command=whence
|
||||
alias you='if test "$EUID" = 0 ; then /sbin/yast2 online_update ; else su - -c "/sbin/yast2 online_update" ; fi'
|
||||
|
||||
test -s $HOME/.alias && . $HOME/.alias
|
||||
|
||||
#
|
||||
# Colored file listings
|
||||
#
|
||||
if test -x /usr/bin/dircolors ; then
|
||||
#
|
||||
# set up the color-ls environment variables:
|
||||
#
|
||||
if test -f $HOME/.dir_colors ; then
|
||||
eval "`/usr/bin/dircolors -b $HOME/.dir_colors`"
|
||||
elif test -f /etc/DIR_COLORS ; then
|
||||
eval "`/usr/bin/dircolors -b /etc/DIR_COLORS`"
|
||||
fi
|
||||
fi
|
||||
|
||||
# ls color option depends on the terminal
|
||||
# If LS_COLORS is set but empty, the terminal has no colors.
|
||||
if test "${LS_COLORS+empty}" = "${LS_COLORS:+empty}" ; then
|
||||
LS_OPTIONS=--color=tty
|
||||
else
|
||||
LS_OPTIONS=--color=none
|
||||
fi
|
||||
|
||||
if test "$UID" = 0 ; then
|
||||
LS_OPTIONS="-A -N $LS_OPTIONS -T 0"
|
||||
else
|
||||
LS_OPTIONS="-N $LS_OPTIONS -T 0"
|
||||
fi
|
||||
|
||||
# Avoid trouble with Emacs shell mode
|
||||
if test "$EMACS" = "t" ; then
|
||||
LS_OPTIONS='-N --color=none -T 0';
|
||||
fi
|
||||
export LS_OPTIONS
|
||||
|
||||
# Set GPG_TTY for curses pinentry
|
||||
# (see man gpg-agent and bnc#619295)
|
||||
if test -t && type -p tty > /dev/null 2>&1 ; then
|
||||
GPG_TTY="`tty`"
|
||||
export GPG_TTY
|
||||
fi
|
||||
|
||||
# Read custom system-wide config if exists
|
||||
test -s /etc/zsh.zshrc.local && . /etc/zsh.zshrc.local
|
50
zshrc.rhs
Normal file
50
zshrc.rhs
Normal file
@ -0,0 +1,50 @@
|
||||
#
|
||||
# /etc/zshrc is sourced in interactive shells. It
|
||||
# should contain commands to set up aliases, functions,
|
||||
# options, key bindings, etc.
|
||||
#
|
||||
|
||||
## shell functions
|
||||
#setenv() { export $1=$2 } # csh compatibility
|
||||
|
||||
# Set prompts
|
||||
PROMPT='[%n@%m]%~%# ' # default prompt
|
||||
#RPROMPT=' %~' # prompt for right side of screen
|
||||
|
||||
# bindkey -v # vi key bindings
|
||||
# bindkey -e # emacs key bindings
|
||||
bindkey ' ' magic-space # also do history expansion on space
|
||||
|
||||
# Provide pathmunge for /etc/profile.d scripts
|
||||
pathmunge()
|
||||
{
|
||||
if ! echo $PATH | /bin/grep -qE "(^|:)$1($|:)" ; then
|
||||
if [ "$2" = "after" ] ; then
|
||||
PATH=$PATH:$1
|
||||
else
|
||||
PATH=$1:$PATH
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
_src_etc_profile_d()
|
||||
{
|
||||
# Make the *.sh things happier, and have possible ~/.zshenv options like
|
||||
# NOMATCH ignored.
|
||||
emulate -L ksh
|
||||
|
||||
|
||||
# from bashrc, with zsh fixes
|
||||
if [[ ! -o login ]]; then # We're not a login shell
|
||||
for i in /etc/profile.d/*.sh; do
|
||||
if [ -r "$i" ]; then
|
||||
. $i
|
||||
fi
|
||||
done
|
||||
unset i
|
||||
fi
|
||||
}
|
||||
_src_etc_profile_d
|
||||
|
||||
unset -f pathmunge _src_etc_profile_d
|
||||
|
Loading…
Reference in New Issue
Block a user