Hello community,
here is the log from the commit of package ksh
checked in at Thu Oct 9 18:50:19 CEST 2008.
--------
--- ksh/ksh.changes 2008-09-22 14:14:26.000000000 +0200
+++ /mounts/work_src_done/STABLE/ksh/ksh.changes 2008-10-09 15:09:29.579945000 +0200
@@ -1,0 +2,6 @@
+Thu Oct 9 15:08:12 CEST 2008 - werner@suse.de
+
+- Switch to 2008-10-01 beta test of ksh93t to fix several crashes
+- Do not install locale data as this do not work (bnc#433739)
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
ast-ksh.2008-09-21.tar.bz2
INIT.2008-09-21.tar.bz2
New:
----
ast-ksh.2008-10-01.tar.bz2
INIT.2008-10-01.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ksh.spec ++++++
--- /var/tmp/diff_new_pack.n31565/_old 2008-10-09 18:49:16.000000000 +0200
+++ /var/tmp/diff_new_pack.n31565/_new 2008-10-09 18:49:16.000000000 +0200
@@ -29,11 +29,11 @@
PreReq: /bin/ln /bin/rm /etc/bash.bashrc /bin/true
AutoReqProv: on
Version: 93t
-Release: 1
+Release: 2
Summary: Korn Shell
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source: INIT.2008-09-21.tar.bz2
-Source1: ast-ksh.2008-09-21.tar.bz2
+Source: INIT.2008-10-01.tar.bz2
+Source1: ast-ksh.2008-10-01.tar.bz2
Source2: ast-open-locale.2008-07-25.tar.bz2
Source20: Agreement
Source21: Warning
@@ -53,6 +53,7 @@
Patch11: ksh93-signals.dif
Patch12: ksh93-limits.dif
%global use_suid_exe 0
+%global use_locale 0
%description
The original Korn Shell. The ksh is an sh-compatible command
@@ -250,7 +251,9 @@
mkdir -p %{buildroot}%{_mandir}
mkdir %{buildroot}%{_mandir}/man1
mkdir %{buildroot}%{_mandir}/man3
+%if %use_locale
mkdir -p %{buildroot}%{_datadir}/locale
+%endif
mkdir -p %{buildroot}%{_datadir}/ksh/fun
mkdir -p %{buildroot}%{_sysconfdir}/permissions.d
install bin/ksh %{buildroot}/%{_lib}/ast/bin/
@@ -280,6 +283,7 @@
done
install -m 0644 include/ast/* %{buildroot}%{_includedir}/ast/
popd
+%if %use_locale
for msg in share/lib/locale/* ; do
test -d $msg || continue
mkdir -p %{buildroot}%{_datadir}/locale/${msg##*/}/LC_MESSAGES
@@ -293,6 +297,9 @@
s:^([^%%].*)::
s:%%lang\(C\) ::
/^ *$/d' >> ksh.lang
+%else
+ > ksh.lang
+%endif
cp lib/package/LICENSES/ast LICENSE
mv src/cmd/ksh93/OBSOLETE src/cmd/ksh93/OBSOLETE.mm
cat src/cmd/ksh93/builtins.mm | sed 's/\\f5/\\fB/g;s/^\.H/\.P\n\.H/g' | troff -Tascii8 -t -mm | grotty -bou > Builtins
@@ -364,6 +371,9 @@
%{_includedir}/ast/
%changelog
+* Thu Oct 09 2008 werner@suse.de
+- Switch to 2008-10-01 beta test of ksh93t to fix several crashes
+- Do not install locale data as this do not work (bnc#433739)
* Mon Sep 22 2008 werner@suse.de
- Switch to 2008-09-21 beta test of ksh93t as this fix a crash
- Change manual page: ksh uses socketpair(2) for pipes (bnc#422675)
++++++ ast-ksh.2008-09-21.tar.bz2 -> ast-ksh.2008-10-01.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/lib/package/ast-ksh.html new/lib/package/ast-ksh.html
--- old/lib/package/ast-ksh.html 2008-09-21 19:35:10.000000000 +0200
+++ new/lib/package/ast-ksh.html 2008-10-03 18:09:28.000000000 +0200
@@ -193,16 +193,31 @@
<P><HR><CENTER><FONT color=red><FONT face=courier><H3><A name="ksh93 changes">ksh93 changes</A></H3></FONT></FONT></CENTER>
<PRE>
-08-09-21 --- Release ksh93t ---
+08-10-01 --- Release ksh93t ---
+08-10-01 A bug that caused subshell command substitution to hang has
+ been fixed.
+08-09-29 When the -p export option of typeset is used with other options,
+ only those variables matching the specified options are displayed.
+08-09-29 When the shell reads the environment and finds variables that are
+ not valid shell assignments, it now passes these on to subsequent
+ commands rather than deleting them.
+08-09-29 A bug in the display of compound variables containing an indexed
+ array of compound variables has been fixed.
+08-09-29 A bug in the display of compound variables containing an associative
+ array with a subscript containing a . in the name has been fixed.
+08-09-26 A core dump in the subshell environment restore has been fixed.
+08-09-24 $(...) has been fixed to properly set the exit status in $?.
+08-09-23 $(<...) with IFS=$'n' has been fixed to retain all but the last
+ of multiple trailing newlines.
+08-09-23 The -p option to typeset when used with other attributes, restricts
+ the output to variables with the specified attributes.
+08-09-22 A bug that sometimes lost the exit status of a job has been fixed.
08-09-21 A bug that retained trailing command substitution newlines in
cases where the command caused the shell to fork has been fixed.
08-09-19 type, whence -v, and command -v were fixed to comply with POSIX
by writing 'not found' diagnostics to the standard error.
08-09-18 test and [...] were fixed to comply with POSIX in the case
of test '(' binop ')' where binop is a valid binary test operator.
-08-09-17 The exit status for the command `false` is now 0 as required by
- the standard since command subsitution of command args should not
- affect the exit status.
08-09-16 If a method discipline named create is specified when defining a
type, this function will be called when an instance is created.
08-09-15 The variable _ is now set as a reference to the compound variable
@@ -229,7 +244,7 @@
the sub-variables has been fixed.
08-09-01 A bug in the subshell cleanup code that could cause SIGSEGV has
been fixed.
-06-08-26 The SHLV variable which is an environment variable used by bash
+06-08-26 The SHLVL variable which is an environment variable used by bash
and zsh that gets incremented when the shell starts.
08-08-25 For an indexed array, a negative subscript now refers to offsets
from the end so that -1 refers to the last element.
@@ -3900,7 +3915,7 @@
<TR>
<TD align=left></TD>
<TD align=center></TD>
-<TD align=right>September 21, 2008</TD>
+<TD align=right>October 03, 2008</TD>
</TR>
</TABLE>
<P>
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/lib/package/ast-ksh.README new/lib/package/ast-ksh.README
--- old/lib/package/ast-ksh.README 2008-09-21 19:35:09.000000000 +0200
+++ new/lib/package/ast-ksh.README 2008-10-03 18:09:27.000000000 +0200
@@ -92,16 +92,31 @@
:::::::: ksh93 ::::::::
-08-09-21 --- Release ksh93t ---
+08-10-01 --- Release ksh93t ---
+08-10-01 A bug that caused subshell command substitution to hang has
+ been fixed.
+08-09-29 When the -p export option of typeset is used with other options,
+ only those variables matching the specified options are displayed.
+08-09-29 When the shell reads the environment and finds variables that are
+ not valid shell assignments, it now passes these on to subsequent
+ commands rather than deleting them.
+08-09-29 A bug in the display of compound variables containing an indexed
+ array of compound variables has been fixed.
+08-09-29 A bug in the display of compound variables containing an associative
+ array with a subscript containing a . in the name has been fixed.
+08-09-26 A core dump in the subshell environment restore has been fixed.
+08-09-24 $(...) has been fixed to properly set the exit status in $?.
+08-09-23 $(<...) with IFS=$'\n\n' has been fixed to retain all but the last
+ of multiple trailing newlines.
+08-09-23 The -p option to typeset when used with other attributes, restricts
+ the output to variables with the specified attributes.
+08-09-22 A bug that sometimes lost the exit status of a job has been fixed.
08-09-21 A bug that retained trailing command substitution newlines in
cases where the command caused the shell to fork has been fixed.
08-09-19 type, whence -v, and command -v were fixed to comply with POSIX
by writing 'not found' diagnostics to the standard error.
08-09-18 test and [...] were fixed to comply with POSIX in the case
of test '(' binop ')' where binop is a valid binary test operator.
-08-09-17 The exit status for the command `false` is now 0 as required by
- the standard since command subsitution of command args should not
- affect the exit status.
08-09-16 If a method discipline named create is specified when defining a
type, this function will be called when an instance is created.
08-09-15 The variable _ is now set as a reference to the compound variable
@@ -128,7 +143,7 @@
the sub-variables has been fixed.
08-09-01 A bug in the subshell cleanup code that could cause SIGSEGV has
been fixed.
-06-08-26 The SHLV variable which is an environment variable used by bash
+06-08-26 The SHLVL variable which is an environment variable used by bash
and zsh that gets incremented when the shell starts.
08-08-25 For an indexed array, a negative subscript now refers to offsets
from the end so that -1 refers to the last element.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/lib/package/ast-ksh.ver new/lib/package/ast-ksh.ver
--- old/lib/package/ast-ksh.ver 2008-09-21 19:35:08.000000000 +0200
+++ new/lib/package/ast-ksh.ver 2008-10-03 18:17:15.000000000 +0200
@@ -1 +1 @@
-ast-ksh 2008-09-21 2008-09-21 1
+ast-ksh 2008-10-01 2008-10-01 1
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/bltins/typeset.c new/src/cmd/ksh93/bltins/typeset.c
--- old/src/cmd/ksh93/bltins/typeset.c 2008-08-22 19:45:35.000000000 +0200
+++ new/src/cmd/ksh93/bltins/typeset.c 2008-09-26 20:29:08.000000000 +0200
@@ -375,7 +375,7 @@
else if(!tdata.sh->typeinit)
flag |= NV_STATIC|NV_IDENT;
}
- if(tdata.sh->fn_depth)
+ if(tdata.sh->fn_depth && !tdata.pflag)
flag |= NV_NOSCOPE;
if(flag&NV_TYPE)
{
@@ -432,7 +432,10 @@
int r=0, ref=0, comvar=(flag&NV_COMVAR),iarray=(flag&NV_IARRAY);
Shell_t *shp =tp->sh;
if(!shp->prefix)
- nvflags |= NV_NOSCOPE;
+ {
+ if(!tp->pflag)
+ nvflags |= NV_NOSCOPE;
+ }
else if(*shp->prefix==0)
shp->prefix = 0;
flag &= ~(NV_NOARRAY|NV_NOSCOPE|NV_VARNAME|NV_IDENT|NV_STATIC|NV_COMVAR|NV_IARRAY);
@@ -649,8 +652,6 @@
}
else if(!tp->sh->envlist)
{
- if(tp->pflag)
- tp->aflag = 0;
if(tp->aflag)
{
if(troot==shp->fun_tree)
@@ -1012,7 +1013,12 @@
return(0);
}
if(tp->prefix)
- sfputr(file,tp->prefix,' ');
+ {
+ if(*tp->prefix=='t')
+ nv_attribute(np,tp->outfile,tp->prefix,tp->aflag);
+ else
+ sfputr(file,tp->prefix,' ');
+ }
if(is_afunction(np))
{
Sfio_t *iop=0;
@@ -1030,7 +1036,7 @@
flag = '\n';
if(flag)
{
- if(np->nvalue.ip && np->nvalue.rp->hoffset>=0)
+ if(tp->pflag && np->nvalue.ip && np->nvalue.rp->hoffset>=0)
sfprintf(file," #line %d %s\n",np->nvalue.rp->lineno,fname?sh_fmtq(fname):"");
else
sfputc(file, '\n');
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/data/bash_pre_rc.sh new/src/cmd/ksh93/data/bash_pre_rc.sh
--- old/src/cmd/ksh93/data/bash_pre_rc.sh 2008-06-23 17:03:31.000000000 +0200
+++ new/src/cmd/ksh93/data/bash_pre_rc.sh 2008-09-29 18:32:25.000000000 +0200
@@ -252,3 +252,4 @@
typeset BASH=$0
! shopt -qo posix && HISTFILE=~/.bash_history
HOSTNAME=$(hostname)
+nameref BASH_SUBSHELL=.sh.subshell
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/DESIGN new/src/cmd/ksh93/DESIGN
--- old/src/cmd/ksh93/DESIGN 2003-03-19 16:25:05.000000000 +0100
+++ new/src/cmd/ksh93/DESIGN 2008-02-27 16:56:58.000000000 +0100
@@ -8,6 +8,11 @@
The remainder are private.
The directory data contains readonly data files for ksh93.
+ The man pages for built-ins are in builtins.c rather
+ than included as statics with the implementations in the
+ bltins directory because some systems don't make static const
+ data readonly and we want these to be shared by all running
+ shells.
The directory edit contains the code for command line
editing and history.
@@ -59,7 +64,7 @@
4. edit.h contains definitions that are common to both
vi and emacs edit modes.
5. env.h contains interfaces for creating and modifying
- environment variables.
+ environment variables.
6. fault.h contains prototypes for signal related
functions and trap and fault handling.
7. fcin.h contains macro and function definitions for
@@ -134,30 +139,32 @@
18. nvdisc.c contains code related to name-value pair disciplines.
19. nvtree.c contains code for compound variables and for
walking the namespace.
- 20. parse.c contains the code for the shell parser.
- 21. path.c contains the code for pathname lookup and
+ 20. nvtype.c contains most of the code related to types that
+ are created with typeset -T.
+ 21. parse.c contains the code for the shell parser.
+ 22. path.c contains the code for pathname lookup and
some path functions. It also contains the code
that executes commands and scripts.
- 22. pmain.c is just a calls sh_main() so that all of the
+ 23. pmain.c is just a calls sh_main() so that all of the
rest of the shell can be in a shared library.
- 23. shcomp.c contains the main program to the shell
+ 24. shcomp.c contains the main program to the shell
compiler. This program parses a script and creates
a file that the shell can read containing the parse tree.
- 24. streval.c is an C arithmetic evaluator.
- 25. string.c contains some string related functions.
- 26. subshell.c contains the code to save and restore
+ 25. streval.c is an C arithmetic evaluator.
+ 26. string.c contains some string related functions.
+ 27. subshell.c contains the code to save and restore
environments so that subshells can run without creating
a new process.
- 27. suid_exec.c contains the program from running execute
+ 28. suid_exec.c contains the program from running execute
only and/or setuid/setgid scripts.
- 28. tdump.c contains the code to dump a parse tree into
+ 29. tdump.c contains the code to dump a parse tree into
a file.
- 29. timers.c contains code for multiple event timeouts.
- 30. trestore contians the code for restoring the parse
+ 30. timers.c contains code for multiple event timeouts.
+ 31. trestore contians the code for restoring the parse
tree from the file created by tdump.
- 31. userinit.c contains a dummy userinit() function.
+ 32. userinit.c contains a dummy userinit() function.
This is now obsolete with the new version of sh_main().
- 32. waitevent.c contains the sh_waitnotify function so
+ 33. waitevent.c contains the sh_waitnotify function so
that builtins can handle processing events when the
shell is waiting for input or for process completion.
- 33. xec.c is the main shell executuion loop.
+ 34. xec.c is the main shell executuion loop.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/include/defs.h new/src/cmd/ksh93/include/defs.h
--- old/src/cmd/ksh93/include/defs.h 2008-09-19 23:14:48.000000000 +0200
+++ new/src/cmd/ksh93/include/defs.h 2008-10-01 22:03:37.000000000 +0200
@@ -181,6 +181,7 @@
int xargmin; \
int xargmax; \
int xargexit; \
+ int nenv; \
mode_t mask; \
long nforks; \
Env_t *env; \
@@ -216,6 +217,7 @@
Dt_t *last_root; \
Dt_t *prev_root; \
Dt_t *fpathdict; \
+ Dt_t *typedict; \
char ifstable[256]; \
unsigned char sigruntime[2]; \
unsigned long test; \
@@ -373,7 +375,7 @@
extern Dt_t *sh_subfuntree(int);
extern void sh_subjobcheck(pid_t);
extern int sh_subsavefd(int);
-extern void sh_subtmpfile(void);
+extern void sh_subtmpfile(int);
extern char *sh_substitute(const char*,const char*,char*);
extern const char *_sh_translate(const char*);
extern int sh_trace(char*[],int);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/include/version.h new/src/cmd/ksh93/include/version.h
--- old/src/cmd/ksh93/include/version.h 2008-09-21 19:11:59.000000000 +0200
+++ new/src/cmd/ksh93/include/version.h 2008-10-01 23:02:04.000000000 +0200
@@ -17,4 +17,4 @@
* David Korn *
* *
***********************************************************************/
-#define SH_RELEASE "93t 2008-09-21"
+#define SH_RELEASE "93t 2008-10-01"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/RELEASE new/src/cmd/ksh93/RELEASE
--- old/src/cmd/ksh93/RELEASE 2008-09-21 19:11:51.000000000 +0200
+++ new/src/cmd/ksh93/RELEASE 2008-10-01 23:01:36.000000000 +0200
@@ -1,13 +1,28 @@
-08-09-21 --- Release ksh93t ---
+08-10-01 --- Release ksh93t ---
+08-10-01 A bug that caused subshell command substitution to hang has
+ been fixed.
+08-09-29 When the -p export option of typeset is used with other options,
+ only those variables matching the specified options are displayed.
+08-09-29 When the shell reads the environment and finds variables that are
+ not valid shell assignments, it now passes these on to subsequent
+ commands rather than deleting them.
+08-09-29 A bug in the display of compound variables containing an indexed
+ array of compound variables has been fixed.
+08-09-29 A bug in the display of compound variables containing an associative
+ array with a subscript containing a . in the name has been fixed.
+08-09-26 A core dump in the subshell environment restore has been fixed.
+08-09-24 $(...) has been fixed to properly set the exit status in $?.
+08-09-23 $(<...) with IFS=$'\n\n' has been fixed to retain all but the last
+ of multiple trailing newlines.
+08-09-23 The -p option to typeset when used with other attributes, restricts
+ the output to variables with the specified attributes.
+08-09-22 A bug that sometimes lost the exit status of a job has been fixed.
08-09-21 A bug that retained trailing command substitution newlines in
cases where the command caused the shell to fork has been fixed.
08-09-19 type, whence -v, and command -v were fixed to comply with POSIX
by writing 'not found' diagnostics to the standard error.
08-09-18 test and [...] were fixed to comply with POSIX in the case
of test '(' binop ')' where binop is a valid binary test operator.
-08-09-17 The exit status for the command `false` is now 0 as required by
- the standard since command subsitution of command args should not
- affect the exit status.
08-09-16 If a method discipline named create is specified when defining a
type, this function will be called when an instance is created.
08-09-15 The variable _ is now set as a reference to the compound variable
@@ -34,7 +49,7 @@
the sub-variables has been fixed.
08-09-01 A bug in the subshell cleanup code that could cause SIGSEGV has
been fixed.
-06-08-26 The SHLV variable which is an environment variable used by bash
+06-08-26 The SHLVL variable which is an environment variable used by bash
and zsh that gets incremented when the shell starts.
08-08-25 For an indexed array, a negative subscript now refers to offsets
from the end so that -1 refers to the last element.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/sh/array.c new/src/cmd/ksh93/sh/array.c
--- old/src/cmd/ksh93/sh/array.c 2008-09-15 18:23:15.000000000 +0200
+++ new/src/cmd/ksh93/sh/array.c 2008-10-01 21:28:04.000000000 +0200
@@ -657,7 +657,7 @@
if(nv_hasdisc(np,&array_disc) || nv_isvtree(np))
{
ap->header.table = dtopen(&_Nvdisc,Dtoset);
- mp = nv_search("0", ap->header.table, NV_ADD);
+ mp = nv_search("0", ap->header.table, 0);
if(mp && nv_isnull(mp))
{
@@ -667,8 +667,8 @@
for(fp=np->nvfun; fp && !fp->disc->readf; fp=fp->next);
if(fp)
(*fp->disc->readf)(mp,(Sfio_t*)0,0,fp);
+ i++;
}
- i++;
}
else if((ap->val[0].cp=np->nvalue.cp))
i++;
@@ -829,6 +829,7 @@
Namfun_t *fp;
register Namarr_t *ap = nv_arrayptr(np);
union Value *up;
+ Namval_t *tp;
if(!nq)
return(ap?array_find(np,ap, ARRAY_LOOKUP):0);
if(!ap)
@@ -839,11 +840,14 @@
if(!(up = array_getup(np,ap,0)))
return((Namval_t*)0);
np->nvalue.cp = up->cp;
- if(c || nv_type(np))
+ if((tp=nv_type(np)) || c)
{
ap->nelem |= ARRAY_NOCLONE;
nq->nvenv = (char*)np;
- nv_clone(np, nq, NV_NODISC);
+ if(c=='t')
+ nv_clone(tp,nq, 0);
+ else
+ nv_clone(np, nq, NV_NODISC);
nv_offattr(nq,NV_ARRAY);
ap->nelem &= ~ARRAY_NOCLONE;
}
@@ -926,7 +930,7 @@
*/
Namval_t *nv_putsub(Namval_t *np,register char *sp,register long mode)
{
- register struct index_array *aq=0,*ap = (struct index_array*)nv_arrayptr(np);
+ register struct index_array *ap = (struct index_array*)nv_arrayptr(np);
register int size = (mode&ARRAY_MASK);
if(!ap || !ap->header.fun)
{
@@ -975,9 +979,7 @@
}
#endif
ap->cur = size;
- if(!(ap->header.nelem&ARRAY_NOSCOPE))
- aq = (struct index_array*)ap->header.scope;
- if((mode&ARRAY_SCAN) && !ap->val[size].cp && (!aq || !aq->val[size].cp) && !nv_nextsub(np))
+ if((mode&ARRAY_SCAN) && (ap->cur--,!nv_nextsub(np)))
np = 0;
if(mode&ARRAY_FILL)
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/sh/init.c new/src/cmd/ksh93/sh/init.c
--- old/src/cmd/ksh93/sh/init.c 2008-08-26 18:04:30.000000000 +0200
+++ new/src/cmd/ksh93/sh/init.c 2008-09-30 20:08:15.000000000 +0200
@@ -336,7 +336,7 @@
type= -1;
if(sh_isstate(SH_INIT) && type>=0 && type!=LC_ALL && lc_all && *lc_all)
type= -1;
- if(type>=0)
+ if(type>=0 || type==LC_ALL)
{
if(!setlocale(type,val?val:""))
{
@@ -1513,7 +1513,7 @@
nv_putval(np,".sh.global",NV_RDONLY|NV_NOFREE);
nv_stack(np, &NSPACE_init);
#endif /* SHOPT_NAMESPACE */
- np = nv_mount(DOTSHNOD, "type", dtopen(&_Nvdisc,Dtoset));
+ np = nv_mount(DOTSHNOD, "type", shp->typedict=dtopen(&_Nvdisc,Dtoset));
nv_adddisc(DOTSHNOD, shdiscnames, (Namval_t**)0);
SH_LINENO->nvalue.ip = &shp->st.lineno;
VERSIONNOD->nvalue.nrp = newof(0,struct Namref,1,0);
@@ -1610,6 +1610,11 @@
np->nvenv = cp;
nv_close(np);
}
+ else /* swap with fron */
+ {
+ ep[-1] = environ[shp->nenv];
+ environ[shp->nenv++] = cp;
+ }
}
while(cp=next)
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/sh/io.c new/src/cmd/ksh93/sh/io.c
--- old/src/cmd/ksh93/sh/io.c 2008-08-20 19:34:24.000000000 +0200
+++ new/src/cmd/ksh93/sh/io.c 2008-10-01 22:12:14.000000000 +0200
@@ -992,7 +992,7 @@
}
if(shp->subshell && dupfd==1)
{
- sh_subtmpfile();
+ sh_subtmpfile(0);
dupfd = sffileno(sfstdout);
}
else if(shp->sftable[dupfd])
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/sh/jobs.c new/src/cmd/ksh93/sh/jobs.c
--- old/src/cmd/ksh93/sh/jobs.c 2008-09-11 18:30:21.000000000 +0200
+++ new/src/cmd/ksh93/sh/jobs.c 2008-09-23 06:49:19.000000000 +0200
@@ -1086,6 +1086,7 @@
{
register struct process *pw;
register History_t *hp = sh.hist_ptr;
+ int val;
sh.jobenv = sh.curenv;
if(njob_savelist < NJOB_SAVELIST)
init_savelist();
@@ -1153,10 +1154,9 @@
else
pw->p_name = -1;
#endif /* JOBS */
- if(pid==lastpid)
+ if ((val = job_chksave(pid)) >= 0)
{
- int val = job_chksave(pid);
- pw->p_exit = val>0?val:0;
+ pw->p_exit = val;
if(pw->p_exit==SH_STOPSIG)
{
pw->p_flag |= (P_SIGNALLED|P_STOPPED);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/sh/macro.c new/src/cmd/ksh93/sh/macro.c
--- old/src/cmd/ksh93/sh/macro.c 2008-09-21 19:00:02.000000000 +0200
+++ new/src/cmd/ksh93/sh/macro.c 2008-09-23 23:48:46.000000000 +0200
@@ -1944,6 +1944,7 @@
goto out_offset;
}
sp = sfnew(NIL(Sfio_t*),(char*)malloc(IOBSIZE+1),IOBSIZE,fd,SF_READ|SF_MALLOC);
+ type = 3;
}
else
sp = sh_subshell(t,sh_isstate(SH_ERREXIT),type);
@@ -2012,8 +2013,8 @@
sfnputc(mp->sp,'\n',newlines);
else if(!mp->quote && mp->split && mp->shp->ifstable['\n'])
endfield(mp,0);
- else while(newlines--)
- sfputc(stkp,'\n');
+ else
+ sfnputc(stkp,'\n',newlines);
}
else if(lastc)
{
@@ -2039,10 +2040,11 @@
{
if(mp->sp)
sfnputc(mp->sp,'\n',newlines);
- else if(!mp->quote && mp->split && mp->shp->ifstable['\n'])
- endfield(mp,0);
- else while(newlines--)
- sfputc(stkp,'\n');
+ else if(!mp->quote && mp->split)
+ while(newlines--)
+ endfield(mp,1);
+ else
+ sfnputc(stkp,'\n',newlines);
}
if(lastc)
mac_copy(mp,&lastc,1);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/sh/name.c new/src/cmd/ksh93/sh/name.c
--- old/src/cmd/ksh93/sh/name.c 2008-09-18 05:04:02.000000000 +0200
+++ new/src/cmd/ksh93/sh/name.c 2008-09-30 22:50:40.000000000 +0200
@@ -426,7 +426,9 @@
continue;
#endif /* SHOPT_TYPEDEF */
}
- if(tp->tre.tretyp==TLST || tp->tre.tretyp==TFUN || !tp->com.comset || tp->com.comset->argval[0]!='[')
+ if((tp->tre.tretyp&COMMSK)==TFUN)
+ goto skip;
+ if(tp->tre.tretyp==TLST || !tp->com.comset || tp->com.comset->argval[0]!='[')
{
if(tp->tre.tretyp!=TLST && !tp->com.comnamp && tp->com.comset && tp->com.comset->argval[0]==0 && tp->com.comset->argchn.ap)
{
@@ -480,6 +482,7 @@
if(!sh_isoption(SH_BASH) && !(array&NV_IARRAY) && !nv_isarray(np))
nv_setarray(np,nv_associative);
}
+ skip:
if(sub>0)
{
sfprintf(stkstd,"%s[%d]",prefix?nv_name(np):cp,sub);
@@ -981,6 +984,7 @@
return(np);
nv_putsub(np,NIL(char*),ARRAY_UNDEF);
}
+ again:
if(c=='.' && (fp=np->nvfun))
{
for(; fp; fp=fp->next)
@@ -995,11 +999,16 @@
add = NV_ADD;
break;
}
- else if((np=nq) && (c = *(sp=cp=dp->last=fp->last))==0)
+ else if(np=nq)
{
- if(nv_isarray(np) && sp[-1]!=']')
- nv_putsub(np,NIL(char*),ARRAY_UNDEF);
- return(np);
+ if((c = *(sp=cp=dp->last=fp->last))=='.')
+ goto again;
+ else if(c==0)
+ {
+ if(nv_isarray(np) && sp[-1]!=']')
+ nv_putsub(np,NIL(char*),ARRAY_UNDEF);
+ return(np);
+ }
}
}
}
@@ -1906,18 +1915,22 @@
register int namec;
register char *cp;
struct adata data;
- data.sh = &sh;
+ Shell_t *shp = sh_getinterp();
+ data.sh = shp;
data.tp = 0;
/* L_ARGNOD gets generated automatically as full path name of command */
nv_offattr(L_ARGNOD,NV_EXPORT);
data.attsize = 6;
- namec = nv_scan(sh.var_tree,nullscan,(void*)0,NV_EXPORT,NV_EXPORT);
+ namec = nv_scan(shp->var_tree,nullscan,(void*)0,NV_EXPORT,NV_EXPORT);
+ namec += shp->nenv;
er = (char**)stakalloc((namec+4)*sizeof(char*));
- data.argnam = (er+=2);
- nv_scan(sh.var_tree, pushnam,&data,NV_EXPORT, NV_EXPORT);
+ data.argnam = (er+=2) + shp->nenv;
+ if(shp->nenv)
+ memcpy((void*)er,environ,shp->nenv*sizeof(char*));
+ nv_scan(shp->var_tree, pushnam,&data,NV_EXPORT, NV_EXPORT);
*data.argnam = (char*)stakalloc(data.attsize);
cp = data.attval = strcopy(*data.argnam,e_envmarker);
- nv_scan(sh.var_tree, attstore,&data,0,(NV_RDONLY|NV_UTOL|NV_LTOU|NV_RJUST|NV_LJUST|NV_ZFILL|NV_INTEGER));
+ nv_scan(shp->var_tree, attstore,&data,0,(NV_RDONLY|NV_UTOL|NV_LTOU|NV_RJUST|NV_LJUST|NV_ZFILL|NV_INTEGER));
*data.attval = 0;
if(cp!=data.attval)
data.argnam++;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/sh/nvtree.c new/src/cmd/ksh93/sh/nvtree.c
--- old/src/cmd/ksh93/sh/nvtree.c 2008-09-19 17:43:41.000000000 +0200
+++ new/src/cmd/ksh93/sh/nvtree.c 2008-10-02 17:41:41.000000000 +0200
@@ -111,15 +111,20 @@
static char *nextdot(const char *str)
{
register char *cp;
+ register int c;
if(*str=='.')
str++;
- if(*str =='[')
+ for(cp=(char*)str;c= *cp; cp++)
{
- cp = nv_endsubscript((Namval_t*)0,(char*)str,0);
- return(*cp=='.'?cp:0);
+ if(c=='[')
+ {
+ cp = nv_endsubscript((Namval_t*)0,(char*)cp,0);
+ return(*cp=='.'?cp:0);
+ }
+ if(c=='.')
+ return(cp);
}
- else
- return(strchr(str,'.'));
+ return(0);
}
static Namfun_t *nextdisc(Namval_t *np)
@@ -313,8 +318,6 @@
if(!(save=dp->prev))
break;
*dp = *save;
- if(np==0)
- dp->hp = 0;
free((void*)save);
}
return(0);
@@ -443,7 +446,7 @@
if(ap && (ap->nelem&ARRAY_TREE))
{
if(prefix && *prefix)
- sfprintf(out,"%s -C ",prefix);
+ sfwrite(out,"-C ",3);
}
if(ap && !array_assoc(ap) && (xp=(char**)(ap+1)) && *xp)
ip = nv_namptr(*xp,0)->nvname;
@@ -552,7 +555,7 @@
nv_onattr(mp,NV_EXPORT);
ep = nv_getval(mp?mp:np);
xp = 0;
- if(nv_isattr(np,NV_INTEGER|NV_LJUST)==NV_LJUST)
+ if(!ap && nv_isattr(np,NV_INTEGER|NV_LJUST)==NV_LJUST)
{
xp = ep+nv_size(np);
while(--xp>ep && *xp==' ');
@@ -621,7 +624,7 @@
if(nv_isarray(np))
return;
}
- if(!special && fp)
+ if(!special && fp && !nv_isarray(np))
{
Namfun_t *xp;
if(!wp->out)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/sh/nvtype.c new/src/cmd/ksh93/sh/nvtype.c
--- old/src/cmd/ksh93/sh/nvtype.c 2008-09-18 16:21:24.000000000 +0200
+++ new/src/cmd/ksh93/sh/nvtype.c 2008-10-01 22:24:56.000000000 +0200
@@ -495,6 +495,35 @@
{
while(nv_isref(nq))
nq = nq->nvalue.nrp->np;
+ if(name[n]=='[' && nv_type(nq))
+ {
+ char *sub;
+ Namval_t *nr;
+ int m = (flag&NV_NOADD)?0:NV_ADD;
+ m |= (flag&NV_ASSIGN);
+ cp = nv_endsubscript(nq,(char*)cp-1,m);
+ if(!(sub = nv_getsub(nq)) || strcmp(sub,"0")==0)
+ {
+ name = memcpy((char*)cp-n,name,n);
+ while((n=*cp++) && n != '=' && n != '+' && n!='[');
+ n = (cp-1) -name;
+ continue;
+ }
+ if(!(nr = nv_opensub(nq)))
+ {
+ Namarr_t *ap = nv_arrayptr(nq);
+ if(ap && !ap->table)
+ ap->table = dtopen(&_Nvdisc,Dtoset);
+ if(ap && ap->table && (nr=nv_search(sub,ap->table,m)))
+ nr->nvenv = (char*)nq;
+ if(nq && nv_isnull(nr))
+ {
+ nr = nv_arraychild(nq,nr,'t');
+ }
+ }
+ nq = nr;
+ n = cp -name;
+ }
goto found;
}
}
@@ -776,6 +805,8 @@
name++;
else
name = np->nvname;
+ if((bp=nv_search(name,shp->fun_tree,NV_NOSCOPE)) && !bp->nvalue.ip)
+ nv_delete(bp,shp->fun_tree,0);
bp = sh_addbuiltin(name, mp->nvalue.bfp, (void*)cp);
nv_onattr(bp,nv_isattr(mp,NV_PUBLIC));
nv_onattr(np, NV_RDONLY);
@@ -860,7 +891,7 @@
size += n;
}
else
- size += n + dp->numnodes*strlen(&np->nvname[m]);
+ size += n + dp->numnodes*(strlen(&np->nvname[m])+1);
n = strlen(np->nvname);
while((i+1) < numnodes && (cp=nodes[i+1]->nvname) && memcmp(cp,np->nvname,n)==0 && cp[n]=='.')
i++;
@@ -1029,9 +1060,15 @@
* If field is a type, mark the type by setting
* strsize<0. This changes create_type()
*/
+#if 1
+ if(nv_isarray(np))
+ errormsg(SH_DICT,ERROR_exit(1),"%s: A type definition cannot contain an array of a type in this release", mp->nvname);
clone_all_disc(np,nq,NV_RDONLY);
+#else
+ clone_all_disc(nv_type(np),nq,NV_RDONLY);
+#endif
if(fp=nv_hasdisc(nq,&chtype_disc))
- nv_disc(nq, &pp->childfun.fun, NV_LAST);
+ nv_disc(nq, &pp->childfun.fun, NV_LAST);
if(tp = (Namtype_t*)nv_hasdisc(nq, &type_disc))
tp->strsize = -tp->strsize;
else sfprintf(sfstderr,"tp==NULL\n");
@@ -1089,6 +1126,12 @@
j = nv_isattr(np,NV_NOFREE);
nq->nvfun = np->nvfun;
np->nvfun = 0;
+ if(nv_isarray(nq) && !nq->nvfun)
+ {
+ nv_putsub(nq, (char*)0, ARRAY_FILL);
+ ((Namarr_t*)nq->nvfun)->nelem--;
+
+ }
nv_disc(nq, &pp->childfun.fun, NV_LAST);
if(nq->nvfun)
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/sh/path.c new/src/cmd/ksh93/sh/path.c
--- old/src/cmd/ksh93/sh/path.c 2008-08-05 19:51:24.000000000 +0200
+++ new/src/cmd/ksh93/sh/path.c 2008-10-01 21:39:18.000000000 +0200
@@ -993,7 +993,7 @@
}
v = stakfreeze(1);
r = 1;
- xp = envp + 2;
+ xp = envp + 1;
while (s = *xp++)
{
if (strneq(s, v, n) && s[n] == '=')
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/sh/subshell.c new/src/cmd/ksh93/sh/subshell.c
--- old/src/cmd/ksh93/sh/subshell.c 2008-09-19 23:33:41.000000000 +0200
+++ new/src/cmd/ksh93/sh/subshell.c 2008-10-01 22:11:52.000000000 +0200
@@ -94,9 +94,9 @@
static int subenv;
/*
- * This routine will turn the sftmp() file into a pipe
+ * This routine will turn the sftmp() file into a real /tmp file or pipe
*/
-void sh_subtmpfile(void)
+void sh_subtmpfile(int pflag)
{
Shell_t *shp = &sh;
int fds[2];
@@ -115,6 +115,24 @@
}
else if(errno!=EBADF)
errormsg(SH_DICT,ERROR_system(1),e_toomany);
+ if(!pflag)
+ {
+ sfdisc(sfstdout,SF_POPDISC);
+ if((fd=sffileno(sfstdout))>=0)
+ {
+ sh.fdstatus[fd] = IOREAD|IOWRITE;
+ sfsync(sfstdout);
+ if(fd==1)
+ fcntl(1,F_SETFD,0);
+ else
+ {
+ sfsetfd(sfstdout,1);
+ sh.fdstatus[1] = sh.fdstatus[fd];
+ sh.fdstatus[fd] = IOCLOSE;
+ }
+ goto skip;
+ }
+ }
sh_pipe(fds);
sp->pipefd = fds[0];
sh_fcntl(sp->pipefd,F_SETFD,FD_CLOEXEC);
@@ -128,6 +146,7 @@
if((sh_fcntl(fds[1],F_DUPFD, 1)) != 1)
errormsg(SH_DICT,ERROR_system(1),e_file+4);
sh_close(fds[1]);
+ skip:
sh_iostream(shp,1);
sfset(sfstdout,SF_SHARE|SF_PUBLIC,1);
sfpool(sfstdout,shp->outpool,SF_WRITE);
@@ -149,7 +168,7 @@
pid_t pid;
/* see whether inside $(...) */
if(sp->pipe)
- sh_subtmpfile();
+ sh_subtmpfile(1);
shp->curenv = 0;
if(pid = sh_fork(0,NIL(int*)))
{
@@ -317,6 +336,7 @@
dtinsert(lp->dict,mp);
}
free((void*)lp);
+ sp->svar = lq;
}
sp->shpwd=save;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/sh/xec.c new/src/cmd/ksh93/sh/xec.c
--- old/src/cmd/ksh93/sh/xec.c 2008-09-19 22:58:09.000000000 +0200
+++ new/src/cmd/ksh93/sh/xec.c 2008-10-01 22:13:01.000000000 +0200
@@ -741,7 +741,6 @@
comn = com[argn-1];
}
io = t->tre.treio;
- shp->exitval = 0;
if(shp->envlist = argp = t->com.comset)
{
if(argn==0 || (np && nv_isattr(np,BLT_SPC)))
@@ -958,7 +957,7 @@
bp->notify = 0;
bp->flags = (OPTIMIZE!=0);
if(shp->subshell && nv_isattr(np,BLT_NOSFIO))
- sh_subtmpfile();
+ sh_subtmpfile(0);
if(execflg && !shp->subshell &&
!shp->st.trapcom[0] && !shp->st.trap[SH_ERRTRAP] && shp->fn_depth==0 && !nv_isattr(np,BLT_ENV))
{
@@ -1135,7 +1134,7 @@
!shp->st.trap[SH_ERRTRAP] && shp->fn_depth==0 &&
!(pipejob && sh_isoption(SH_PIPEFAIL)));
if(shp->subshell)
- sh_subtmpfile();
+ sh_subtmpfile(1);
if(sh_isstate(SH_PROFILE) || shp->dot_depth)
{
/* disable foreground job monitor */
@@ -1187,7 +1186,7 @@
sh_close(shp->inpipe[0]);
if(type&(FCOOP|FAMP))
shp->bckpid = parent;
- if(!(type&(FAMP|FPOU)) && !(execflg && shp->subshell))
+ else if(!(type&(FAMP|FPOU)))
{
if(shp->topfd > topfd)
sh_iorestore(shp,topfd,0);
@@ -1197,7 +1196,13 @@
sh_sigtrap(SIGINT);
shp->trapnote |= SH_SIGIGNORE;
}
- job_wait(parent);
+ if(execflg && shp->subshell)
+ {
+ shp->spid = parent;
+ job.pwlist->p_env--;
+ }
+ else
+ job_wait(parent);
if(!sh_isoption(SH_MONITOR))
{
shp->trapnote &= ~SH_SIGIGNORE;
@@ -1314,10 +1319,7 @@
int jmpval, waitall;
struct checkpt buff;
if(shp->subshell)
- {
- flags &= ~sh_state(SH_NOFORK);
execflg = 0;
- }
sh_pushcontext(&buff,SH_JMPIO);
if(type&FPIN)
{
@@ -1403,7 +1405,7 @@
pid_t savepgid = job.curpgid;
job.curpgid = 0;
if(shp->subshell)
- sh_subtmpfile();
+ sh_subtmpfile(1);
shp->inpipe = pvo;
shp->outpipe = pvn;
pvo[1] = -1;
@@ -1915,15 +1917,12 @@
}
else
{
- sfwrite(stkp,fname,cp-fname);
+ sfwrite(stkp,fname,cp++-fname);
sfputc(stkp,0);
npv = nv_open(stkptr(stkp,offset),shp->var_tree,NV_NOASSIGN|NV_NOARRAY|NV_VARNAME);
}
offset = stktell(stkp);
- sfputr(stkp,nv_name(npv),-1);
- if(*cp!='.')
- sfputc(stkp,'.');
- sfputr(stkp,cp,0);
+ sfprintf(stkp,"%s.%s%c",nv_name(npv),cp,0);
fname = stkptr(stkp,offset);
}
else if((np=nv_search(fname,shp->bltin_tree,0)) && nv_isattr(np,BLT_SPC))
@@ -1941,9 +1940,19 @@
np = nv_open(fname,sh_subfuntree(1),NV_NOASSIGN|NV_NOARRAY|NV_VARNAME|NV_NOSCOPE);
if(npv)
{
+ Namval_t *tp = npv;
if(!shp->mktype)
- cp = nv_setdisc(npv,cp+1,np,(Namfun_t*)npv);
- nv_close(npv);
+ {
+ if(shp->typeinit)
+ {
+ if(tp=nv_open(shp->typeinit->nvname,shp->typedict,NV_IDENT|NV_NOFAIL))
+ nv_close(npv);
+ else
+ tp = npv;
+ }
+ cp = nv_setdisc(tp,cp,np,(Namfun_t*)tp);
+ }
+ nv_close(tp);
if(!cp)
errormsg(SH_DICT,ERROR_exit(1),e_baddisc,fname);
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/tests/attributes.sh new/src/cmd/ksh93/tests/attributes.sh
--- old/src/cmd/ksh93/tests/attributes.sh 2008-09-05 03:28:50.000000000 +0200
+++ new/src/cmd/ksh93/tests/attributes.sh 2008-09-26 20:35:26.000000000 +0200
@@ -274,4 +274,10 @@
[[ $(typeset -p z) == "Pt_t z=$x" ]] || err_exit "typeset -p for type failed"
[[ $(typeset +p z) == "Pt_t z" ]] || err_exit "typeset +p for type failed"
unset z
+function foo
+{
+ typeset -p bar
+}
+bar=xxx
+[[ $(foo) == bar=xxx ]] || err_exit 'typeset -p not working inside a function'
exit $((Errors))
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/tests/basic.sh new/src/cmd/ksh93/tests/basic.sh
--- old/src/cmd/ksh93/tests/basic.sh 2008-09-18 06:00:49.000000000 +0200
+++ new/src/cmd/ksh93/tests/basic.sh 2008-09-30 11:32:39.000000000 +0200
@@ -300,19 +300,23 @@
return 1
}
optbug || err_exit 'array size optimzation bug'
-wait # not running --pipefile which would interfere with subsequent tests
+wait # not running --pipefail which would interfere with subsequent tests
: $(jobs -p) # required to clear jobs for next jobs -p (interactive side effect)
sleep 20 &
+pids=$!
if [[ $(jobs -p) != $! ]]
then err_exit 'jobs -p not reporting a background job'
fi
sleep 20 &
+pids="$pids $!"
foo()
{
set -- $(jobs -p)
(( $# == 2 )) || err_exit "$# jobs not reported -- 2 expected"
}
foo
+kill $pids
+
[[ $( (trap 'print alarm' ALRM; sleep 4) & sleep 2; kill -ALRM $!; sleep 2; wait) == alarm ]] || err_exit 'ALRM signal not working'
[[ $($SHELL -c 'trap "" HUP; $SHELL -c "(sleep 2;kill -HUP $$)& sleep 4;print done"') != done ]] && err_exit 'ignored traps not being ignored'
[[ $($SHELL -c 'o=foobar; for x in foo bar; do (o=save);print $o;done' 2> /dev/null ) == $'foobar\nfoobar' ]] || err_exit 'for loop optimization subshell bug'
@@ -408,8 +412,12 @@
foo=$(false) > /dev/null && err_exit 'failed command substitution with redirection not returning false'
expected=foreback
got=$(print -n fore;(sleep 2;print back)&)
-[[ $got == $expected ]] || err_exit "command substitution background process output error -- got '$got', expected '$expected'"
-x=$(false) && err_exit 'x=$(false) should fail'
-$(false) || err_exit 'x=$(false) should not fail fail'
-$(false) > /dev/null || err_exit 'x=$(false) > /dev/null should not fail fail'
+[[ $got == $expected ]] || err_exit "command substitution background process output error -- got '$got', expected '$expected'"
+
+for false in false $(whence -p false)
+do x=$($false) && err_exit "x=\$($false) should fail"
+ $($false) && err_exit "\$($false) should fail"
+ $($false) > /dev/null && err_exit "\$($false) > /dev/null should fail"
+done
+[[ $(env 'x-a=y' $SHELL -c 'env | grep x-a') == *x-a=y* ]] || err_exit 'invalid environment variables not preserved'
exit $((Errors))
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/tests/bracket.sh new/src/cmd/ksh93/tests/bracket.sh
--- old/src/cmd/ksh93/tests/bracket.sh 2008-08-11 22:26:48.000000000 +0200
+++ new/src/cmd/ksh93/tests/bracket.sh 2008-09-18 16:29:36.000000000 +0200
@@ -239,4 +239,5 @@
[[ $e ]] && err_exit "[ ... ] compatibility check failed -- $e"
i=hell
[[ hell0 == $i[0] ]] || err_exit 'pattern $i[0] interpreded as array ref'
+test '(' = ')' && err_exit '"test ( = )" should not be true'
exit $((Errors))
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/tests/builtins.sh new/src/cmd/ksh93/tests/builtins.sh
--- old/src/cmd/ksh93/tests/builtins.sh 2008-09-04 17:57:37.000000000 +0200
+++ new/src/cmd/ksh93/tests/builtins.sh 2008-09-26 17:44:56.000000000 +0200
@@ -496,12 +496,14 @@
[[ $( . "$tmpfile") == "$tmpfile 2 1" ]] || err_exit 'dot command not working'
print -r -- "'xxx" > $tmpfile
[[ $($SHELL -c ". $tmpfile"$'\n print ok' 2> /dev/null) == ok ]] || err_exit 'syntax error in dot command affects next command'
-float sec=$SECONDS
+
+float sec=$SECONDS del=4
exec 3>&2 2>/dev/null
-$SHELL -c '( sleep 1; kill -ALRM $$ ) & sleep 3' 2> /dev/null
+$SHELL -c "( sleep 1; kill -ALRM \$\$ ) & sleep $del" 2> /dev/null
exitval=$?
-exec 2>&3-
-[[ $exitval == 0 ]] || err_exit "sleep doesn't exit 0 with ALRM interupt"
(( sec = SECONDS - sec ))
-(( sec > 2.5 )) || err_exit "ALRM signal causes sleep to terminate prematurely -- expected 3 sec, got $sec"
+exec 2>&3-
+(( exitval )) && err_exit "sleep doesn't exit 0 with ALRM interupt"
+(( sec > (del - 1) )) || err_exit "ALRM signal causes sleep to terminate prematurely -- expected 3 sec, got $sec"
+
exit $((Errors))
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/tests/comvar.sh new/src/cmd/ksh93/tests/comvar.sh
--- old/src/cmd/ksh93/tests/comvar.sh 2008-09-21 06:53:52.000000000 +0200
+++ new/src/cmd/ksh93/tests/comvar.sh 2008-09-26 23:12:26.000000000 +0200
@@ -407,4 +407,20 @@
err_exit "compound indexed array pretty print failed -- expected $exp, got $got"
}
+# array of compund variables
+typeset -C data=(
+ typeset -a samples
+)
+data.samples+=(
+ type1="greeting1"
+ timestamp1="now1"
+ command1="grrrr1"
+)
+data.samples+=(
+ type2="greeting2"
+ timestamp2="now2"
+ command2="grrrr2"
+)
+
+[[ $data == %(()) ]] || err_exit "unbalanced parenthesis with compound variable containing array of compound variables"
exit $((Errors))
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/tests/coprocess.sh new/src/cmd/ksh93/tests/coprocess.sh
--- old/src/cmd/ksh93/tests/coprocess.sh 2008-09-10 03:51:02.000000000 +0200
+++ new/src/cmd/ksh93/tests/coprocess.sh 2008-09-30 18:23:26.000000000 +0200
@@ -148,6 +148,7 @@
integer i
for ((i = 1; i <= N; i++))
do print $i |&
+ sleep 0.01
r=$r$(cat <&p)
wait $!
done
@@ -157,6 +158,7 @@
(
/bin/cat |&
+ sleep 0.01
exec 6>&p
print -u6 ok
exec 6>&-
@@ -177,10 +179,10 @@
kill $pid
sleep 2
kill $$
- ) 2> /dev/null &
+ ) &
read -p
++EOF++
- } 2> /dev/null ) != $'TRAP\nTRAP' ]]
+ } ) != $'TRAP\nTRAP' ]] 2> /dev/null
then err_exit 'traps when reading from coprocess not working'
fi
break
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/tests/enum.sh new/src/cmd/ksh93/tests/enum.sh
--- old/src/cmd/ksh93/tests/enum.sh 2008-02-25 22:29:05.000000000 +0100
+++ new/src/cmd/ksh93/tests/enum.sh 2008-09-15 18:18:00.000000000 +0200
@@ -59,4 +59,9 @@
[[ $x == Female ]] || err_exit 'Sex_t not case sensitive'
unset x y z
done
+(
+typeset -T X_t=( typeset name=aha )
+typeset -a[X_t] arr
+) 2> /dev/null
+[[ $? == 1 ]] || err_exit 'typeset -a[X_t] should generate an error message when X-t is not an enumeriation type'
exit $Errors
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/tests/functions.sh new/src/cmd/ksh93/tests/functions.sh
--- old/src/cmd/ksh93/tests/functions.sh 2008-08-01 20:46:44.000000000 +0200
+++ new/src/cmd/ksh93/tests/functions.sh 2008-09-25 15:46:33.000000000 +0200
@@ -294,6 +294,8 @@
if [[ $val != false ]]
then err_exit 'set -e not inherited for posix functions'
fi
+trap - ERR
+
function myexport
{
nameref var=$1
@@ -310,34 +312,40 @@
}
export dgk=base
-if [[ $(myexport dgk fun) != fun ]]
-then err_exit 'export inside function not working'
-fi
-val=$(export | grep "^dgk=")
-if [[ ${val#dgk=} != base ]]
-then err_exit 'export not restored after function call'
-fi
-if [[ $(myexport dgk fun fun2) != fun2 ]]
-then err_exit 'export inside function not working with recursive function'
-fi
-val=$(export | grep "^dgk=")
-if [[ ${val#dgk=} != base ]]
-then err_exit 'export not restored after recursive function call'
-fi
-if [[ $(dgk=try3 myexport dgk) != try3 ]]
-then err_exit 'name=value not added to export list with function call'
-fi
-val=$(export | grep "^dgk=")
-if [[ ${val#dgk=} != base ]]
-then err_exit 'export not restored name=value function call'
+val=$(myexport dgk fun)
+if [[ $val != fun ]]
+then err_exit "export inside function not working -- expected 'fun', got '$val'"
+fi
+val=$(export | sed -e '/^dgk=/!d' -e 's/^dgk=//')
+if [[ $val != base ]]
+then err_exit "export not restored after function call -- expected 'base', got '$val'"
+fi
+val=$(myexport dgk fun fun2)
+if [[ $val != fun2 ]]
+then err_exit "export inside function not working with recursive function -- expected 'fun2', got '$val'"
+fi
+val=$(export | sed -e '/^dgk=/!d' -e 's/^dgk=//')
+if [[ $val != base ]]
+then err_exit "export not restored after recursive function call -- expected 'base', got '$val'"
+fi
+val=$(dgk=try3 myexport dgk)
+if [[ $val != try3 ]]
+then err_exit "name=value not added to export list with function call -- expected 'try3', got '$val'"
+fi
+val=$(export | sed -e '/^dgk=/!d' -e 's/^dgk=//')
+if [[ $val != base ]]
+then err_exit "export not restored name=value function call -- expected 'base', got '$val'"
fi
unset zzz
-if [[ $(myexport zzz fun) != fun ]]
-then err_exit 'export inside function not working for zzz'
-fi
-if [[ $(export | grep "zzz=") ]]
-then err_exit 'zzz exported after function call'
+val=$(myexport zzz fun)
+if [[ $val != fun ]]
+then err_exit "export inside function not working -- expected 'fun', got '$val'"
+fi
+val=$(export | sed -e '/^zzz=/!d' -e 's/^zzz=//')
+if [[ $val ]]
+then err_exit "unset varaible exported after function call -- expected '', got '$val'"
fi
+
unset zzz
typeset -u zzz
function foo
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/tests/shtests new/src/cmd/ksh93/tests/shtests
--- old/src/cmd/ksh93/tests/shtests 2008-09-03 15:55:45.000000000 +0200
+++ new/src/cmd/ksh93/tests/shtests 2008-09-30 06:32:41.000000000 +0200
@@ -91,7 +91,10 @@
if $SHELL $i
then echo test $i passed ${time:+"at $(date +%Y-%m-%d+%H:%M:%S)"} "[ $t $T 0 ${E}s ]"
else e=$?
- E=error
+ if (( e > 256 ))
+ then e=1
+ E=signal
+ fi
if (( $e != 1 ))
then E=${E}s
fi
@@ -106,7 +109,6 @@
if (( $t != 1 ))
then T=${T}s
fi
- E=error
o=${i##*/}
o=shcomp-${o%.sh}.ksh
echo test $o begins ${time:+"at $(date +%Y-%m-%d+%H:%M:%S)"}
@@ -115,6 +117,10 @@
then if $SHELL $tmp/$o
then echo test $o passed ${time:+"at $(date +%Y-%m-%d+%H:%M:%S)"} "[ $t $T 0 ${E}s ]"
else e=$?
+ if (( e > 256 ))
+ then e=1
+ E=signal
+ fi
if (( $e != 1 ))
then E=${E}s
fi
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/tests/subshell.sh new/src/cmd/ksh93/tests/subshell.sh
--- old/src/cmd/ksh93/tests/subshell.sh 2008-09-21 19:19:08.000000000 +0200
+++ new/src/cmd/ksh93/tests/subshell.sh 2008-10-02 06:48:30.000000000 +0200
@@ -92,22 +92,35 @@
tmp=/tmp/kshsubsh$$
trap "rm -f $tmp" EXIT
-integer BS=1024 nb=64 bs no
+integer BS=1024 nb=64 ss=60 bs no
for bs in $BS 1
-do (
- $SHELL -c '
- {
- sleep 2
- kill -KILL $$
- } &
- set -- $($SHELL -c "printf %.$(('$BS'*'$nb'))c x | dd bs='$bs'")
- print ${#1}
- kill $!
- '
- ) > $tmp 2>/dev/null
+do $SHELL -c '
+ {
+ sleep '$ss'
+ kill -KILL $$
+ } &
+ set -- $(printf %.'$(($BS*$nb))'c x | dd bs='$bs')
+ print ${#1}
+ kill $!
+ ' > $tmp 2>/dev/null
no=$(<$tmp)
(( no == (BS * nb) )) || err_exit "shell hangs on command substitution output size >= $BS*$nb with write size $bs -- expected $((BS*nb)), got ${no:-0}"
done
+# this time with redirection on the trailing command
+for bs in $BS 1
+do $SHELL -c '
+ {
+ sleep 2
+ sleep '$ss'
+ kill -KILL $$
+ } &
+ set -- $(printf %.'$(($BS*$nb))'c x | dd bs='$bs' 2>/dev/null)
+ print ${#1}
+ kill $!
+ ' > $tmp 2>/dev/null
+ no=$(<$tmp)
+ (( no == (BS * nb) )) || err_exit "shell hangs on command substitution output size >= $BS*$nb with write size $bs and trailing redirection -- expected $((BS*nb)), got ${no:-0}"
+done
# exercise command substitutuion trailing newline logic w.r.t. pipe vs. tmp file io
@@ -156,4 +169,22 @@
done
done
+r=$( ($SHELL -c '
+ {
+ sleep 32
+ kill -KILL $$
+ } &
+ for v in $(set | sed "s/=.*//")
+ do command unset $v
+ done
+ typeset -Z5 I
+ for ((I = 0; I < 1024; I++))
+ do eval A$I=1234567890
+ done
+ a=$(set 2>&1)
+ print ok
+ kill -KILL $!
+') 2>/dev/null)
+[[ $r == ok ]] || err_exit "large subshell command substitution hangs"
+
exit $Errors
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/tests/types.sh new/src/cmd/ksh93/tests/types.sh
--- old/src/cmd/ksh93/tests/types.sh 2008-09-17 19:04:14.000000000 +0200
+++ new/src/cmd/ksh93/tests/types.sh 2008-10-03 16:56:57.000000000 +0200
@@ -138,5 +138,77 @@
typeset -T xx=(typeset yy=zz)
xx=yy
{ typeset -T xx=(typeset yy=zz) ;} 2>/dev/null && err_exit 'type redefinition should fail'
+$SHELL 2> /dev/null <<- +++ || err_exit 'typedef with only f(){} fails'
+ typeset -T X_t=(
+ f()
+ {
+ print ok
+ }
+ )
++++
+$SHELL 2> /dev/null <<- +++ || err_exit 'unable to redefine f discipline function'
+ typeset -T X_t=(
+ x=1
+ f()
+ {
+ print ok
+ }
+ )
+ X_t z=(
+ function f
+ {
+ print override f
+ }
+ )
++++
+$SHELL 2> /dev/null <<- +++ && err_exit 'invalid discipline name should be an error'
+ typeset -T X_t=(
+ x=1
+ f()
+ {
+ print ok
+ }
+ )
+ X_t z=(
+ function g
+ {
+ print override f
+ }
+ )
++++
+# compound variables containing type variables
+Type_t r
+var=(
+ typeset x=foobar
+ Type_t r
+ integer z=5
+)
+[[ ${var.r} == "$r" ]] || err_exit 'var.r != r'
+(( var.z == 5)) || err_exit 'var.z !=5'
+[[ "$var" == *x=foobar* ]] || err_exit '$var does not contain x=foobar'
+
+exit $Errors # until ksh93t+
+
+typeset -T Fileinfo_t=(
+ size=-1
+ typeset -a text=()
+ integer mtime=-1
+)
+Fileinfo_t -A _Dbg_filenames
+Fileinfo_t finfo
+function bar
+{
+ finfo.text=(line1 line2 line3)
+ finfo.size=${#finfo.text[@]}
+ _Dbg_filenames[foo]=finfo
+}
+bar
+
+expected='Fileinfo_t -A _Dbg_filenames=([foo]=(size=2;typeset -C -a text=([0]=line1 [1]=line2 [2]=line3);typeset -l -i mtime=-1;))'
+got=$(typeset -p _Dbg_filenames)
+[[ "$got" == "$expected" ]] || {
+ got=$(printf %q "$got")
+ err_exit "copy to associative array of types in function failed -- expected '$expected', got '$got'"
+}
exit $Errors
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/ksh93/tests/variables.sh new/src/cmd/ksh93/tests/variables.sh
--- old/src/cmd/ksh93/tests/variables.sh 2008-09-11 18:02:08.000000000 +0200
+++ new/src/cmd/ksh93/tests/variables.sh 2008-10-02 09:31:33.000000000 +0200
@@ -27,6 +27,7 @@
Command=${0##*/}
integer Errors=0
+
[[ ${.sh.version} == "$KSH_VERSION" ]] || err_exit '.sh.version != KSH_VERSION'
unset ss
[[ ${@ss} ]] && err_exit '${@ss} should be empty string when ss is unset'
@@ -481,9 +482,26 @@
}
unset dave
[[ $(typeset +f) == *dave.* ]] && err_exit 'unset discipline not removed'
-print 'print ${VAR}' > /tmp/script$$
-VAR=foo /tmp/script$$ > /tmp/out$$
-[[ $( /tmp/script$$
+unset VAR
+VAR=new /tmp/script$$ > /tmp/out$$
+got=$( /tmp/out$$
+got=$( /tmp/out$$
+got=$(/dev/null || err_exit "$v=C; $v=$x failed -- expected 'C'"
done
PATH=$path
-[[ ${.sh.subshell} == 0 ]] || err_exit '${.sh.subshell} should be 0'
-(
- [[ ${.sh.subshell} == 1 ]] || err_exit '${.sh.subshell} should be 1'
- (
- [[ ${.sh.subshell} == 2 ]] || err_exit '${.sh.subshell} should be 2'
- )
-)
-
-set -- {1..32768}
-(( $# == 32768 )) || err_exit "\$# failed -- expected 32768, got $#"
-set --
exit $((Errors))
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/lib/libast/Mamfile new/src/lib/libast/Mamfile
--- old/src/lib/libast/Mamfile 2008-09-21 19:35:13.000000000 +0200
+++ new/src/lib/libast/Mamfile 2008-10-03 18:17:17.000000000 +0200
@@ -96,10 +96,6 @@
done ast_common.h dontcare generated
done std/bytesex.h dontcare
done std/endian.h dontcare
-make comp/getopt.h implicit
-make include/ast_getopt.h implicit
-done include/ast_getopt.h dontcare
-done comp/getopt.h dontcare
done FEATURE/param generated
prev ast_map.h
make ast_limits.h
@@ -155,6 +151,10 @@
done conftab.c generated
done joint.conflim.h virtual
prev FEATURE/param implicit
+make comp/getopt.h implicit
+make include/ast_getopt.h implicit
+done include/ast_getopt.h dontcare
+done comp/getopt.h dontcare
prev FEATURE/common implicit
prev FEATURE/lib implicit
prev FEATURE/standards implicit
@@ -391,7 +391,7 @@
prev FEATURE/param implicit
done features/mode.c
prev ast.req
-exec - iffe -v -X ast -X std -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Icomp -Iinclude -Istd ${LDFLAGS} ' run features/mode.c
+exec - iffe -v -X ast -X std -c '${CC} ${mam_cc_FLAGS} ${CCFLAGS} -I. -Iinclude -Istd ${LDFLAGS} ' run features/mode.c
done FEATURE/mode generated
exec - cmp 2>/dev/null -s FEATURE/mode ast_mode.h || { rm -f ast_mode.h; silent test -d . || mkdir .; ${STDCP} FEATURE/mode ast_mode.h; }
done ast_mode.h dontcare generated
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/lib/libsum/Mamfile new/src/lib/libsum/Mamfile
--- old/src/lib/libsum/Mamfile 2008-09-12 18:27:32.000000000 +0200
+++ new/src/lib/libsum/Mamfile 2008-10-03 18:17:18.000000000 +0200
@@ -89,6 +89,8 @@
done sha2.h dontcare virtual
make sha1.h implicit
done sha1.h dontcare virtual
+make md5.h implicit
+done md5.h dontcare virtual
make md4.h implicit
done md4.h dontcare virtual
done sum-lmd.c dontcare
++++++ INIT.2008-09-21.tar.bz2 -> INIT.2008-10-01.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/bin/package new/bin/package
--- old/bin/package 2008-09-21 19:20:37.000000000 +0200
+++ new/bin/package 2008-09-25 17:22:43.000000000 +0200
@@ -44,7 +44,7 @@
case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
0123) USAGE=$'
[-?
-@(#)$Id: package (AT&T Research) 2008-06-24 $
+@(#)$Id: package (AT&T Research) 2008-09-24 $
]'$USAGE_LICENSE$'
[+NAME?package - source and binary package control]
[+DESCRIPTION?The \bpackage\b command controls source and binary
@@ -256,7 +256,9 @@
output is also captured in
\b$INSTALLROOT/lib/package/gen/test.out\b. In general a package
must be made before it can be tested. Components tested with
- the \bregress\b(1) command require \bksh93\b.]
+ the \bregress\b(1) command require \bksh93\b. If \bonly\b is
+ also specified then only the listed package components are
+ tested, otherwise the closure of the components is tested.]
[+update\b [ beta ]] [ binary ]] [ source ]] [\aarchitecture\a ... ]] [ \aurl\a ]] [ \apackage\a ... ]]?Download
the latest release of the selected and required packages from \aurl\a
(e.g., \bhttp://www.research.att.com/sw/download\b) into the directory
@@ -1054,7 +1056,10 @@
Run the regression tests for PACKAGE. If the standard output
is a terminal then the output is also captured in
\$INSTALLROOT/lib/package/gen/test.out. In general a package
- must be made before it can be tested.
+ must be made before it can be tested. Components tested with
+ the \bregress\b(1) command require \bksh93\b. If only is
+ also specified then only the listed package components are
+ tested, otherwise the closure of the components is tested.
update [ beta ] [ binary ] [ source ] [ ARCHITECTURE ... ] [ URL ] [ PACKAGE ... ]
Download the latest release of the selected and required
packages from URL (e.g.,
@@ -3527,8 +3532,7 @@
*) _components_="$_components_ $p" ;;
esac
;;
- *)
- if view - src lib/package/$p.pkg
+ *) if view - src lib/package/$p.pkg
then p=$_view_
op=::
exec < $p
@@ -4016,16 +4020,31 @@
view file src lib/package/admin/$admin_db || exit 1
admin_db=$_view_
done
+ admin_components=
case $admin_action in
list) cat $admin_db
exit
;;
+ test) set $admin_args
+ while :
+ do case $# in
+ 1) break ;;
+ esac
+ shift
+ case $1 in
+ *=*) ;;
+ *) admin_components=-$1
+ break
+ ;;
+ esac
+ done
+ ;;
esac
: all work done in $PACKAGESRC/admin
cd $PACKAGESRC/admin || exit
checksrc
packages=
- admin_log=$admin_action.log
+ admin_log=${admin_action}${admin_components}.log
exec < $admin_db || exit
test -d $admin_log || $exec mkdir $admin_log || exit
case $admin_on in
@@ -4048,6 +4067,9 @@
*) admin_binary=
;;
esac
+ case $only in
+ 1) admin_args="only $admin_args" ;;
+ esac
trap 'kill $pids >/dev/null 2>&1' 1 2 3 15
index=0
while read type host root date time make test write junk
@@ -6141,6 +6163,10 @@
test) requirements source $package
components $package
package=$_components_
+ case $only in
+ 0) only= ;;
+ 1) only=--recurse=only ;;
+ esac
# must have nmake
@@ -6159,7 +6185,7 @@
# do the tests
- eval capture \$MAKE \$makeflags \$noexec recurse test \$target \$nmakesep \$package $assign
+ eval capture \$MAKE \$makeflags \$noexec \$only recurse test \$target \$nmakesep \$package $assign
;;
update) # download the latest release.version for selected packages
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/lib/package/INIT.html new/lib/package/INIT.html
--- old/lib/package/INIT.html 2008-09-21 19:35:07.000000000 +0200
+++ new/lib/package/INIT.html 2008-10-03 18:09:26.000000000 +0200
@@ -48,6 +48,10 @@
<P><HR><CENTER><FONT color=red><FONT face=courier><H3><A name="INIT changes">INIT changes</A></H3></FONT></FONT></CENTER>
<PRE>
+08-09-30 rt.sh: fix ksh93 regression test signal count
+08-09-26 regress.sh: ignore SIGPIPE for SET pipe-input
+08-09-24 package.sh: package only test foo => make --recurse=only recurse tests foo
+08-09-20 make.probe: handle another /usr/bin/file shared lib description
08-09-20 regress.sh: add --pipefail for SET pipe-input ...
08-09-17 Makefile: add gdbm1.c for <gdbm-ndbm.h>
08-09-10 make.probe: add CC.NOPROTECT
@@ -858,7 +862,7 @@
<TR>
<TD align=left></TD>
<TD align=center></TD>
-<TD align=right>September 21, 2008</TD>
+<TD align=right>October 03, 2008</TD>
</TR>
</TABLE>
<P>
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/lib/package/INIT.README new/lib/package/INIT.README
--- old/lib/package/INIT.README 2008-09-21 19:35:06.000000000 +0200
+++ new/lib/package/INIT.README 2008-10-03 18:09:26.000000000 +0200
@@ -92,6 +92,10 @@
:::::::: INIT ::::::::
+08-09-30 rt.sh: fix ksh93 regression test signal count
+08-09-26 regress.sh: ignore SIGPIPE for SET pipe-input
+08-09-24 package.sh: package only test foo => make --recurse=only recurse tests foo
+08-09-20 make.probe: handle another /usr/bin/file shared lib description
08-09-20 regress.sh: add --pipefail for SET pipe-input ...
08-09-17 Makefile: add gdbm1.c for
08-09-10 make.probe: add CC.NOPROTECT
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/lib/package/INIT.ver new/lib/package/INIT.ver
--- old/lib/package/INIT.ver 2008-09-21 19:35:06.000000000 +0200
+++ new/lib/package/INIT.ver 2008-10-03 18:17:14.000000000 +0200
@@ -1 +1 @@
-INIT 2008-09-21 2008-09-21 1
+INIT 2008-10-01 2008-10-01 1
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/INIT/make.probe new/src/cmd/INIT/make.probe
--- old/src/cmd/INIT/make.probe 2008-09-16 16:21:08.000000000 +0200
+++ new/src/cmd/INIT/make.probe 2008-09-23 17:21:05.000000000 +0200
@@ -2,7 +2,7 @@
# Glenn Fowler
# AT&T Research
#
-# @(#)make.probe (AT&T Research) 2008-09-10
+# @(#)make.probe (AT&T Research) 2008-09-22
#
# C probe for make
#
@@ -694,7 +694,7 @@
[012]) continue ;;
esac
;;
- *archive*not*stripped*)
+ *archive*not*stripped*|*data*dynamic*not*stripped*)
$executable xxx$dll || continue
;;
*) continue
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/INIT/Mamfile new/src/cmd/INIT/Mamfile
--- old/src/cmd/INIT/Mamfile 2008-09-21 19:35:07.000000000 +0200
+++ new/src/cmd/INIT/Mamfile 2008-10-03 18:17:14.000000000 +0200
@@ -491,8 +491,6 @@
make mamake.c
make shlib-compat.h implicit
done shlib-compat.h dontcare virtual
-make bp-sym.h implicit
-done bp-sym.h dontcare virtual
make ast.h implicit
done ast.h dontcare virtual
done mamake.c
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/INIT/package.sh new/src/cmd/INIT/package.sh
--- old/src/cmd/INIT/package.sh 2008-06-24 22:50:09.000000000 +0200
+++ new/src/cmd/INIT/package.sh 2008-09-25 17:22:40.000000000 +0200
@@ -62,7 +62,7 @@
case `(getopts '[-][123:xyz]' opt --xyz; echo 0$opt) 2>/dev/null` in
0123) USAGE=$'
[-?
-@(#)$Id: package (AT&T Research) 2008-06-24 $
+@(#)$Id: package (AT&T Research) 2008-09-24 $
]'$USAGE_LICENSE$'
[+NAME?package - source and binary package control]
[+DESCRIPTION?The \bpackage\b command controls source and binary
@@ -274,7 +274,9 @@
output is also captured in
\b$INSTALLROOT/lib/package/gen/test.out\b. In general a package
must be made before it can be tested. Components tested with
- the \bregress\b(1) command require \bksh93\b.]
+ the \bregress\b(1) command require \bksh93\b. If \bonly\b is
+ also specified then only the listed package components are
+ tested, otherwise the closure of the components is tested.]
[+update\b [ beta ]] [ binary ]] [ source ]] [\aarchitecture\a ... ]] [ \aurl\a ]] [ \apackage\a ... ]]?Download
the latest release of the selected and required packages from \aurl\a
(e.g., \bhttp://www.research.att.com/sw/download\b) into the directory
@@ -1072,7 +1074,10 @@
Run the regression tests for PACKAGE. If the standard output
is a terminal then the output is also captured in
\$INSTALLROOT/lib/package/gen/test.out. In general a package
- must be made before it can be tested.
+ must be made before it can be tested. Components tested with
+ the \bregress\b(1) command require \bksh93\b. If only is
+ also specified then only the listed package components are
+ tested, otherwise the closure of the components is tested.
update [ beta ] [ binary ] [ source ] [ ARCHITECTURE ... ] [ URL ] [ PACKAGE ... ]
Download the latest release of the selected and required
packages from URL (e.g.,
@@ -3545,8 +3550,7 @@
*) _components_="$_components_ $p" ;;
esac
;;
- *)
- if view - src lib/package/$p.pkg
+ *) if view - src lib/package/$p.pkg
then p=$_view_
op=::
exec < $p
@@ -4034,16 +4038,31 @@
view file src lib/package/admin/$admin_db || exit 1
admin_db=$_view_
done
+ admin_components=
case $admin_action in
list) cat $admin_db
exit
;;
+ test) set $admin_args
+ while :
+ do case $# in
+ 1) break ;;
+ esac
+ shift
+ case $1 in
+ *=*) ;;
+ *) admin_components=-$1
+ break
+ ;;
+ esac
+ done
+ ;;
esac
: all work done in $PACKAGESRC/admin
cd $PACKAGESRC/admin || exit
checksrc
packages=
- admin_log=$admin_action.log
+ admin_log=${admin_action}${admin_components}.log
exec < $admin_db || exit
test -d $admin_log || $exec mkdir $admin_log || exit
case $admin_on in
@@ -4066,6 +4085,9 @@
*) admin_binary=
;;
esac
+ case $only in
+ 1) admin_args="only $admin_args" ;;
+ esac
trap 'kill $pids >/dev/null 2>&1' 1 2 3 15
index=0
while read type host root date time make test write junk
@@ -6159,6 +6181,10 @@
test) requirements source $package
components $package
package=$_components_
+ case $only in
+ 0) only= ;;
+ 1) only=--recurse=only ;;
+ esac
# must have nmake
@@ -6177,7 +6203,7 @@
# do the tests
- eval capture \$MAKE \$makeflags \$noexec recurse test \$target \$nmakesep \$package $assign
+ eval capture \$MAKE \$makeflags \$noexec \$only recurse test \$target \$nmakesep \$package $assign
;;
update) # download the latest release.version for selected packages
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/INIT/proto.c new/src/cmd/INIT/proto.c
--- old/src/cmd/INIT/proto.c 2008-08-28 18:03:36.000000000 +0200
+++ new/src/cmd/INIT/proto.c 2008-09-29 16:42:30.000000000 +0200
@@ -77,7 +77,7 @@
#if !defined(__LINKAGE__)
#define __LINKAGE__ /* 2004-08-11 transition */
#endif
-#line 1 "proto.c"
+#line 1 "/home/gsf/src/cmd/proto/proto.c"
#line 147
@@ -195,14 +195,14 @@
# undef utime
# define utime ______utime
-#line 1 "../../lib/libpp/ppproto.c"
+#line 1 "/home/gsf/src/lib/libpp/ppproto.c"
#line 13
static const char id[] = "\n@(#)$Id: proto (AT&T Research) 2008-05-11 $\000\n";
-#line 1 "../../lib/libpp/ppfsm.c"
+#line 1 "/home/gsf/src/lib/libpp/ppfsm.c"
-#line 1 "../../lib/libpp/pplib.h"
+#line 1 "/home/gsf/src/lib/libpp/pplib.h"
#line 108
struct ppsymbol;
@@ -311,7 +311,7 @@
struct ppfileid id;
};
-#line 1 "../../lib/libpp/pp.h"
+#line 1 "/home/gsf/src/lib/libpp/pp.h"
#line 206
@@ -415,20 +415,20 @@
extern __MANGLE__ int ppprintf __PROTO__((char*, ...));
extern __MANGLE__ int ppsync __PROTO__((void));
-#line 366 "../../lib/libpp/pplib.h"
+#line 366 "/home/gsf/src/lib/libpp/pplib.h"
#line 1 "../../lib/libpp/ppdef.h"
-#line 367 "../../lib/libpp/pplib.h"
+#line 367 "/home/gsf/src/lib/libpp/pplib.h"
-#line 1 "../../lib/libpp/ppkey.h"
+#line 1 "/home/gsf/src/lib/libpp/ppkey.h"
#line 16
#line 125
extern __MANGLE__ struct ppkeyword ppkey[];
-#line 368 "../../lib/libpp/pplib.h"
+#line 368 "/home/gsf/src/lib/libpp/pplib.h"
#line 681
struct ppcontext
@@ -528,9 +528,9 @@
extern __MANGLE__ char* pptokstr __PROTO__((char*, int));
extern __MANGLE__ void pptrace __PROTO__((int));
-#line 11 "../../lib/libpp/ppfsm.c"
+#line 11 "/home/gsf/src/lib/libpp/ppfsm.c"
-#line 1 "../../lib/libpp/ppfsm.h"
+#line 1 "/home/gsf/src/lib/libpp/ppfsm.h"
#line 185
@@ -545,7 +545,7 @@
extern __MANGLE__ void _pp_refill __PROTO__((int));
-#line 12 "../../lib/libpp/ppfsm.c"
+#line 12 "/home/gsf/src/lib/libpp/ppfsm.c"
#line 67
@@ -1272,7 +1272,7 @@
-#line 18 "../../lib/libpp/ppproto.c"
+#line 18 "/home/gsf/src/lib/libpp/ppproto.c"
#line 1 "../../../include/ast/hashkey.h"
@@ -1282,7 +1282,7 @@
#line 68
extern __MANGLE__ long strkey __PROTO__((const char*));
-#line 20 "../../lib/libpp/ppproto.c"
+#line 20 "/home/gsf/src/lib/libpp/ppproto.c"
#line 41
struct proto
@@ -1443,7 +1443,7 @@
return s;
}
-#line 1 "../../lib/libast/port/astlicense.c"
+#line 1 "/home/gsf/src/lib/libast/port/astlicense.c"
@@ -2483,7 +2483,7 @@
comment(¬ice, &buf, ((char*)0), -1, 0);
return (*(( &buf)->nxt>=( &buf)->end?(( &buf)->nxt=( &buf)->end-1):( &buf)->nxt)=0,( &buf)->nxt-( &buf)->buf);
}
-#line 306 "../../lib/libpp/ppproto.c"
+#line 306 "/home/gsf/src/lib/libpp/ppproto.c"
#line 318
static char*
@@ -4647,7 +4647,7 @@
-#line 265 "proto.c"
+#line 265 "/home/gsf/src/cmd/proto/proto.c"
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/INIT/regress.sh new/src/cmd/INIT/regress.sh
--- old/src/cmd/INIT/regress.sh 2008-09-20 08:43:45.000000000 +0200
+++ new/src/cmd/INIT/regress.sh 2008-09-26 08:51:23.000000000 +0200
@@ -23,7 +23,7 @@
case $(getopts '[-][123:xyz]' opt --xyz 2>/dev/null; echo 0$opt) in
0123) USAGE=$'
[-?
-@(#)$Id: regress (AT&T Research) 2008-09-20 $
+@(#)$Id: regress (AT&T Research) 2008-09-26 $
]
'$USAGE_LICENSE$'
[+NAME?regress - run regression tests]
@@ -438,7 +438,7 @@
then if [[ ! $TEST_quiet ]]
then print -nu2 "$LABEL"
fi
- cat <$TWD/INPUT | COMMAND "${ARGS[@]}" >$TWD/OUTPUT 2>$TWD/ERROR
+ (trap '' PIPE; cat <$TWD/INPUT 2>/dev/null; exit 0) | COMMAND "${ARGS[@]}" >$TWD/OUTPUT 2>$TWD/ERROR
STATUS=$?
RESULTS 'pipe input'
fi
@@ -454,7 +454,7 @@
then if [[ ! $TEST_quiet ]]
then print -nu2 "$LABEL"
fi
- cat <$TWD/INPUT | COMMAND "${ARGS[@]}" 2>$TWD/ERROR | cat >$TWD/OUTPUT
+ (trap '' PIPE; cat <$TWD/INPUT 2>/dev/null; exit 0) | COMMAND "${ARGS[@]}" 2>$TWD/ERROR | cat >$TWD/OUTPUT
STATUS=$?
RESULTS 'pipe io'
fi
@@ -1208,7 +1208,7 @@
fi
fi
TWD=$PWD/$UNIT.tmp
-PMP=$(/bin/pwd)/$UNIT.tmp
+PMP=$(pwd -P)/$UNIT.tmp
UMASK_ORIG=$(umask)
UMASK=$UMASK_ORIG
ARGV=("$@")
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/INIT/RELEASE new/src/cmd/INIT/RELEASE
--- old/src/cmd/INIT/RELEASE 2008-09-20 09:03:35.000000000 +0200
+++ new/src/cmd/INIT/RELEASE 2008-10-01 14:08:09.000000000 +0200
@@ -1,3 +1,7 @@
+08-09-30 rt.sh: fix ksh93 regression test signal count
+08-09-26 regress.sh: ignore SIGPIPE for SET pipe-input
+08-09-24 package.sh: package only test foo => make --recurse=only recurse tests foo
+08-09-20 make.probe: handle another /usr/bin/file shared lib description
08-09-20 regress.sh: add --pipefail for SET pipe-input ...
08-09-17 Makefile: add gdbm1.c for
08-09-10 make.probe: add CC.NOPROTECT
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/src/cmd/INIT/rt.sh new/src/cmd/INIT/rt.sh
--- old/src/cmd/INIT/rt.sh 2008-04-24 21:27:26.000000000 +0200
+++ new/src/cmd/INIT/rt.sh 2008-10-01 14:07:32.000000000 +0200
@@ -29,7 +29,7 @@
0123) ARGV0="-a $command"
USAGE=$'
[-?
-@(#)$Id: rt (AT&T Research) 2008-04-24 $
+@(#)$Id: rt (AT&T Research) 2008-09-30 $
]
'$USAGE_LICENSE$'
[+NAME?rt - run "nmake test" and filter output]
@@ -249,6 +249,20 @@
shift
done
;;
+ *' [ '*test*signal*' ]')
+ while :
+ do case $1 in
+ '[') tests=$2
+ signals=$4
+ if (( signals ))
+ then (( errors++ ))
+ fi
+ break
+ ;;
+ esac
+ shift
+ done
+ ;;
*) if [[ $3 != passed ]]
then (( errors )) || (( errors++ ))
fi
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org