Commit graph

29 commits

Author SHA1 Message Date
wiz
4159fec634 Fix typo in previous.
Update was ok'd by dillo@
2010-01-05 11:21:42 +00:00
wiz
f30631d1c9 Update to 20091218, provided by J.A.Neitzel in PR 42536. Set LICENSE.
Changes:
1) This update fixes a compilation problem on AIX caused by not
wrapping WCOREDUMP(s) with #ifdef WCOREDUMP ... #endif.

2) General code cleanup and rechecking w/ splint(1) reduces
unnecessary code duplication and eases future maintenance.

3) This update adds the program name to osh diagnostics (e.g.,
"osh: syntax error") for the sake of user friendliness.
2010-01-05 11:21:20 +00:00
obache
851bde15b1 Update osh to 20090527, per maintainer update request by PR#41509.
Upstream changes between osh-20081213 and osh-20090527 follow:

osh bug fixes:

1) This release fixes an `echo' bug that causes `echo ""' to print an
   unnecessary diagnostic.

2) It also fixes a `sigign' bug that can cause incorrect signal ignoring
   behavior for subshells.

New osh features:

1) This release adds `cd' as a synonym for the `chdir' special command.

2) It also adds $m as a special parameter for the value of the MANPATH
   environment variable.
2009-05-30 12:49:44 +00:00
obache
ab79d87bc6 Update osh to 20081213, by maintainer's update request via PR 40157.
Upstream changes between osh-20081122 and osh-20081213 follow.

osh.c:
This release changes the effect of the `-v' command-line option so that,
in addition to printing non-blank command lines to the standard error,
it also prints each blank/empty command line as an empty line.

fd2.c, util.c:
This release changes the fd2 `-e' command-line option so that it
reflects the documented behavior.  For example, this change causes
invocation of `fd2 -ef file command' to redirect both conventional
output and diagnostic output from "command" to "file".
2008-12-13 14:14:49 +00:00
reed
21c8bbfa75 Update shells/osh
Add new maintainer. Thank you J.A.
The following is from PR #40006:

I would like to maintain this package if that is acceptable.
Thus, I added myself as MAINTAINER.

Changed files: DESCR, Makefile, PLIST, distinfo

Changes between osh-20080629 and osh-20081122 which affect the osh
package on the various pkgsrc platforms are described below.

------------------------------------------------------------------------
[osh-20081122]:
mkconfig:
        * Added a case for DragonFly BSD (uname -s == DragonFly).

osh.c:
        * Fixed a bug introduced in osh-20061230 where the shell
          incorrectly handles an unescaped terminating backslash (\)
          character at the end of string when the shell is invoked as
          `osh -c string'.  In this case, the terminating backslash
          causes the shell to incorrectly read from the standard input
          at the end of string.
          For example:

                % osh -c 'echo Hello\'
                to\
                you!
                Hello to you!

          This example should instead do nothing and exit w/ a zero
          status.  For `osh -c string', an unescaped terminating
          backslash should effectively turn string into a no-op.
          Now, it behaves as expected.

------------------------------------------------------------------------
[osh-20081026]:
Makefile:
        * Changed the "oshall" target to only build osh since the fd2,
          goto, and if utilities are now built into the shell.

        * Changed the "install-oshall" target to only install osh and
          its manual pages.  This includes the fd2.1, goto.1, and if.1
          manual pages since they are not fully documented elsewhere.

osh.c:
        * Renamed cmd_index() to cmd_lookup(), and changed the algorithm
          from a linear search to a binary search.

        * Added a base reallocation multiplier to glob() to reduce the
          number of realloc()s required for very large argument vectors
          while allowing the first malloc() to be a relatively small
          allocation for up to 126 matching file-name arguments.

util.c:
        * This is a new file for the integrated shell utilities.

        * Added a new `-e' command-line option to fd2 to simplify
          redirecting all conventional output to the standard error
          as diagnostic output.

        * Integrated the external `fd2', `goto', and `if' shell
          utilities as special built-in commands to improve shell
          performance.  Also, added `echo' as a special built-in
          command.  Osh executes each of these built-ins in a subshell.
          Consequently, the I/O for each can be redirected as before,
          and the argument list for each can be the result of a call to
          glob() as before.
2008-11-23 03:26:14 +00:00
obache
7cdc0a67be Update osh to 20080629, requested by PR 39067.
Significant changes include the following:

1) Support was added for 3 new command-line options: "-i", "-l", and "-v".

2) Support was added for 3 new rc files.

   *) This includes a system-wide "osh.oshrc",
      a system-wide "osh.logout", and a user ".osh.logout".

See http://v6shell.org/src/CHANGES for full details.
2008-07-18 14:58:31 +00:00
obache
1fccd09af4 Update osh to 20080109.
Based on patch provided by Jeffrey Allen Neitzel in PR 37737.
My modification:
 * Honor PKGMANDIR
 * Update MASTER_SITES and HOMEPAGE to new location.

Changes:
[osh-20080109]:
	* New file:  mkconfig  (see Build/Install Changes)

	* Moved files:	Moved manual pages from *.1 to *.1.in to make their
			generation and installation simpler in the Makefile.

Build/Install Changes:
	* Stopped defining _XOPEN_SOURCE when compiling on Mac OS X, NetBSD,
	  and OpenBSD.  It is simply not necessary.  However, _XOPEN_SOURCE
	  and _BSD_SOURCE are necessary on GNU/Linux systems.

	* Added a simple configure script, mkconfig.  It is automatically
	  invoked from the Makefile to write out an appropriate "config.h"
	  file according to the osh package's needs on the given system.  It
	  simply sets PATH_LOGIN, PATH_NEWGRP, _XOPEN_SOURCE, and _BSD_SOURCE
	  as needed so that the user does not need to bother w/ doing it
	  manually at build time.

osh.c:
	* Patched the code to fix a "$0" parameter-substitution problem w/
	  the `source' command in the following interactive context:

		% cat >file
		echo \$0 == \"$0\"
		echo \$1 == \"$1\"
		^D
		% source file ;		: ... gives correct value for "$0".
		$0 == ""
		$1 == ""
		% source file arg ;	: ... gives incorrect value for "$0".
		$0 == "0"
		$1 == "arg"

	  getdolp() indirectly caused the problem by returning a NULL pointer
	  when the intended result was a pointer to the empty string.  This
	  problem was not fatal, as the shell handles NULL pointers from
	  getdolp() anyway.  However, NULL is supposed to indicate an
	  error where the specified parameter means nothing to the shell...
	  For example:

		% echo \$Z == \"$Z\"
		$Z == "Z"

	* Changed the source command's parameter-substitution behavior so
	  that $0 always results in the name of the sourced command file,
	  not the name inherited from the main shell context.  This makes
	  the parameter-substitution behavior of sourced command files
	  just like that of any other osh command file.  Plus, this is
	  the documented behavior.

osh.1.in, sh6.1.in:
	* Revised some wording to remove some cases of possible ambiguity.

-------------------------------------------------------------------------------
[osh-20070707]:
	* Added a new file, INSTALL, which contains build and install
	  instructions.  Made reference to INSTALL in Makefile and README.

Makefile:
	* Added 3 new variables, MOXARCH, MOXSHELLARCH, and MOXUTILSARCH, to
	  simplify building universal binaries for Mac OS X.  These are unset
	  by default.  See INSTALL for more info.

	* Changed the default value for SYSCONFDIR from /etc to $(PREFIX)/etc.

osh.c:
	* Changed the reserved file descriptors from (7 - 9) to (10 - 12) in
	  order to avoid fd conflict w/ rxvt-unicode (version 8.2).  This
	  conflict prevented `chdir -' from functioning correctly, but this
	  problem is now fixed.

	  The problem was clearly visible when running an interactive instance
	  of osh under the rxvt-unicode daemon (urxvtd) on Mac OS X.  However,
	  I never saw this type of conflict when running under any other type
	  of terminal emulator on any OS.  Thus, I do not know if this was
	  only an osh problem, a urxvtd problem, a Mac OS X problem, or some
	  combination of the 3...
2008-01-19 12:08:29 +00:00
heinz
e20b55a52d The package supports installation to DESTDIR. 2007-05-12 16:18:55 +00:00
reed
d6c5898466 Revert PLIST.
Use different install target.

Bump PKGREVISION.

This is also for PR 36080.

(TODO: look at SYSCONFDIR which is /etc.)
2007-03-26 17:01:59 +00:00
reed
480487fae3 Add glob6 and sh6 and respective manpages to PLIST.
Not bumping PKGREVISION as my update was a few minutes ago.

This is for PR 36080.
2007-03-26 16:58:25 +00:00
reed
2a6757e603 Update osh to version 20070324. This is for PR 36080 from upstream
developer.

pkgsrc changes include:

Use BUILD_TARGET=oshall as request in PR.
And make it work with PKGMANDIR.

CHANGES file includes:

Changes that improve compatibility w/ the Sixth Edition Unix shell
are marked w/ a `C:' in the details below.

-------------------------------------------------------------------------------
[osh-20070324]:
osh.c:
	* In main(), changed when fdfree() is called so that it is in a more
	  ideal sequence with other operations according to how the shell is
	  invoked (e.g., interactive shell vs. non-interactive shell).

-------------------------------------------------------------------------------
[osh-20070321]:
	* Imported the project into a local subversion repository.

	* Changed the all of the code to "#include <stdbool.h>" and to use
	  the "bool" data-type macro where appropriate.

Makefile:
	* Added SYSCONFDIR and a new `man' target.

osh.c:
	* Defined _PATH_SYSTEM_LOGIN as `SYSCONFDIR/**/"/osh.login"' instead
	  of "/etc/osh.login" so that the user can use SYSCONFDIR (/etc by
	  default) at build-time to specify the directory where the shell
	  shall search for its system-wide initialization file.

	* Added a new special parameter, $v, which makes the version of the
	  osh package available as a read-only string.  The format is
	  `osh-YYYYMMDD' for official releases and `osh-current (YYYYMMDD)'
	  (interpreted as one word) for development snapshots.

	* Fixed a bug where interactive shells were no longer ignoring SIGTERM
	  when invoked, as they are supposed to.  Now, SIGTERM is being ignored
	  again upon invocation of all interactive shells.

	* Fixed the output from doing a `sigign' so that it matches its
	  documentation in osh.1: "..., a list is printed of those signals
	  which are ignored by sigign in the current shell."

	  Previously, the output from a `sigign' could be a little confusing.
	  Now, its output only indicates those cases where a given signal is
	  being ignored w/ the possibility that it can then be unignored
	  (reset) in the current shell context.

if.c:
	* Added 3 new primaries: -ef (equal files - same device, same inode),
	  -nt (newer than), -ot (older than).  See the if(1) manual page for
	  full details.

-------------------------------------------------------------------------------
[osh-20070131]:
osh.1:
	* Made a few minimal changes to synchronize the manual w/ the code.

osh.c	1.2 (jneitzel) 2007/01/14:
	* Changed the `chdir: No old directory' diagnostic to
	  `chdir: No previous directory' to match the manual.

-------------------------------------------------------------------------------
[osh-20061230]:
	The following files have been removed in this release:
		examples/*: These files are now available at:
			    http://jneitzel.sdf1.org/osh/initialization_files/
		   tests/*: ... until I have a chance to rewrite them ...

*.1:
	* Changed all instances of `UNIX' to `Unix' since the name
	  of the Unix operating system is not an acronym.

pexec.c:
	* Fixed a possible, but very unlikely, memory leak.

osh.c:
	C: Rewrote the shell!  It is now a combination of the ports of the
	   original source code from sh6.c and glob6.c (see CHANGES_sh-to-sh6)
	   w/ the prior enhancements which were found in osh-060124/osh*.[ch] .

fd2.c:
	* Removed the call to lseek(2) to end-of-file for errors.
	  The shell determines when this is necessary.

	* Changed the `: no shell' diagnostic to `: No shell!'
	  in the spirit of sh6(1).

goto.c:
	* Fixed a bug which interfered w/ finding a requested label when
	  its first character had the high-order bit set.  The value of the
	  first character is now passed to getlabel() as an unsigned char
	  converted to an int to allow correct comparison in such a case.

if.c:
	* Removed the call to lseek(2) to end-of-file for errors.
	  The shell determines when this is necessary.

	* Changed the method used to build the argument list for all commands
	  executed by this utility, and removed the `Too many args' diagnostic.
	  The maximum length of the argument list for a command is now limited
	  only by the maximum length that the invoker can pass and by any
	  system-imposed limit for execve(2) (see E2BIG in errno(2)).

	* Changed the `: no shell' diagnostic to `: No shell!'
	  in the spirit of sh6(1).

	* Changed the diagnostic used for `!', `-a', `-o', and `(' operator
	  errors from `: argument expected' to `: expression expected'.
2007-03-26 16:43:34 +00:00
obache
72be67100e Update osh to 060124.
Patch provided by Martin Wilke via PR 34313.

[osh-060124]:
Makefile:
	* Added targets for building/installing sh6(1) and glob6(1).
	  Refer to the README file for further details.

	* Removed the `check-sh6' target since the tests were originally
	  written for osh(1) and sh6(1) as Thompson-shell reimplementations,
	  not ports.

sh6:
	* Changed sh6(1) from being a reimplementation which is compiled from
	  the same sources as osh(1) to being a port of the original Thompson
	  shell from Sixth Edition Unix.  Refer to the CHANGES_sh-to-sh6 file
	  for further details.

osh:
	C: Treat both `( ; )' and `( & )' as syntax errors.

	C: Print the process ID for each command of an asynchronous pipeline,
	   not just the last command.

	C: Added the `newgrp' special command.  It is similar to `login'
	   except that the newgrp(1) utility replaces the current interactive
	   shell rather than the login(1) utility.

	* When opening `/dev/null' is needed for an asynchronous command,
	  call open(2) w/ the O_RDONLY flag instead of O_RDWR.
2006-10-17 12:31:22 +00:00
jlam
9c8b5ede43 Point MAINTAINER to pkgsrc-users@NetBSD.org in the case where no
developer is officially maintaining the package.

The rationale for changing this from "tech-pkg" to "pkgsrc-users" is
that it implies that any user can try to maintain the package (by
submitting patches to the mailing list).  Since the folks most likely
to care about the package are the folks that want to use it or are
already using it, this would leverage the energy of users who aren't
developers.
2006-03-04 21:28:51 +00:00
jlam
dc9594e09d Remove USE_PKGINSTALL from pkgsrc now that mk/install/pkginstall.mk
automatically detects whether we want the pkginstall machinery to be
used by the package Makefile.
2005-12-29 06:21:30 +00:00
jlam
5b62763c63 Teach the +SHELLS helper script to not create an /etc/shells file if
one doesn't exist.  From now on, we only add the listed PKG_SHELL to
the /etc/shells file if it already exists.  This fixes PR pkg/27162.
2005-09-20 04:23:48 +00:00
jlam
9813468816 * Separate out the shell registration into a separately unpacked script
+SHELL.

* Turn PKG_REGISTER_SHELLS into a variable that can be set in the shell
  environment so that admins can make a choice when installing from
  binary packages.

* PKG_SHELL is now a list of paths, and if the path is relative, then it
  is taken to be relative to ${PREFIX}.  Convert packages that set
  PKG_SHELL to take advantage of this new feature by changing the full
  paths to the shells into relative paths.
2005-07-29 18:32:17 +00:00
tv
f816d81489 Remove USE_BUILDLINK3 and NO_BUILDLINK; these are no longer used. 2005-04-11 21:44:48 +00:00
adam
208f6307d0 Changes 050219:
examples:
	* Updated the example initialization files.
	* Added a few command files to give users a head start
	  in scripting the shell.

osh.1 and sh6.1:
	* Made a few more minimal revisions.

osh and sh6:
	* Did a little more code cleanup.
2005-03-08 09:05:46 +00:00
agc
d81d19f8e0 Add RMD160 digests. 2005-02-24 12:51:41 +00:00
wiz
1c1f626158 Update to 041028, closing PR 27765.
Changes that improve compatibility w/ the Sixth Edition Unix shell
are marked w/ a `C:' in the details below.

-------------------------------------------------------------------------------
[osh-041028]:
*.1:
	* Fixed a few typos in osh.1 and sh6.1.

	* Did a little fine tuning of osh.1 and sh6.1 to hopefully
	  eliminate some incomplete and/or unclear explanations.

	* Did the same for both if.1 and goto.1.

osh and sh6:
	* Fixed an annoying bug introduced in the previous release...
	  The way error messages were printed in error() was not accounting
	  for the fact that the standard error stream is quite often (if not
	  always) unbuffered by default.  This could make some error messages
	  difficult to read when a pipeline was involved.  A little example:
	  Before (unfixed):
		% foo|bar|baz
		foo: not foundbar: not foundbaz: not found


	  After (fixed):
		% foo|bar|baz
		foo: not found
		bar: not found
		baz: not found

-------------------------------------------------------------------------------
[osh-041018]:
	This release includes sh6 in addition to osh, if, and goto.
	Sh6 is simply osh without the enhancements.  It is built from the
	same sources as osh, but it is not built or installed by default.

Makefile:
	* Added targets for sh6 so that it can optionally be built, tested,
	  and installed if desired.

osh and sh6:
	* Split the code into modules.
	  This is primarily for developer sanity... ;)
	  The new files are osh.h, main.c, parse.c, and exec.c.

	* If (geteuid() != getuid() || getegid() != getgid()) is true,
	  print a nice error message and exit with a status of 2.

	* Strip all NUL characters from the shell's standard input as it is
	  being read into the command line buffer.  Input to the shell is
	  expected to be text.

	* Changed the way the shell handles non-seekable files.
	  This is for both initialization files (osh only) and command files.
	  Do not block on open(2); open it and determine if it is a regular
	  file (or seekable).  If it is not a regular file or is not seekable,
	  exit with an error.  If seekable, reset the file for blocking I/O
	  and continue as normal.

	  Note that you can still read commands from FIFOs if you want.
	  Instead of doing `osh myfifo', you can either do `osh <myfifo'
	  or `osh - my list of positional parameters <myfifo'.

	* Changed the error handling to use stdarg(3).
	  This allows for more code consistency and makes it easier
	  to handle all errors with just one line of code.

osh only:
	* Added another possible initialization file for osh: $HOME/.oshrc
	  Osh only attempts to execute commands from this file if it is an
	  interactive shell.  In the case of a login shell, osh tries this
	  file only after it tries both /etc/osh.login and $HOME/.osh.login.

	* Made osh less strict about errors in initialization files.
	  Previously, common shell-detected errors in any of the files
	  were generally treated in the same way as they would have been
	  treated in a command file (i.e., the error was fatal).  Realizing
	  that this potentially caused difficulty and annoyance for the user,
	  I opted to change it so that these types of errors are handled as
	  they are when osh is interactive.

	  This should make it easier for the user to debug
	  initialization files if needed.

	* Added a `source' special command.
	  It is functionally similar to the way this command works in csh(1).
	  See osh(1) for details.

if:
	* Changed ARGMAX from 50 to 256.

	* If (geteuid() != getuid() || getegid() != getgid()) is true,
	  print a nice error message and exit with a status of 2.

	* Added a few new primaries: `-h', `-s', `-t', and `-x'
	  See if(1) for details.

goto:
	* Changed the size of the label buffer from 128 to 1024.

	* Do not require the `:' of a labelled line to appear in column 1.
	  Instead, allow the `:' to optionally be preceded by blanks so that
	  labelled lines can be indented in command files.  See goto(1) for
	  more details if needed.

	* Eliminated unnecessary calls to strcmp(3) whenever a possible label
	  cannot possibly match the label argument given on the command line.

	* Give an error if any NUL character is encountered in the input.

	* Give an error if a zero-length string is given as the label argument.

-------------------------------------------------------------------------------
[osh-040812]:
osh.c:
	* Changed the way unused pipe descriptors are handled in the child
	  process after fork().  This fixes a bug where the pipe in a pipeline
	  such as `( cat /dev/zero ) | sleep 1' would never enter an EOF state.
	  Previously, the close-on-exec flag was being set for the descriptors
	  in question.  Of course, this did not work for the above and similar
	  cases.  So, the descriptors in question are now close()d explicitly.

	* Made some final changes to globbing to allow for more sensible
	  behaviour WRT quoting.  The functions affected are: globargs(),
	  globchar(), and striparg().  Read and/or run `tests/glob_test.osh'
	  for details of the user-visible changes.  This script may cause
	  previous versions of the shell to dump core.

	  Basically, since striparg() had always been called *after* glob(3)
	  and since the path names generated by glob(3) cannot be trusted, it
	  ends up that the best course of action is to call striparg() *before*
	  glob(3).  This relatively simple change fixes a variety of *possible*
	  problems related to globbing.

-------------------------------------------------------------------------------
[osh-040731]:
osh.c:
	* Added bounds checking to striparg() to protect against a possible
	  buffer overflow.  Though this is unlikely to happen in the general
	  case, it is certainly *not* impossible.  This function had been
	  unprotected since at least osh-020214.

	* Added a new diagnostic, `Arg too long', to go with the
	  above-mentioned change.

	* Removed the `No directory' diagnostic from globargs().
	  It was simply not worth the trouble.  In compatible mode,
	  the `No match' diagnostic provides sufficient compatibility
	  in my opinion...

	* Changed the `chdir' command so that it only attempts to change to
	  the previous working directory when the `-' argument is *not* quoted.
	  This alows the shell to change to a directory by that name.
	  For example:
	  % mkdir -; chdir -; pwd; chdir \-; pwd; chdir -; pwd; rmdir -
	  chdir: no old directory
	  /home/jneitzel/osh_stuff/osh-040731
	  /home/jneitzel/osh_stuff/osh-040731/-
	  /home/jneitzel/osh_stuff/osh-040731

	  Remember that "-" or '-' has the same effect as the \- used above.
	  This is perhaps a little silly, but I figure if a directory *can*
	  exist then it should be possible to change to it.

	* Fixed the `<-' redirection argument so that it adheres to the
	  documentation.  This fixes a file descriptor leak in addition
	  to the incorrect behaviour.  It should be silently ignored in
	  the following case: `echo hello | grep h <-'; now it is.

-------------------------------------------------------------------------------
[osh-040723]:
osh.c:
	C: Fixed a small idiosyncrasy with the `No directory' and `No match'
	   diagnostics when running in compatible mode.  For example:
	   Before:
	   % if -d . -a -r . echo "`.' is a readable directory.";\
	     echo foo*; echo ?; echo []
	   `.' is a readable directory.
	   No match
	   No match
	   No directory

	   After:
	   % if -d . -a -r . echo "`.' is a readable directory.";\
	     echo foo*; echo ?; echo []
	   `.' is a readable directory.
	   No match
	   No match
	   No match

	   The shell should only print `No directory' when a directory
	   does not exist (ENOENT) or cannot be read (EACCES).  Yes, it is
	   expected that invalid patterns such as `[' and `[]' result in
	   the shell printing a `No match' diagnostic.

	* Changed the `<--' input redirection argument to `<-' instead.
	  This seems more consistent and will allow for possibly clearer
	  documentation in the future (if and when I add another feature
	  I've been thinking about).

fd2.[1c]:
	* Removed the fd2 utility and its manual page because of
	  possible licensing issues.

-------------------------------------------------------------------------------
[osh-040718]:
	This release is made primarily to synchronize with the new branch
	of the shell which is named `sh6'.

osh.1:
	* More revisions and clarifications...

-------------------------------------------------------------------------------
[osh-040714]:
Makefile:
	* Refined the description for _XOPEN_SOURCE a little.

osh.1:
	* General improvements...
	  This includes documenting some things that have never been very well
	  documented in this shell.

osh.c:
	C: Made changes to globbing which affect the shell in compatible mode.
	   This includes the addition of the `No directory' diagnostic which
	   was present in /etc/glob from Sixth Edition Unix.  Also, it looks
	   like I had previously misinterpreted exactly when the `No match'
	   diagnostic was supposed to be printed.  Now, when running in
	   compatible mode the shell really is compatible.  Yay =)

	* Added a `umask' special command.

	* Disallow SIGCHLD from being trapped.
	  When this signal is requested in a `trap' command, it is quietly
	  disallowed.  This is the same behaviour seen with both SIGKILL and
	  SIGSTOP.  Thus, doing a `trap + 9 17 20' quietly has no effect.

	* Made changes to how the shell builds a command's argument vector.
	  Previously, malloc(3) was used.  Now, each command in the command
	  line is simply split into `\0'-terminated words.  Each argument is
	  actually a pointer to the corresponding word in the command line.

	  The changes to parameter substitution in osh-040628 made this
	  a perfectly sensible course of action.  This change also gives
	  a microscopic improvement in run-time performance (as judged
	  by time(1)).

	  The only remaining use of malloc(3) in the shell's execution stage
	  can be found in globargs().

-------------------------------------------------------------------------------
[osh-040628]:
	Thanks to Stephen M. Jones for suggesting that osh should be able
	to read a global rc file.  Thanks to Stephen C. VanDahm for assisting
	with some portability issues found in osh-040421.  Thanks also to
	Josep Portella Florit for reviewing osh-040421, making several useful
	suggestions, and sending patches.

	BTW, many changes were made to the manual pages.
	I hope they are clear, but I trust that if they are not then someone
	might be kind enough to tell me so and/or make suggestions.

	Some new files are included:
		examples/*:	initialization file examples
		  fd2.[1c]:	the fd2 utility

Makefile:
	* Added some notes about _XOPEN_SOURCE.

	* Added a target to optionally build and install fd2.

	* Removed the compile-time definition of `CLONE'.
	  This is now a run-time option which can be toggled in order to
	  enable or disable enhancements to the shell.

osh.c:
	C: Changed how the shell does parameter substitution.
	   This was the last major incompatibility w/ the Thompson shell.
	   Now, substitution is done *before* any command-line parsing
	   takes place.

	* Added the ability for login shells to read the initialization files
	  /etc/osh.login and/or $HOME/.osh.login if they exist.  A shell is
	  considered to be a login shell if its first argument starts w/ a
	  `-' character (e.g., -osh).

	* Added a `set' command to allow shell compatibility to be toggled
	  at run time.  In addition, the shell now checks for `OSH_COMPAT'
	  in the environment to tell future invocations of the shell which
	  mode the user wishes to run in.

	* In addition to the `set' command mentioned above, the following
	  special built-in commands have been added and are available when
	  the shell is in "noclone" mode:
		exec, setenv, trap, unsetenv

	* In globargs(), use `gl_pathc == 0' to detect an unmatched pattern
	  instead of checking if glob(3) returned `GLOB_NOMATCH'.  This allows
	  for those cases where glob(3) may not be POSIX-compliant.

	* Made osh command files that are run asynchronously ignore interrupts.
	  For example, `osh runcom&' should ignore SIGINT and SIGQUIT, and now
	  it does.

	* Reverted a so-called compatibility fix made in osh-040421.
	  Now, ignore SIGINT and SIGQUIT for asynchronous commands invoked
	  from a command file.  From a usability perspective, it is simply
	  too annoying to not do it this way.

	* Changed the `exit' command so that it always terminates a shell when
	  reading commands from a file.  Previously, it only terminated a shell
	  when invoked as `osh file'.  Note that `exit' still has no effect for
	  interactive shells or `osh -c command'; this is intentional as it is
	  compatible w/ the behaviour of `exit' under the Thompson shell.

if.c:
	* Include stdlib.h for exit(3) so that OS X doesn't complain.

	* Rename exp() to expr() to avoid conflicts w/ exp(3) on OS X.
	  Strange, as math.h is not included there should not have been
	  any conflict.  Oh well, it is fixed now.

	* Enable this utility to return a meaningful exit status to the user.
	  In short, `if foo = foo' returns an exit status of 0; `if foo = bar'
	  returns an exit status of 1.  Previously, exit status was always 0.

	* Made the usage less ambiguous; corrected the documentation to reflect
	  the actual behaviour.  In short, usage is (and always has been) as
	  follows:
		if expr [command [arg ...]]

	* Added some useful conditional primaries for constructing expressions.
	  See the manual pages for details.

	* Use the stdio(3) functions instead of write(2) for printing
	  the error messages.

	* In addition, added some useful diagnostic messages which were
	  inspired by the test(1) utility from Seventh Edition Unix.

goto.c:
	* Give an error message when standard input is not seekable.
	  Previously, a label not found error would be produced instead.

fd2.c:
	* A new utility and manual page...  It is an adaptation of the PWB/Unix
	  (roughly PWB/1.0 ?) redirect diagnostic output command.  The original
	  source came from the file `spencer_pwb.tar.gz' which can be found at:

		http://www.tuhs.org/Archive/PDP-11/Distributions/usdl/
2004-12-27 21:13:01 +00:00
cjep
4cf2fa0735 lint 2004-06-11 10:01:35 +00:00
minskim
f5fa431514 Update osh to 040216 and enable pkgviews installation.
This closes PR pkg/25314.

Changes:
	* Made various changes to hopefully improve the clarity.
	  Added COMPATIBILITY, HISTORY, and NOTES sections.
	* Made changes to how the shell handles terminating `\' characters
	  w/ the `-c' and `-t' flags.  This is a simple extension of the
	  same behaviour exhibited when the shell is interactive or when it
	  executes a command file, the only difference being that where a
	  terminating `\' character causes the shell to read the next line
	  of input in an interactive shell or command file, w/ the `-c' and
	  `-t' flags the shell terminates w/o executing the command line.
	* Allow parameter substitution w/ the `-c' and `-t' flags.  This
	  feature is not documented.  For example, invoking the shell as
	  follows allows parameter substitution to take place:
	  % osh -t one two three
	  echo $0 $1 $2 $3
	  -t one two three
	* The shell now ignores SIGINT and SIGQUIT when the `-c' or `-t' flag
	  is used.  Thus, asynchronous commands invoked in this way ignore
	  interrupts as they should.
	* Ignore SIGINT and SIGQUIT for all commands started from asynchronous
	  subshells.  For example, `( sleep 300; some_command ) >outfile&' now
	  ignores `^C' and `^\' as it should.
	* Don't ignore SIGINT and SIGQUIT for asynchronous commands started
	  in command files.  If a command file is terminated by one of these
	  signals, the asynchronous commands should also terminate.
	* Reverted a change made to termination reporting in osh-040216 that
	  was not actually compatible w/ the V6 shell.
	* Always terminate the shell when read(2) fails.
	  This fixes a possible infinite loop.
	* Fixed a bug in the parser that caused syntactically incorrect
	  subshell commands not to be detected as such when preceded by
	  redirection arguments (e.g., `<infile >outfile ( | )').
	  This bug was introduced in osh-040216.
	* Fixed possible buffer overflows in substparm(); added a new error
	  message, "Too many characters", and made other changes necessary to
	  properly deal w/ the new error condition.  This problem had been
	  present since at least osh-020214.
	* Made some changes to how globbing is handled by the shell.
	  Specifically, glob(3) should only be called when an argument contains
	  unquoted occurrences of any of the glob characters `*', `?', or `['.
	  Previously, it was being called for every argument of an external
	  command.  This change improves run-time performance slightly as
	  judged by time(1) and information returned by getrusage(2).
	* The above-mentioned change also allows the following compatibility
	  feature.  Added globbing compatibility when the shell is compiled
	  w/ -DCLONE so that when no matches are found a diagnostic,
	  "No match", is printed.
2004-04-25 15:49:57 +00:00
xtraeme
445013e6e3 Upgrade shells/osh to 040216, this closes PR pkg/24501.
Too many changes to copy here, previous package was 2 years old, please
review the Changelog file.
2004-02-23 01:58:41 +00:00
jmmv
cc2b1c9657 Use the right install program for correctness and to fix problems under SunOS.
From PR pkg/22898 by Jonathan Perkin.
2003-09-22 20:57:12 +00:00
grant
ca3be631f2 s/netbsd.org/NetBSD.org/ 2003-07-17 22:50:55 +00:00
jschauma
e366d0c694 Use tech-pkg@ in favor of packages@ as MAINTAINER for orphaned packages.
Should anybody feel like they could be the maintainer for any of thewe packages,
please adjust.
2003-06-02 01:15:31 +00:00
jlam
d7f69e47ce Instead of including bsd.pkg.install.mk directly in a package Makefile,
have it be automatically included by bsd.pkg.mk if USE_PKGINSTALL is set
to "YES".  This enforces the requirement that bsd.pkg.install.mk be
included at the end of a package Makefile.  Idea suggested by Julio M.
Merino Vidal <jmmv at menta.net>.
2003-01-28 22:03:00 +00:00
salo
80f17bf2ba Convert packages to PKG_REGISTER_SHELLS framework. 2002-11-17 09:01:59 +00:00
cjep
5f9fb649b7 Initial import of osh-020214 into the NetBSD packages collection
as shells/osh.

Osh is a re-implementation of the old and obsolete shell version,
which was in standard use up to UNIX 6th Edition and was supplied
as osh with UNIX 7th Edition.  Its command language is a sparse
subset of those of modern shells and is mostly common both to sh(1)
and csh(1).

This pkgsrc entry is based on the FreeBSD ports entry for osh.
2002-08-20 20:52:29 +00:00