# This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # openksh/ # openksh/files # openksh/files/patch-main.c # openksh/files/patch-Makefile # openksh/files/patch-lex.c # openksh/files/patch-sh.h # openksh/Makefile # openksh/distinfo # openksh/pkg-descr # openksh/pkg-plist # echo c - openksh/ mkdir -p openksh/ > /dev/null 2>&1 echo c - openksh/files mkdir -p openksh/files > /dev/null 2>&1 echo x - openksh/files/patch-main.c sed 's/^X//' >openksh/files/patch-main.c << 'END-of-openksh/files/patch-main.c' X--- main.c.orig Mon Feb 21 11:01:58 2005 X+++ main.c Sat Aug 27 15:28:51 2005 X@@ -8,7 +8,6 @@ X X #include "sh.h" X #include X-#include X X extern char **environ; X X@@ -19,7 +18,6 @@ X static void reclaim(void); X static void remove_temps(struct temp *tp); X static int is_restricted(char *name); X-static void init_username(void); X X /* X * shell initialization X@@ -63,7 +61,6 @@ X NULL X }; X X-char username[_PW_NAME_LEN + 1]; X X #define version_param (initcoms[2]) X X@@ -239,7 +236,6 @@ X X X ksheuid = geteuid(); X- init_username(); X safe_prompt = ksheuid ? "$ " : "# "; X { X struct tbl *vp = global("PS1"); X@@ -377,20 +373,6 @@ X X shell(s, true); /* doesn't return */ X return 0; X-} X- X-static void X-init_username(void) X-{ X- char *p; X- struct tbl *vp = global("USER"); X- X- if (vp->flag & ISSET) X- p = ksheuid == 0 ? "root" : str_val(vp); X- else X- p = getlogin(); X- X- strlcpy(username, p != NULL ? p : "?", sizeof username); X } X X int END-of-openksh/files/patch-main.c echo x - openksh/files/patch-Makefile sed 's/^X//' >openksh/files/patch-Makefile << 'END-of-openksh/files/patch-Makefile' X--- Makefile.orig Fri Dec 31 11:24:09 2004 X+++ Makefile Sat Aug 27 16:44:08 2005 X@@ -6,14 +6,16 @@ X main.c misc.c path.c shf.c syn.c table.c trap.c \ X tree.c tty.c var.c version.c vi.c X X-DEFS= -Wall X+DEFS= -DHAVE_CONFIG_H -Wall X CFLAGS+=${DEFS} -I. -I${.CURDIR} X-MAN= ksh.1 sh.1 X+MAN= ksh.1 X X CLEANFILES+= emacs.out X X+DESTDIR=%%PREFIX%% X+BINDIR=/bin X+MANDIR=/man X LINKS= ${BINDIR}/ksh ${BINDIR}/rksh X-LINKS+= ${BINDIR}/ksh ${BINDIR}/sh X MLINKS= ksh.1 rksh.1 ksh.1 ulimit.1 X X .depend emacs.o: emacs.out END-of-openksh/files/patch-Makefile echo x - openksh/files/patch-lex.c sed 's/^X//' >openksh/files/patch-lex.c << 'END-of-openksh/files/patch-lex.c' X--- lex.c.orig Mon Feb 21 11:01:58 2005 X+++ lex.c Sat Aug 27 16:08:21 2005 X@@ -1278,7 +1278,11 @@ X strftime(strbuf, sizeof strbuf, "%R", tm); X break; X case 'u': /* '\' 'u' username */ X- strlcpy(strbuf, username, sizeof strbuf); X+ p = getlogin(); X+ if (p) X+ strlcpy(strbuf, p, sizeof strbuf); X+ else X+ strbuf[0] = '\0'; X break; X case 'v': /* '\' 'v' version (short) */ X p = strchr(ksh_version, ' '); END-of-openksh/files/patch-lex.c echo x - openksh/files/patch-sh.h sed 's/^X//' >openksh/files/patch-sh.h << 'END-of-openksh/files/patch-sh.h' X--- sh.h.orig Mon Feb 21 11:01:58 2005 X+++ sh.h Sat Aug 27 16:10:49 2005 X@@ -77,7 +77,6 @@ X EXTERN int exstat; /* exit status */ X EXTERN int subst_exstat; /* exit status of last $(..)/`..` */ X EXTERN const char *safe_prompt; /* safe prompt if PS1 substitution fails */ X-EXTERN char username[]; /* username for \u prompt expansion */ X X /* X * Area-based allocation built on malloc/free END-of-openksh/files/patch-sh.h echo x - openksh/Makefile sed 's/^X//' >openksh/Makefile << 'END-of-openksh/Makefile' X# New ports collection makefile for: openksh X# Date created: 2005-08-27 X# Whom: Tom McLaughlin X# X# $FreeBSD$ X# X XPORTNAME= openksh XPORTVERSION= 3.8 XCATEGORIES= shells XMASTER_SITES= http://people.freebsd.org/~tmclaugh/files/openksh/ X XMAINTAINER= tmclaugh@FreeBSD.org XCOMMENT= The OpenBSD pdksh X XCONFLICTS= pdksh-[0-9]* XUSE_REINPLACE= yes X XMAN1= ksh.1 XMLINKS= ksh.1 rksh.1 ksh.1 ulimit.1 X Xpost-patch: X @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' \ X ${WRKSRC}/Makefile X Xdo-install: X @${INSTALL_PROGRAM} ${WRKSRC}/ksh ${PREFIX}/bin X @${LN} -s ${PREFIX}/bin/ksh ${PREFIX}/bin/rksh X @${INSTALL_MAN} ${WRKSRC}/ksh.1 ${PREFIX}/man/man1/ X Xpost-install: X @${ECHO} "Updating /etc/shells" X @${CP} /etc/shells /etc/shells.bak X @(${GREP} -v ${PREFIX}/bin/ksh /etc/shells.bak; \ X ${ECHO_CMD} ${PREFIX}/bin/ksh) > /etc/shells X @${RM} /etc/shells.bak X X.include END-of-openksh/Makefile echo x - openksh/distinfo sed 's/^X//' >openksh/distinfo << 'END-of-openksh/distinfo' XMD5 (openksh-3.8.tar.gz) = a1d09a5c56d81d58e525e44c9e96dc78 XSHA256 (openksh-3.8.tar.gz) = c2363452b95a70bedb3dac07d80eebbeab817a69c8f03b830840d5a91b4dba81 XSIZE (openksh-3.8.tar.gz) = 459327 END-of-openksh/distinfo echo x - openksh/pkg-descr sed 's/^X//' >openksh/pkg-descr << 'END-of-openksh/pkg-descr' XOpenKSH is the OpenBSD Korn shell. It is based on the Public Domain XKorn Shell (pdksh) which is in turn a work-a-like of the AT&T Korn shell. XOpenKSH's main advantage over the standard pdksh is it is still actively Xmaintained today. X XOpenKSH is in no way affiliated or endorsed by the OpenBSD project. XIts existance started simply because I wanted an actively maintained XKorn shell. END-of-openksh/pkg-descr echo x - openksh/pkg-plist sed 's/^X//' >openksh/pkg-plist << 'END-of-openksh/pkg-plist' Xbin/ksh Xbin/rksh X@exec echo "updating /etc/shells"; cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak; echo %D/%F) >/etc/shells X@unexec echo "updating /etc/shells"; cp /etc/shells /etc/shells.bak; (grep -v %D/%F /etc/shells.bak) >/etc/shells END-of-openksh/pkg-plist exit