summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Yamin <plasmaroo@gentoo.org>2003-10-17 23:40:43 +0000
committerTim Yamin <plasmaroo@gentoo.org>2003-10-17 23:40:43 +0000
commit85f3a063f50b6b6f763d6da188beb765ce760140 (patch)
tree340f721c6ed20e0602a630c544723193ecfa70c5 /app-shells
parentAdded sash-3.6 to the tree. Bug 26272. (diff)
downloadgentoo-2-85f3a063f50b6b6f763d6da188beb765ce760140.tar.gz
gentoo-2-85f3a063f50b6b6f763d6da188beb765ce760140.tar.bz2
gentoo-2-85f3a063f50b6b6f763d6da188beb765ce760140.zip
Added sash-3.6 to the tree. Bug 26272.
Diffstat (limited to 'app-shells')
-rw-r--r--app-shells/sash/ChangeLog9
-rw-r--r--app-shells/sash/Manifest4
-rw-r--r--app-shells/sash/files/digest-sash-3.61
-rw-r--r--app-shells/sash/files/sash-3.6-fix-includes.patch39
-rw-r--r--app-shells/sash/files/sash-3.6-readline.patch291
-rw-r--r--app-shells/sash/sash-3.6.ebuild47
6 files changed, 388 insertions, 3 deletions
diff --git a/app-shells/sash/ChangeLog b/app-shells/sash/ChangeLog
index 336d8604d5a7..295e950fcbd8 100644
--- a/app-shells/sash/ChangeLog
+++ b/app-shells/sash/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-shells/sash
# Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-shells/sash/ChangeLog,v 1.11 2003/02/22 00:42:19 zwelch Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-shells/sash/ChangeLog,v 1.12 2003/10/17 23:40:32 plasmaroo Exp $
+
+*sash-3.6 (18 Oct 2003)
+
+ 18 Oct 2003; <plasmaroo@gentoo.org> sash-3.6.ebuild,
+ files/sash-3.6-fix-includes.patch, files/sash-3.6-readline.patch:
+ Added user-contributed sash-3.6 to the tree. Thanks to Peter Gnodde
+ <peter@gnodde.org> for the ebuild. Bug #26272.
21 Feb 2003; Zach Welch <zwelch@gentoo.org> sash-3.4-r5.ebuild :
Added arm to keywords
diff --git a/app-shells/sash/Manifest b/app-shells/sash/Manifest
index 7fa9ef82f26f..853fa297eb7a 100644
--- a/app-shells/sash/Manifest
+++ b/app-shells/sash/Manifest
@@ -1,7 +1,7 @@
-MD5 d21c8536e559f2673ff2cd6f20b269a3 ChangeLog 1574
+MD5 02ce6c469e3d4726969659eaf4166897 ChangeLog 1577
MD5 c835d6bcda25294f07b47c3a5445981f sash-3.4-r3.ebuild 1260
MD5 bee2de1101df8fc490298192d6db9431 sash-3.4-r5.ebuild 1179
-MD5 fed27b60bd1eb7aa0246d95d034f2472 sash-3.6.ebuild 901
+MD5 99e578528a77a09b72923a2123fcf15b sash-3.6.ebuild 998
MD5 d8ba27b27955dbcb4e7fe489c4b1c959 sash-3.4-r4.ebuild 1157
MD5 6fe20649cd07eb0aa8884df7a1749e47 files/digest-sash-3.4-r3 127
MD5 c0a4b54f51097cb6d1e76b0f0df2d938 files/digest-sash-3.6 59
diff --git a/app-shells/sash/files/digest-sash-3.6 b/app-shells/sash/files/digest-sash-3.6
new file mode 100644
index 000000000000..c9843356511c
--- /dev/null
+++ b/app-shells/sash/files/digest-sash-3.6
@@ -0,0 +1 @@
+MD5 56dd73d91374e1f0c59b9860b2855119 sash-3.6.tar.gz 50270
diff --git a/app-shells/sash/files/sash-3.6-fix-includes.patch b/app-shells/sash/files/sash-3.6-fix-includes.patch
new file mode 100644
index 000000000000..1537ffb1b1fd
--- /dev/null
+++ b/app-shells/sash/files/sash-3.6-fix-includes.patch
@@ -0,0 +1,39 @@
+diff -ruN sash-3.6.orig/Makefile sash-3.6/Makefile
+--- sash-3.6.orig/Makefile 2002-07-22 01:24:47.000000000 +0200
++++ sash-3.6/Makefile 2003-10-17 14:25:00.306848712 +0200
+@@ -21,7 +21,7 @@
+ -DHAVE_BSD_MOUNT=$(HAVE_BSD_MOUNT) \
+ -DMOUNT_TYPE=$(MOUNT_TYPE)
+
+-LDFLAGS = -static -s
++LDFLAGS = -all-static -s
+ LIBS = -lz
+
+
+diff -ruN sash-3.6.orig/cmd_chattr.c sash-3.6/cmd_chattr.c
+--- sash-3.6.orig/cmd_chattr.c 2002-03-08 08:21:03.000000000 +0100
++++ sash-3.6/cmd_chattr.c 2003-10-17 14:24:47.559786560 +0200
+@@ -12,7 +12,7 @@
+
+ #include <sys/ioctl.h>
+ #include <sys/types.h>
+-#include <linux/ext2_fs.h>
++#include <ext2fs/ext2_fs.h>
+
+ #include "sash.h"
+
+diff -ruN sash-3.6.orig/cmds.c sash-3.6/cmds.c
+--- sash-3.6.orig/cmds.c 2002-07-22 00:28:19.000000000 +0200
++++ sash-3.6/cmds.c 2003-10-17 14:24:31.013302008 +0200
+@@ -17,11 +17,6 @@
+ #include <utime.h>
+ #include <errno.h>
+
+-#if HAVE_LINUX_MOUNT
+-#include <linux/fs.h>
+-#endif
+-
+-
+ void
+ do_echo(int argc, const char ** argv)
+ {
diff --git a/app-shells/sash/files/sash-3.6-readline.patch b/app-shells/sash/files/sash-3.6-readline.patch
new file mode 100644
index 000000000000..a2830b875408
--- /dev/null
+++ b/app-shells/sash/files/sash-3.6-readline.patch
@@ -0,0 +1,291 @@
+diff -ruN sash-3.6/Makefile sash-3.6.readline/Makefile
+--- sash-3.6/Makefile 2003-10-17 14:25:00.306848712 +0200
++++ sash-3.6.readline/Makefile 2003-10-17 14:27:34.529403320 +0200
+@@ -19,10 +19,11 @@
+ -DHAVE_LINUX_ATTR=$(HAVE_LINUX_ATTR) \
+ -DHAVE_LINUX_MOUNT=$(HAVE_LINUX_MOUNT) \
+ -DHAVE_BSD_MOUNT=$(HAVE_BSD_MOUNT) \
+- -DMOUNT_TYPE=$(MOUNT_TYPE)
++ -DMOUNT_TYPE=$(MOUNT_TYPE) \
++ -DHAVE_READLINE
+
+ LDFLAGS = -all-static -s
+-LIBS = -lz
++LIBS = -lz -lreadline -lncurses
+
+
+ BINDIR = /bin
+diff -ruN sash-3.6/sash.c sash-3.6.readline/sash.c
+--- sash-3.6/sash.c 2002-07-22 00:55:28.000000000 +0200
++++ sash-3.6.readline/sash.c 2003-10-17 14:26:26.184793280 +0200
+@@ -384,6 +384,201 @@
+ static void usage(void);
+ static Alias * findAlias(const char * name);
+
++#ifdef HAVE_READLINE
++/*--- Interface of readline 4.0 by vlk@vinf.ru ---*/
++
++#include <readline/readline.h>
++#include <readline/history.h>
++#include <dirent.h>
++
++char * dupstr (char *s);
++void initialize_readline (void);
++char ** fileman_completion (char *text, int start, int end);
++char *command_generator (char *text, int state);
++void err_alloc(int ErrorNumber);
++extern char *xmalloc ();
++
++static char ** listBase;
++static long listSize;
++
++void
++err_alloc(int ErrorNumber)
++{
++ fprintf(stderr, "Memory space failed: %d\n",ErrorNumber);
++ return;
++}
++
++/* Add a one item to exec-command array */
++static int
++listAdd(const char * new_item)
++{
++ if ((listBase = realloc(listBase, sizeof(char *) * ( listSize + 1 ))) == 0 )
++ {
++ err_alloc(3); exit(1);
++ }
++ listBase[listSize] = strdup(new_item);
++ listSize++;
++ return(0);
++}
++
++static int
++genExecList(void)
++{
++ char * dirName;
++ char * path;
++ char * endPath;
++ char * fullName;
++ struct dirent **namelist;
++ int n;
++
++ if (getenv("PATH") == 0)
++ return(1);
++ else
++ {
++ if ((path = strdup(getenv("PATH"))) == 0)
++ {
++ err_alloc(4);
++ return(1);
++ }
++ }
++ /*
++ * Check out each path to see if the program exists and is
++ * executable in that path.
++ */
++ for ( ; path; path = endPath)
++ {
++ /*
++ * Find the end of the next path and NULL terminate
++ * it if necessary.
++ */
++ endPath = strchr(path, ':');
++
++ if (endPath)
++ *endPath++ = '\0';
++
++ /*
++ * Get the directory name, defaulting it to DOT if
++ * it is null.
++ */
++ dirName = path;
++
++ /*
++ * See if the program exists and is executable.
++ */
++ if (access(dirName, F_OK) < 0)
++ {
++ if (errno != ENOENT)
++ printf("%s: %s\n", dirName, strerror(errno));
++
++ continue;
++ }
++ n = scandir(dirName, &namelist, 0, alphasort);
++ if (n < 0)
++ perror("scandir");
++ else
++ while(n--)
++ {
++ if (strncmp(namelist[n]->d_name,".",1) != 0)
++ {
++ fullName = malloc(sizeof(dirName) + 1 \
++ + sizeof(namelist[n]->d_name));
++ strcpy(fullName, dirName);
++ strcat(fullName, "/");
++ strcat(fullName, namelist[n]->d_name);
++ if (access(fullName,X_OK|F_OK) == 0)
++ listAdd(namelist[n]->d_name);
++ }
++ }
++ }
++return(0);
++}
++
++/******************************************************************/
++/* BEGIN Interface to Readline Completion */
++/******************************************************************/
++
++char * dupstr (char *s)
++{
++ char *r;
++
++ r = xmalloc (strlen (s) + 1);
++ strcpy (r, s);
++ return (r);
++}
++
++/* Tell the GNU Readline library how to complete. We want to try to complete
++ on command names if this is the first word in the line, or on filenames
++ if not. */
++void initialize_readline (void)
++{
++ /* Allow conditional parsing of the ~/.inputrc file. */
++ rl_readline_name = "readline";
++
++ /* Tell the completer that we want a crack first. */
++ rl_attempted_completion_function = (CPPFunction *)fileman_completion;
++}
++
++/* Attempt to complete on the contents of TEXT. START and END bound the
++ region of rl_line_buffer that contains the word to complete. TEXT is
++ the word to complete. We can use the entire contents of rl_line_buffer
++ in case we want to do some simple parsing. Return the array of matches,
++ or NULL if there aren't any. */
++char ** fileman_completion (char *text, int start, int end)
++{
++ char **matches;
++
++ matches = (char **)NULL;
++
++ /* If this word is at the start of the line, then it is a command
++ to complete. Otherwise it is the name of a file in the current
++ directory. */
++ if (start == 0) // is it the begin of string ?
++ matches = completion_matches (text, command_generator);
++ return (matches);
++}
++
++/* Generator function for command completion. STATE lets us know whether
++ to start from scratch; without any state (i.e. STATE == 0), then we
++ start at the top of the list. */
++char * command_generator (char *text, int state)
++{
++ static int list_index, len;
++ char *ename;
++ static long exec_count;
++
++ /* If this is a new word to complete, initialize now. This includes
++ saving the length of TEXT for efficiency, and initializing the index
++ variable to 0. */
++ if (!state)
++ {
++ exec_count = 0;
++ list_index = 0;
++ len = strlen (text);
++ }
++
++ /* Return the next name which partially matches from the command list. */
++
++ while (ename = (char*)commandEntryTable[list_index].name)
++ {
++ list_index++;
++ if (strncmp (ename, text, len) == 0)
++ return (dupstr(ename));
++ }
++
++ while (exec_count < listSize)
++ {
++ ename = listBase[exec_count];
++ exec_count++;
++ if (strncmp (ename, text, len) == 0)
++ return(dupstr(ename));
++ }
++ /* If no names matched, then return NULL. */
++ return ((char *)NULL);
++}
++/******************************************************************/
++/* END Interface to Readline Completion */
++/******************************************************************/
++#endif
+
+ /*
+ * Global interrupt flag.
+@@ -405,7 +600,16 @@
+ commandFile = NULL;
+ quietFlag = FALSE;
+ aliasFlag = FALSE;
++#ifdef HAVE_READLINE
++ /*
++ * Default our path if it is not set.
++ */
++ if (getenv("PATH") == NULL)
++ putenv("PATH=/bin:/usr/bin:/sbin:/usr/sbin");
+
++ genExecList();
++ initialize_readline (); /* Bind our completer. */
++#endif
+ /*
+ * Look for options.
+ */
+@@ -554,6 +758,9 @@
+ static void
+ readFile(const char * name)
+ {
++#ifdef HAVE_READLINE
++ char *input_line = NULL;
++#endif
+ FILE * fp;
+ int cc;
+ BOOL ttyFlag;
+@@ -586,9 +793,10 @@
+
+ while (TRUE)
+ {
+- if (ttyFlag)
++#ifndef HAVE_READLINE
++ if (ttyFlag)
+ showPrompt();
+-
++#endif
+ if (intFlag && !ttyFlag && (fp != stdin))
+ {
+ fclose(fp);
+@@ -596,6 +804,19 @@
+
+ return;
+ }
++#ifdef HAVE_READLINE
++ if (name == NULL)
++ {
++ input_line = readline(prompt ? prompt : "$ ");
++ if (input_line)
++ {
++ if (*input_line)
++ add_history(input_line);
++ strcpy(buf,input_line);
++ }
++ free(input_line);
++ }
++#else
+
+ if (fgets(buf, CMD_LEN - 1, fp) == NULL)
+ {
+@@ -608,7 +829,7 @@
+
+ break;
+ }
+-
++#endif
+ cc = strlen(buf);
+
+ if (buf[cc - 1] == '\n')
diff --git a/app-shells/sash/sash-3.6.ebuild b/app-shells/sash/sash-3.6.ebuild
new file mode 100644
index 000000000000..d4ed94bad8d1
--- /dev/null
+++ b/app-shells/sash/sash-3.6.ebuild
@@ -0,0 +1,47 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-shells/sash/sash-3.6.ebuild,v 1.1 2003/10/17 23:40:32 plasmaroo Exp $
+
+IUSE="readline"
+
+S=${WORKDIR}/${P}
+DESCRIPTION="A small static UNIX Shell with readline support"
+SRC_URI="http://www.canb.auug.org.au/~dbell/programs/${P}.tar.gz"
+HOMEPAGE="http://www.canb.auug.org.au/~dbell/ http://dimavb.st.simbirsk.su/vlk/"
+SLOT="0"
+LICENSE="freedist"
+
+DEPEND="virtual/glibc
+ >=sys-libs/zlib-1.1.4
+ readline? ( >=sys-libs/readline-4.1 >=sys-libs/ncurses-5.2 )"
+
+RDEPEND=""
+KEYWORDS="x86 ppc sparc alpha hppa mips arm ia64"
+
+src_unpack() {
+
+ unpack ${P}.tar.gz
+ cd ${S}
+
+ epatch ${FILESDIR}/sash-3.6-fix-includes.patch
+
+ if [ "`use readline`" ]
+ then
+ epatch ${FILESDIR}/sash-3.6-readline.patch
+ fi
+
+ sed -e "s:-O3:${CFLAGS}:" -i Makefile
+
+}
+
+src_compile() {
+ make || die
+}
+
+src_install() {
+ into /
+ dobin sash
+ into /usr
+ doman sash.1
+ dodoc README
+}