diff options
author | Tavis Ormandy <taviso@gentoo.org> | 2003-07-31 12:28:33 +0000 |
---|---|---|
committer | Tavis Ormandy <taviso@gentoo.org> | 2003-07-31 12:28:33 +0000 |
commit | 480cc10c97ab1989ee723271f8d5eb77299386ad (patch) | |
tree | 311bd1c4247f79f00dd2552f831c642775564baf /app-shells | |
parent | fixing #24290 (diff) | |
download | historical-480cc10c97ab1989ee723271f8d5eb77299386ad.tar.gz historical-480cc10c97ab1989ee723271f8d5eb77299386ad.tar.bz2 historical-480cc10c97ab1989ee723271f8d5eb77299386ad.zip |
fixing #24290
Diffstat (limited to 'app-shells')
-rw-r--r-- | app-shells/csh/Manifest | 6 | ||||
-rw-r--r-- | app-shells/csh/csh-1.29-r2.ebuild | 144 | ||||
-rw-r--r-- | app-shells/csh/files/digest-csh-1.29-r2 | 1 | ||||
-rw-r--r-- | app-shells/csh/files/retype-input.diff | 89 |
4 files changed, 237 insertions, 3 deletions
diff --git a/app-shells/csh/Manifest b/app-shells/csh/Manifest index e5b348a679cf..7a87786d9d65 100644 --- a/app-shells/csh/Manifest +++ b/app-shells/csh/Manifest @@ -1,13 +1,13 @@ MD5 24974796f8712ee41f927e1e76ff5a70 csh-1.29.ebuild 3803 MD5 c9ed16e56100fb9511e19c7e00371705 csh-1.29-r1.ebuild 4060 -MD5 9eabc30e360e4e8f2064d28852356847 csh-1.29-r2.ebuild 4192 -MD5 a9ee608b1afc7dce5aef89399d9e5d1a ChangeLog 1622 +MD5 7f502c9056d0630197e165a4abb049e2 csh-1.29-r2.ebuild 4272 +MD5 fbaf3ed0733d749cda46c2515c7985f0 ChangeLog 1898 MD5 ce0694a6af9197d929533e9d0dfcb706 metadata.xml 706 MD5 49c0a95e6881eb7e2932d149f62f0de2 files/mksignames.c 10722 MD5 49ee962115384f8a0acedfcf225fd27a files/digest-csh-1.29 148 MD5 213922a7d6fdee0a89e9a349653be22d files/linux-vs-bsd.diff 7483 MD5 70a304fe872eabbec7c515095af358fc files/digest-csh-1.29-r1 162 MD5 8eb726131df145785642164034fb5a74 files/digest-csh-1.29-r2 60 -MD5 9ee321631c92bc4cb36b9025e55c127c files/retype-input.diff 2510 +MD5 9a4c41baf0e48fb12e83a51b0b15f297 files/retype-input.diff 2352 MD5 56092454f21f9d462f4514aadf4c78cd files/dot.cshrc 1549 MD5 2365e5e2ca11496be2169a6944a38994 files/dot.login 224 diff --git a/app-shells/csh/csh-1.29-r2.ebuild b/app-shells/csh/csh-1.29-r2.ebuild new file mode 100644 index 000000000000..ff436f00c63b --- /dev/null +++ b/app-shells/csh/csh-1.29-r2.ebuild @@ -0,0 +1,144 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-shells/csh/csh-1.29-r2.ebuild,v 1.1 2003/07/31 12:28:24 taviso Exp $ + +inherit flag-o-matic eutils ccc + +DESCRIPTION="Classic UNIX shell with C like syntax" +HOMEPAGE="http://www.netbsd.org/" +SRC_URI="http://cvs.gentoo.org/~taviso/${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~x86 ~alpha" +IUSE="static doc" + +DEPEND="virtual/glibc + sys-devel/pmake + >=sys-apps/sed-4 + doc? ( sys-apps/groff )" +RDEPEND="virtual/glibc" + +S=${WORKDIR}/src/bin/csh + +src_compile() { + # hide some BSDisms, mostly my work, got some hints from the + # debian project (they use an older OpenBSD csh, though). + cd ${S}; epatch ${FILESDIR}/linux-vs-bsd.diff || die "patching failed." + + # print the exisiting input after displaying completion options. + # patch contributed by splite <splite-gentoo@sigint.cs.purdue.edu> + # #24290 + epatch ${FILESDIR}/retype-input.diff || die "patching failed." + + # copy some required files over, from NetBSD + + cd ${S}; cp ${WORKDIR}/printf.c \ + ${WORKDIR}/vis.h \ + ${WORKDIR}/vis.c \ + ${FILESDIR}/dot.login \ + ${FILESDIR}/dot.cshrc \ + ${S} + + # this parses the output of the bash builtin `kill` + # and creates an array of signal names for csh. + + einfo "Making a list of signal names..." + + local cnt=0 + + printf "/* automatically generated during %s build */\n\n" ${PF} > ${S}/signames.h + printf "const char *const sys_signame[NSIG + 3] = {\n" >> ${S}/signames.h + printf "\t\"EXIT\",\t\n" >> ${S}/signames.h + + let cnt++ + + for i in `kill -l` + do + let $((cnt++))%2 && continue + einfo " Adding ${i}..." + printf "\t\"%s\",\n" ${i} >> ${S}/signames.h + done + + printf "\t\"DEBUG\",\n\t\"ERR\",\n\t(char *)0x0\n};\n\n" >> ${S}/signames.h + + einfo "Adding flags required for succesful compilation..." + # this should be easier than maintaining a patch. + for i in {-Dlint,-w,-D__dead="",-D__LIBC12_SOURCE__,-DNODEV="-1",-DTTYHOG=1024,-DMAXPATHLEN=4096,-D_GNU_SOURCE,-D_DIAGASSERT="assert"} + do + append-flags ${i} + done + + einfo "Making some final tweaks..." + sed -i 's#sys/tty.h#linux/tty.h#g' ${S}/file.c + sed -i 's!\(#include "proc.h"\)!\1\n#include "signames.h"\n!g' ${S}/proc.c + sed -i 's#\(strpct.c time.c\)#\1 vis.c#g' ${S}/Makefile + sed -i 's!#include "namespace.h"!!g' ${S}/vis.c + sed -i 's#/usr/games/fortune#/usr/bin/fortune#g' ${S}/dot.login + + # maybe they dont warn on BSD, but _damn_. + export NOGCCERROR=1 + + # if csh is a users preferred shell, they may want + # a static binary to help on the event of fs emergency. + use static && append-ldflags -static + + # pmake is a portage binary as well, so specify full path. + # if yours isnt in /usr/bin, you can set PMAKE_PATH. + einfo "Starting build..." + ${PMAKE_PATH:-/usr/bin/}pmake || die "compile failed." + + echo + size csh + echo + + # make the c shell guide + use doc && { + einfo "Making documentation..." + cd ${S}/USD.doc + ${PMAKE_PATH:-/usr/bin/}pmake + } + cd ${S} + + einfo "Making empty configuration files.." + printf "#\n# System-wide .cshrc file for csh(1).\n\n" > csh.cshrc + printf "#\n# System-wide .login file for csh(1).\n\n" > csh.login + printf "if ( -f /etc/csh.env ) source /etc/csh.env\n" >> csh.login + printf "#\n# System-wide .logout file for csh(1).\n\n" > csh.logout +} + +src_install() { + exeinto /bin + doexe csh + + doman csh.1 + + use doc && dodoc USD.doc/paper.ps + dodoc dot.cshrc dot.login + + insinto /etc + doins csh.cshrc csh.login csh.logout +} + +pkg_postinst() { + echo + use doc >/dev/null && { + einfo "An Introduction to the C shell by William Joy, a " + einfo "postscript document included with this shell has" + einfo "been installed in /usr/share/doc/${PF}, if you are new" + einfo "to the C shell, you may find it interesting." + } || { + einfo "You didnt have the \`doc\` use flag set, the" + einfo "postscript document \"An Introduction to the C" + einfo "shell by William Joy\" was not installed." + } + echo + einfo "Example login scripts have been installed in /usr/share/doc/${PF}." + einfo "You can install a simple dot.cshrc like this:" + einfo + einfo " % zcat /usr/share/doc/${PF}/dot.cshrc > ~/.cshrc" + einfo " % zcat /usr/share/doc/${PF}/dot.login > ~/.login" + einfo + einfo "And then edit to your liking." + echo +} diff --git a/app-shells/csh/files/digest-csh-1.29-r2 b/app-shells/csh/files/digest-csh-1.29-r2 new file mode 100644 index 000000000000..ebc0d877f98b --- /dev/null +++ b/app-shells/csh/files/digest-csh-1.29-r2 @@ -0,0 +1 @@ +MD5 9637b9572e66e992305dfed9909098e2 csh-1.29.tar.gz 179592 diff --git a/app-shells/csh/files/retype-input.diff b/app-shells/csh/files/retype-input.diff new file mode 100644 index 000000000000..f063170eb10e --- /dev/null +++ b/app-shells/csh/files/retype-input.diff @@ -0,0 +1,89 @@ +--- file.c.orig 2003-06-12 20:41:07.000000000 +0100 ++++ file.c 2003-07-31 12:07:34.000000000 +0100 +@@ -92,7 +92,7 @@ + + static void setup_tty(int); + static void back_to_col_1(void); +-static int pushback(Char *); ++static int pushback(Char *, int); + static void catn(Char *, Char *, int); + static void copyn(Char *, Char *, int); + static Char filetype(Char *, Char *); +@@ -167,7 +167,7 @@ + * Push string contents back into tty queue + */ + static int +-pushback(Char *string) ++pushback(Char *string, int doecho) + { + struct termios tty, tty_normal; + char buf[TTYHOG], svchars[TTYHOG]; +@@ -181,13 +181,14 @@ + (void)sigaddset(&sigset, SIGINT); + (void)sigprocmask(SIG_BLOCK, &sigset, &osigset); + (void)tcgetattr(SHOUT, &tty); +- tty_normal = tty; +- tty.c_lflag &= ~(ECHOKE | ECHO | ECHOE | ECHOK | ECHONL | ECHOPRT | ECHOCTL); +- /* FIONREAD works only in noncanonical mode. */ +- tty.c_lflag &= ~ICANON; +- tty.c_cc[VMIN] = 0; +- (void)tcsetattr(SHOUT, TCSADRAIN, &tty); +- ++ if (!doecho) { ++ tty_normal = tty; ++ tty.c_lflag &= ~(ECHOKE | ECHO | ECHOE | ECHOK | ECHONL | ECHOPRT | ECHOCTL); ++ /* FIONREAD works only in noncanonical mode. */ ++ tty.c_lflag &= ~ICANON; ++ tty.c_cc[VMIN] = 0; ++ (void)tcsetattr(SHOUT, TCSADRAIN, &tty); ++ } + for (retrycnt = 5; ; retrycnt--) { + /* + * Push back characters. +@@ -243,7 +244,8 @@ + (void)tcsetattr(SHOUT, TCSADRAIN, &tty); + (void)ioctl(SHOUT, FIONREAD, (ioctl_t) &i); + #endif +- (void)tcsetattr(SHOUT, TCSADRAIN, &tty_normal); ++ if (!doecho) ++ (void)tcsetattr(SHOUT, TCSADRAIN, &tty_normal); + (void)sigprocmask(SIG_SETMASK, &osigset, NULL); + + return nsv; +@@ -380,6 +382,7 @@ + /* + * Cause pending line to be printed + */ ++#if 0 + static void + retype(void) + { +@@ -389,6 +392,7 @@ + tty.c_lflag |= PENDIN; + (void)tcsetattr(SHOUT, TCSADRAIN, &tty); + } ++#endif + + static void + beep(void) +@@ -710,15 +714,20 @@ + } + if (command == LIST) /* Always retype after a LIST */ + should_retype = TRUE; ++#if 0 + if (pushback(inputline)) + should_retype = TRUE; ++#endif + if (should_retype) { + if (command == RECOGNIZE) + (void) fputc('\n', cshout); + printprompt(); + } ++#if 0 + if (should_retype) + retype(); ++#endif ++ pushback(inputline, should_retype); + } + setup_tty(OFF); + return (num_read); |