diff -u -Naur bash-2.05b/Makefile.in bash-2.05b.fink/Makefile.in --- bash-2.05b/Makefile.in Fri May 31 13:44:23 2002 +++ bash-2.05b.fink/Makefile.in Fri Nov 29 18:09:30 2002 @@ -125,7 +125,7 @@ CCFLAGS = $(BASE_CCFLAGS) $(CPPFLAGS) $(CFLAGS) -CCFLAGS_FOR_BUILD = $(BASE_CCFLAGS) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) +CCFLAGS_FOR_BUILD = $(CFLAGS) $(BASE_CCFLAGS) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) LDFLAGS = @LDFLAGS@ $(STATIC_LD) $(LOCAL_LDFLAGS) $(PROFILE_FLAGS) $(CFLAGS) LDFLAGS_FOR_BUILD = $(LDFLAGS) @@ -611,8 +611,8 @@ $(SHELL) ./config.status --recheck # comment out for distribution -$(srcdir)/configure: $(srcdir)/configure.in $(srcdir)/aclocal.m4 $(srcdir)/config.h.in - cd $(srcdir) && autoconf +#$(srcdir)/configure: $(srcdir)/configure.in $(srcdir)/aclocal.m4 $(srcdir)/config.h.in +# cd $(srcdir) && autoconf # for chet reconfig: force diff -u -Naur bash-2.05b/README.Fink bash-2.05b.fink/README.Fink --- bash-2.05b/README.Fink Wed Dec 31 19:00:00 1969 +++ bash-2.05b.fink/README.Fink Fri Nov 29 18:09:30 2002 @@ -0,0 +1,32 @@ +This installation of bash has been set up to use an init system similar +to the tcsh installed by OS X. + +In order to use this configuration: + + echo "source ~/.bashrc" > ~/.bash_profile + echo "source @PREFIX@/share/init/bash/rc" > ~/.bashrc + echo "source @PREFIX@/bin/init.sh" >> ~/.bashrc + +In order to customize this setup: + + mkdir ~/Library/init/bash + +and create the following files there as necessary: + + aliases.mine - shell aliases + completions.mine - completions + environment.mine - environment + rc.mine - run commands + path - command search path + +See the corresponding file in @PREFIX@/share/init/bash for more +information about the role of each file. You can easily extend or +override the configuration provided by the default file. For example, +you can add more aliases by adding the appropriate commands in +aliases.mine. + +The init files were originally written by Wilfredo Sanchez, but they contained +a few errors which I've taken the liberty of correcting. + +-Christian Swinehart + 16 Jan 2002 diff -u -Naur bash-2.05b/bashline.c bash-2.05b.fink/bashline.c --- bash-2.05b/bashline.c Tue May 7 15:52:42 2002 +++ bash-2.05b.fink/bashline.c Fri Nov 29 18:09:30 2002 @@ -1052,7 +1052,11 @@ filenames and leave directories in the match list. */ if (matches == (char **)NULL) rl_ignore_some_completions_function = bash_ignore_filenames; +#if 0 else if (matches[1] == 0 && *matches[0] != '/') +#else + else if (matches[1] == 0 && absolute_pathname (matches[0]) == 0) +#endif /* Turn off rl_filename_completion_desired so readline doesn't append a slash if there is a directory with the same name in the current directory, or other filename-specific things. diff -u -Naur bash-2.05b/builtins/Makefile.in bash-2.05b.fink/builtins/Makefile.in --- bash-2.05b/builtins/Makefile.in Tue Apr 23 09:24:23 2002 +++ bash-2.05b.fink/builtins/Makefile.in Fri Nov 29 18:09:30 2002 @@ -73,7 +73,7 @@ CCFLAGS = $(BASE_CCFLAGS) $(CPPFLAGS) $(CFLAGS) -CCFLAGS_FOR_BUILD = $(BASE_CCFLAGS) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) +CCFLAGS_FOR_BUILD = $(CFLAGS) $(BASE_CCFLAGS) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) GCC_LINT_FLAGS = -Wall -Wshadow -Wpointer-arith -Wcast-qual \ -Wcast-align -Wstrict-prototypes -Wconversion \ diff -u -Naur bash-2.05b/doc/Makefile.in bash-2.05b.fink/doc/Makefile.in --- bash-2.05b/doc/Makefile.in Thu May 16 15:17:07 2002 +++ bash-2.05b.fink/doc/Makefile.in Fri Nov 29 18:36:40 2002 @@ -221,11 +221,11 @@ -$(INSTALL_DATA) $(srcdir)/bash.1 $(DESTDIR)$(man1dir)/bash${man1ext} -$(INSTALL_DATA) $(srcdir)/bashbug.1 $(DESTDIR)$(man1dir)/bashbug${man1ext} # uncomment the next line to install the builtins man page -# -$(INSTALL_DATA) $(srcdir)/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext} - -$(INSTALL_DATA) $(srcdir)/bashref.info $(DESTDIR)$(infodir)/bash.info + -$(INSTALL_DATA) $(srcdir)/builtins.1 $(DESTDIR)$(man1dir)/bash_builtins${man1ext} +# -$(INSTALL_DATA) $(srcdir)/bashref.info $(DESTDIR)$(infodir)/bash.info # run install-info if it is present to update the info directory - if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ - install-info --dir-file=$(DESTDIR)$(infodir)/dir $(DESTDIR)$(infodir)/bash.info; \ +# if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \ +# install-info --dir-file=$(DESTDIR)$(infodir)/dir $(DESTDIR)$(infodir)/bash.info; \ else true; fi # if htmldir is set, install the html files into that directory -if test -n "${htmldir}" ; then \ diff -u -Naur bash-2.05b/doc/bash.1 bash-2.05b.fink/doc/bash.1 --- bash-2.05b/doc/bash.1 Mon Jul 15 15:21:03 2002 +++ bash-2.05b.fink/doc/bash.1 Fri Nov 29 18:09:30 2002 @@ -186,7 +186,7 @@ .TP .B \-\-noprofile Do not read either the system-wide startup file -.FN /etc/profile +.FN @PREFIX@/etc/profile or any of the personal initialization files .IR ~/.bash_profile , .IR ~/.bash_login , @@ -292,7 +292,7 @@ .B bash is invoked as an interactive login shell, or as a non-interactive shell with the \fB\-\-login\fP option, it first reads and -executes commands from the file \fI/etc/profile\fP, if that +executes commands from the file \fI@PREFIX@/etc/profile\fP, if that file exists. After reading that file, it looks for \fI~/.bash_profile\fP, \fI~/.bash_login\fP, and \fI~/.profile\fP, in that order, and reads @@ -348,7 +348,7 @@ When invoked as an interactive login shell, or a non-interactive shell with the \fB\-\-login\fP option, it first attempts to read and execute commands from -.I /etc/profile +.I @PREFIX@/etc/profile and .IR ~/.profile , in that order. @@ -8262,10 +8262,10 @@ .SH FILES .PD 0 .TP -.FN /bin/bash +.FN @PREFIX@/bin/bash The \fBbash\fP executable .TP -.FN /etc/profile +.FN @PREFIX@/etc/profile The systemwide initialization file, executed for login shells .TP .FN ~/.bash_profile diff -u -Naur bash-2.05b/doc/bashref.texi bash-2.05b.fink/doc/bashref.texi --- bash-2.05b/doc/bashref.texi Mon Jul 15 15:21:24 2002 +++ bash-2.05b.fink/doc/bashref.texi Fri Nov 29 18:09:30 2002 @@ -4470,7 +4470,7 @@ to read command lines when the shell is interactive. @item --noprofile -Don't load the system-wide startup file @file{/etc/profile} +Don't load the system-wide startup file @file{@PREFIX@/etc/profile} or any of the personal initialization files @file{~/.bash_profile}, @file{~/.bash_login}, or @file{~/.profile} when Bash is invoked as a login shell. @@ -4595,7 +4595,7 @@ When Bash is invoked as an interactive login shell, or as a non-interactive shell with the @option{--login} option, it first reads and -executes commands from the file @file{/etc/profile}, if that file exists. +executes commands from the file @file{@PREFIX@/etc/profile}, if that file exists. After reading that file, it looks for @file{~/.bash_profile}, @file{~/.bash_login}, and @file{~/.profile}, in that order, and reads and executes commands from the first one that exists and is readable. @@ -4646,7 +4646,7 @@ When invoked as an interactive login shell, or as a non-interactive shell with the @option{--login} option, it first attempts to read -and execute commands from @file{/etc/profile} and @file{~/.profile}, in +and execute commands from @file{@PREFIX@/etc/profile} and @file{~/.profile}, in that order. The @option{--noprofile} option may be used to inhibit this behavior. When invoked as an interactive shell with the name @code{sh}, Bash diff -u -Naur bash-2.05b/doc/rbash.1 bash-2.05b.fink/doc/rbash.1 --- bash-2.05b/doc/rbash.1 Mon Nov 29 16:30:03 1999 +++ bash-2.05b.fink/doc/rbash.1 Fri Nov 29 18:09:30 2002 @@ -3,6 +3,6 @@ rbash \- restricted bash, see \fBbash\fR(1) .SH RESTRICTED SHELL .nr zY 1 -.so bash.1 +.so man1/bash.1 .SH SEE ALSO bash(1) diff -u -Naur bash-2.05b/examples/loadables/pushd.c bash-2.05b.fink/examples/loadables/pushd.c --- bash-2.05b/examples/loadables/pushd.c Wed Dec 31 19:00:00 1969 +++ bash-2.05b.fink/examples/loadables/pushd.c Fri Nov 29 18:09:30 2002 @@ -0,0 +1,608 @@ +/* pushd.c, created from pushd.def. */ +#include + +#include +#include + +#if defined (HAVE_UNISTD_H) +# include +#endif + +#include "bashansi.h" + +#include + +#include + +#include "shell.h" +#include "builtins.h" +#include "maxpath.h" +#include "common.h" + +#if !defined (errno) +extern int errno; +#endif /* !errno */ + +static char *m_badarg = "%s: bad argument"; + +/* The list of remembered directories. */ +static char **pushd_directory_list = (char **)NULL; + +/* Number of existing slots in this list. */ +static int directory_list_size; + +/* Offset to the end of the list. */ +static int directory_list_offset; + +static void pushd_error (); +static void clear_directory_stack (); +static int cd_to_string (); +static int change_to_temp (); +static int get_dirstack_index (); +static void add_dirstack_element (); + +#define NOCD 0x01 +#define ROTATE 0x02 +#define LONGFORM 0x04 +#define CLEARSTAK 0x08 + +int +pushd_builtin (list) + WORD_LIST *list; +{ + char *temp, *current_directory, *top; + int j, flags; + long num; + char direction; + + /* If there is no argument list then switch current and + top of list. */ + if (list == 0) + { + if (directory_list_offset == 0) + { + builtin_error ("no other directory"); + return (EXECUTION_FAILURE); + } + + current_directory = get_working_directory ("pushd"); + if (current_directory == 0) + return (EXECUTION_FAILURE); + + j = directory_list_offset - 1; + temp = pushd_directory_list[j]; + pushd_directory_list[j] = current_directory; + j = change_to_temp (temp); + free (temp); + return j; + } + + for (flags = 0; list; list = list->next) + { + if (ISOPTION (list->word->word, 'n')) + { + flags |= NOCD; + } + else if (ISOPTION (list->word->word, '-')) + { + list = list->next; + break; + } + else if (list->word->word[0] == '-' && list->word->word[1] == '\0') + /* Let `pushd -' work like it used to. */ + break; + else if (((direction = list->word->word[0]) == '+') || direction == '-') + { + if (legal_number (list->word->word + 1, &num) == 0) + { + builtin_error (m_badarg, list->word->word); + builtin_usage (); + return (EXECUTION_FAILURE); + } + + if (direction == '-') + num = directory_list_offset - num; + + if (num > directory_list_offset || num < 0) + { + pushd_error (directory_list_offset, list->word->word); + return (EXECUTION_FAILURE); + } + flags |= ROTATE; + } + else if (*list->word->word == '-') + { + bad_option (list->word->word); + builtin_usage (); + return (EXECUTION_FAILURE); + } + else + break; + } + + if (flags & ROTATE) + { + /* Rotate the stack num times. Remember, the current + directory acts like it is part of the stack. */ + temp = get_working_directory ("pushd"); + + if (num == 0) + { + j = ((flags & NOCD) == 0) ? change_to_temp (temp) : EXECUTION_SUCCESS; + free (temp); + return j; + } + + do + { + top = pushd_directory_list[directory_list_offset - 1]; + + for (j = directory_list_offset - 2; j > -1; j--) + pushd_directory_list[j + 1] = pushd_directory_list[j]; + + pushd_directory_list[j + 1] = temp; + + temp = top; + num--; + } + while (num); + + j = ((flags & NOCD) == 0) ? change_to_temp (temp) : EXECUTION_SUCCESS; + free (temp); + return j; + } + + if (list == 0) + return (EXECUTION_SUCCESS); + + /* Change to the directory in list->word->word. Save the current + directory on the top of the stack. */ + current_directory = get_working_directory ("pushd"); + if (current_directory == 0) + return (EXECUTION_FAILURE); + + j = ((flags & NOCD) == 0) ? cd_builtin (list) : EXECUTION_SUCCESS; + if (j == EXECUTION_SUCCESS) + { + add_dirstack_element ((flags & NOCD) ? savestring (list->word->word) : current_directory); + dirs_builtin ((WORD_LIST *)NULL); + if (flags & NOCD) + free (current_directory); + return (EXECUTION_SUCCESS); + } + else + { + free (current_directory); + return (EXECUTION_FAILURE); + } +} + +/* Pop the directory stack, and then change to the new top of the stack. + If LIST is non-null it should consist of a word +N or -N, which says + what element to delete from the stack. The default is the top one. */ +int +popd_builtin (list) + WORD_LIST *list; +{ + register int i; + long which; + int flags; + char direction; + char *which_word; + + which_word = (char *)NULL; + for (flags = 0, which = 0L, direction = '+'; list; list = list->next) + { + if (ISOPTION (list->word->word, 'n')) + { + flags |= NOCD; + } + else if (ISOPTION (list->word->word, '-')) + { + list = list->next; + break; + } + else if (((direction = list->word->word[0]) == '+') || direction == '-') + { + if (legal_number (list->word->word + 1, &which) == 0) + { + builtin_error (m_badarg, list->word->word); + builtin_usage (); + return (EXECUTION_FAILURE); + } + which_word = list->word->word; + } + else if (*list->word->word == '-') + { + bad_option (list->word->word); + builtin_usage (); + return (EXECUTION_FAILURE); + } + else + break; + } + + if (which > directory_list_offset || (directory_list_offset == 0 && which == 0)) + { + pushd_error (directory_list_offset, which_word ? which_word : ""); + return (EXECUTION_FAILURE); + } + + /* Handle case of no specification, or top of stack specification. */ + if ((direction == '+' && which == 0) || + (direction == '-' && which == directory_list_offset)) + { + i = ((flags & NOCD) == 0) ? cd_to_string (pushd_directory_list[directory_list_offset - 1]) + : EXECUTION_SUCCESS; + if (i != EXECUTION_SUCCESS) + return (i); + free (pushd_directory_list[--directory_list_offset]); + } + else + { + /* Since an offset other than the top directory was specified, + remove that directory from the list and shift the remainder + of the list into place. */ + i = (direction == '+') ? directory_list_offset - which : which; + free (pushd_directory_list[i]); + directory_list_offset--; + + /* Shift the remainder of the list into place. */ + for (; i < directory_list_offset; i++) + pushd_directory_list[i] = pushd_directory_list[i + 1]; + } + + dirs_builtin ((WORD_LIST *)NULL); + return (EXECUTION_SUCCESS); +} + +/* Print the current list of directories on the directory stack. */ +int +dirs_builtin (list) + WORD_LIST *list; +{ + int flags, desired_index, index_flag, vflag; + long i; + char *temp, *w; + + for (flags = vflag = index_flag = 0, desired_index = -1, w = ""; list; list = list->next) + { + if (ISOPTION (list->word->word, 'l')) + { + flags |= LONGFORM; + } + else if (ISOPTION (list->word->word, 'c')) + { + flags |= CLEARSTAK; + } + else if (ISOPTION (list->word->word, 'v')) + { + vflag |= 2; + } + else if (ISOPTION (list->word->word, 'p')) + { + vflag |= 1; + } + else if (ISOPTION (list->word->word, '-')) + { + list = list->next; + break; + } + else if (*list->word->word == '+' || *list->word->word == '-') + { + int sign; + if (legal_number (w = list->word->word + 1, &i) == 0) + { + builtin_error (m_badarg, list->word->word); + builtin_usage (); + return (EXECUTION_FAILURE); + } + sign = (*list->word->word == '+') ? 1 : -1; + desired_index = get_dirstack_index (i, sign, &index_flag); + } + else + { + bad_option (list->word->word); + builtin_usage (); + return (EXECUTION_FAILURE); + } + } + + if (flags & CLEARSTAK) + { + clear_directory_stack (); + return (EXECUTION_SUCCESS); + } + + if (index_flag && (desired_index < 0 || desired_index > directory_list_offset)) + { + pushd_error (directory_list_offset, w); + return (EXECUTION_FAILURE); + } + +#define DIRSTACK_FORMAT(temp) \ + (flags & LONGFORM) ? temp : polite_directory_format (temp) + + /* The first directory printed is always the current working directory. */ + if (index_flag == 0 || (index_flag == 1 && desired_index == 0)) + { + temp = get_working_directory ("dirs"); + if (temp == 0) + temp = savestring (""); + if (vflag & 2) + printf ("%2d %s", 0, DIRSTACK_FORMAT (temp)); + else + printf ("%s", DIRSTACK_FORMAT (temp)); + free (temp); + if (index_flag) + { + putchar ('\n'); + return EXECUTION_SUCCESS; + } + } + +#define DIRSTACK_ENTRY(i) \ + (flags & LONGFORM) ? pushd_directory_list[i] \ + : polite_directory_format (pushd_directory_list[i]) + + /* Now print the requested directory stack entries. */ + if (index_flag) + { + if (vflag & 2) + printf ("%2d %s", directory_list_offset - desired_index, + DIRSTACK_ENTRY (desired_index)); + else + printf ("%s", DIRSTACK_ENTRY (desired_index)); + } + else + for (i = directory_list_offset - 1; i >= 0; i--) + if (vflag >= 2) + printf ("\n%2d %s", directory_list_offset - (int)i, DIRSTACK_ENTRY (i)); + else + printf ("%s%s", (vflag & 1) ? "\n" : " ", DIRSTACK_ENTRY (i)); + + putchar ('\n'); + fflush (stdout); + return (EXECUTION_SUCCESS); +} + +static void +pushd_error (offset, arg) + int offset; + char *arg; +{ + if (offset == 0) + builtin_error ("directory stack empty"); + else if (arg) + builtin_error ("%s: bad directory stack index", arg); + else + builtin_error ("bad directory stack index"); +} + +static void +clear_directory_stack () +{ + register int i; + + for (i = 0; i < directory_list_offset; i++) + free (pushd_directory_list[i]); + directory_list_offset = 0; +} + +/* Switch to the directory in NAME. This uses the cd_builtin to do the work, + so if the result is EXECUTION_FAILURE then an error message has already + been printed. */ +static int +cd_to_string (name) + char *name; +{ + WORD_LIST *tlist; + int result; + + tlist = make_word_list (make_word (name), NULL); + result = cd_builtin (tlist); + dispose_words (tlist); + return (result); +} + +static int +change_to_temp (temp) + char *temp; +{ + int tt; + + tt = temp ? cd_to_string (temp) : EXECUTION_FAILURE; + + if (tt == EXECUTION_SUCCESS) + dirs_builtin ((WORD_LIST *)NULL); + + return (tt); +} + +static void +add_dirstack_element (dir) + char *dir; +{ + int j; + + if (directory_list_offset == directory_list_size) + { + j = (directory_list_size += 10) * sizeof (char *); + pushd_directory_list = (char **)xrealloc (pushd_directory_list, j); + } + pushd_directory_list[directory_list_offset++] = dir; +} + +static int +get_dirstack_index (ind, sign, indexp) + int ind, sign, *indexp; +{ + if (indexp) + *indexp = sign > 0 ? 1 : 2; + + /* dirs +0 prints the current working directory. */ + /* dirs -0 prints last element in directory stack */ + if (ind == 0 && sign > 0) + return 0; + else if (ind == directory_list_offset) + { + if (indexp) + *indexp = sign > 0 ? 2 : 1; + return 0; + } + else + return (sign > 0 ? directory_list_offset - ind : ind); +} + +char * +get_dirstack_element (ind, sign) + int ind, sign; +{ + int i; + + i = get_dirstack_index (ind, sign, (int *)NULL); + return (i < 0 || i > directory_list_offset) ? (char *)NULL + : pushd_directory_list[i]; +} + +void +set_dirstack_element (ind, sign, value) + int ind, sign; + char *value; +{ + int i; + + i = get_dirstack_index (ind, sign, (int *)NULL); + if (ind == 0 || i < 0 || i > directory_list_offset) + return; + free (pushd_directory_list[i]); + pushd_directory_list[i] = savestring (value); +} + +WORD_LIST * +get_directory_stack () +{ + register int i; + WORD_LIST *ret; + char *d, *t; + + for (ret = (WORD_LIST *)NULL, i = 0; i < directory_list_offset; i++) + { + d = polite_directory_format (pushd_directory_list[i]); + ret = make_word_list (make_word (d), ret); + } + /* Now the current directory. */ + d = get_working_directory ("dirstack"); + i = 0; /* sentinel to decide whether or not to free d */ + if (d == 0) + d = "."; + else + { + t = polite_directory_format (d); + /* polite_directory_format sometimes returns its argument unchanged. + If it does not, we can free d right away. If it does, we need to + mark d to be deleted later. */ + if (t != d) + { + free (d); + d = t; + } + else /* t == d, so d is what we want */ + i = 1; + } + ret = make_word_list (make_word (d), ret); + if (i) + free (d); + return ret; /* was (REVERSE_LIST (ret, (WORD_LIST *)); */ +} + +static char *dirs_doc[] = { + "Display the list of currently remembered directories. Directories", + "find their way onto the list with the `pushd' command; you can get", + "back up through the list with the `popd' command.", + "", + "The -l flag specifies that `dirs' should not print shorthand versions", + "of directories which are relative to your home directory. This means", + "that `~/bin' might be displayed as `/homes/bfox/bin'. The -v flag", + "causes `dirs' to print the directory stack with one entry per line,", + "prepending the directory name with its position in the stack. The -p", + "flag does the same thing, but the stack position is not prepended.", + "The -c flag clears the directory stack by deleting all of the elements.", + "", + "+N displays the Nth entry counting from the left of the list shown by", + " dirs when invoked without options, starting with zero.", + "", + "-N displays the Nth entry counting from the right of the list shown by", + " dirs when invoked without options, starting with zero.", + (char *)NULL +}; + +static char *pushd_doc[] = { + "Adds a directory to the top of the directory stack, or rotates", + "the stack, making the new top of the stack the current working", + "directory. With no arguments, exchanges the top two directories.", + "", + "+N Rotates the stack so that the Nth directory (counting", + " from the left of the list shown by `dirs', starting with" + " zero) is at the top.", + "", + "-N Rotates the stack so that the Nth directory (counting", + " from the right of the list shown by `dirs', starting with" + " zero) is at the top.", + "", + "-n suppress the normal change of directory when adding directories", + " to the stack, so only the stack is manipulated.", + "", + "dir adds DIR to the directory stack at the top, making it the", + " new current working directory.", + "", + "You can see the directory stack with the `dirs' command.", + (char *)NULL +}; + +static char *popd_doc[] = { + "Removes entries from the directory stack. With no arguments,", + "removes the top directory from the stack, and cd's to the new", + "top directory.", + "", + "+N removes the Nth entry counting from the left of the list", + " shown by `dirs', starting with zero. For example: `popd +0'", + " removes the first directory, `popd +1' the second.", + "", + "-N removes the Nth entry counting from the right of the list", + " shown by `dirs', starting with zero. For example: `popd -0'", + " removes the last directory, `popd -1' the next to last.", + "", + "-n suppress the normal change of directory when removing directories", + " from the stack, so only the stack is manipulated.", + "", + "You can see the directory stack with the `dirs' command.", + (char *)NULL +}; + +struct builtin pushd_struct = { + "pushd", + pushd_builtin, + BUILTIN_ENABLED, + pushd_doc, + "pushd [+N | -N] [-n] [dir]", + 0 +}; + +struct builtin popd_struct = { + "popd", + popd_builtin, + BUILTIN_ENABLED, + popd_doc, + "popd [+N | -N] [-n]", + 0 +}; + +struct builtin dirs_struct = { + "dirs", + dirs_builtin, + BUILTIN_ENABLED, + dirs_doc, + "dirs [-clpv] [+N] [-N]", + 0 +}; diff -u -Naur bash-2.05b/init/README bash-2.05b.fink/init/README --- bash-2.05b/init/README Wed Dec 31 19:00:00 1969 +++ bash-2.05b.fink/init/README Fri Nov 29 18:09:30 2002 @@ -0,0 +1,28 @@ +This directory contains some useful bash files. + +In order to use this configuration: + + echo "source ~/.bashrc" > ~/.bash_profile + echo "source @PREFIX@/share/init/bash/rc" > ~/.bashrc + echo "source @PREFIX@/bin/init.sh" >> ~/.bashrc + +In order to customize this setup: + + mkdir ~/Library/init/bash + +and create the following files there as necessary: + + aliases.mine - shell aliases + completions.mine - completions + environment.mine - environment + rc.mine - run commands + path - command search path + +See the corresponding file in @PREFIX@/share/init/bash for more +information about the role of each file. You can easily extend or +override the configuration provided by the default file. For example, +you can add more aliases by adding the appropriate commands in +aliases.mine. + + -christian + cds@users.sourceforge.net diff -u -Naur bash-2.05b/init/aliases bash-2.05b.fink/init/aliases --- bash-2.05b/init/aliases Wed Dec 31 19:00:00 1969 +++ bash-2.05b.fink/init/aliases Fri Nov 29 18:09:30 2002 @@ -0,0 +1,39 @@ +## +# Bash aliases file +# +# Wilfredo Sanchez Jr. | tritan@mit.edu +## + +## +# Aliases +## + +#alias .='cwd' +alias ..='cd ..' +alias cd..='cd ..' +alias cdwd='cd $(/bin/pwd)' +alias cwd='echo $PWD' +alias l='ls -lg' + +## +# Functions +## + +function files () { find ${1} -type f -print ; } +function ff () { find . -name ${1} -print ; } +function ll () { ls -lag "$@" | more ; } +function word () { fgrep -i "$*" /usr/dict/web2 ; } +function wordcount () { cat "${1}" | tr -s ' .,;:?\!()[]"' '\012' | \ + cat -n | tail -1 | awk '{print $1}' ; } + +## +# Read user's aliases +## +if [ -r ${bash_initdir}/aliases.mine ]; then + source ${bash_initdir}/aliases.mine +fi + +# Local Variables: +# mode:shell-script +# sh-shell:bash +# End: diff -u -Naur bash-2.05b/init/bash.defaults bash-2.05b.fink/init/bash.defaults --- bash-2.05b/init/bash.defaults Wed Dec 31 19:00:00 1969 +++ bash-2.05b.fink/init/bash.defaults Fri Nov 29 18:09:30 2002 @@ -0,0 +1,27 @@ +## +# Bash +# User preferences file +# Override these in rc.mine +# +# Wilfredo Sanchez Jr. | tritan@mit.edu +# July 09, 1992 +# +# MIT Project Athena +## + +if [ -n "$PS1" ]; then + + # Prompts + PS1='[\h:\w] \u\$ ' + PS2=' -> ' + #PS3= + #PS4= + + set -o emacs + +fi + +# Local Variables: +# mode:shell-script +# sh-shell:bash +# End: diff -u -Naur bash-2.05b/init/completions bash-2.05b.fink/init/completions --- bash-2.05b/init/completions Wed Dec 31 19:00:00 1969 +++ bash-2.05b.fink/init/completions Fri Nov 29 18:09:30 2002 @@ -0,0 +1,17 @@ +## +# Add completions for the fink command +## +complete -W "--help --version apropos configure describe install list selfupdate selfupdate-cvs remove update-all" fink + +## +# Read user's completions +## +if [ -r ${bash_initdir}/completions.mine ]; then + source ${bash_initdir}/completions.mine +fi + + +# Local Variables: +# mode:shell-script +# sh-shell:bash +# End: diff -u -Naur bash-2.05b/init/environment bash-2.05b.fink/init/environment --- bash-2.05b/init/environment Wed Dec 31 19:00:00 1969 +++ bash-2.05b.fink/init/environment Fri Nov 29 18:09:30 2002 @@ -0,0 +1,29 @@ +## +# Bourne Again Shell environment file +# Global environment setup +# +# Wilfredo Sanchez Jr. | tritan@mit.edu +# July 09, 1992 +# +# MIT Project Athena +# +# ORIGINAL SOURCES: /usr/athena/lib/init/cshrc (ATHENA REL 7.3P) +## + +export ENV_SET="YES" # avoid repeat + +# File creation mask +umask 022 # all files created are -rw-r--r-- + +## +# Load user environment +## + +if [ -f ${bash_initdir}/environment.mine ]; then + source ${bash_initdir}/environment.mine +fi + +# Local Variables: +# mode:shell-script +# sh-shell:bash +# End: diff -u -Naur bash-2.05b/init/logout bash-2.05b.fink/init/logout --- bash-2.05b/init/logout Wed Dec 31 19:00:00 1969 +++ bash-2.05b.fink/init/logout Fri Nov 29 18:09:30 2002 @@ -0,0 +1,15 @@ +## +# Destroy credentials +## + +if [ -z "${TERM_PROGRAM}" ]; then + # Don't run these commands if the shell is launched by Terminal, + # even if it's a login shell. + + if klist -s; then kdestroy; fi +fi + +# Local Variables: +# mode:shell-script +# sh-shell:bash +# End: diff -u -Naur bash-2.05b/init/profile bash-2.05b.fink/init/profile --- bash-2.05b/init/profile Wed Dec 31 19:00:00 1969 +++ bash-2.05b.fink/init/profile Fri Nov 29 18:09:30 2002 @@ -0,0 +1,31 @@ +## +# Set path +## + +export PATH="${HOME}/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" +export MANPATH="${HOME}/man:/usr/local/share/man:/usr/share/man" + +## +# Read user's .profile +## + default_initdir=@PREFIX@/share/init +default_bash_initdir=${default_initdir}/bash + user_initdir=~/Library/init + user_bash_initdir=${user_initdir}/bash + +if [ -r ${user_bash_initdir} ]; then + initdir=${user_initdir} + bash_initdir=${user_bash_initdir} +else + initdir=${default_initdir} + bash_initdir=${default_bash_initdir} +fi + +if [ -r ${bash_initdir}/profile.mine ]; then + source ${bash_initdir}/profile.mine +fi + +# Local Variables: +# mode:shell-script +# sh-shell:bash +# End: diff -u -Naur bash-2.05b/init/rc bash-2.05b.fink/init/rc --- bash-2.05b/init/rc Wed Dec 31 19:00:00 1969 +++ bash-2.05b.fink/init/rc Fri Nov 29 18:09:30 2002 @@ -0,0 +1,71 @@ +## +# Bourne Again Shell config file +# +# Wilfredo Sanchez Jr. | tritan@mit.edu +# July 09, 1992 +# +# MIT Project Athena +# +# ORIGINAL SOURCES: /usr/athena/lib/init/cshrc (ATHENA REL 7.3P) +## + + default_initdir=@PREFIX@/share/init +default_bash_initdir=${default_initdir}/bash + user_initdir=~/Library/init + user_bash_initdir=${user_initdir}/bash + +if [ -r ${user_bash_initdir} ]; then + initdir=${user_initdir} + bash_initdir=${user_bash_initdir} +else + initdir=${default_initdir} + bash_initdir=${default_bash_initdir} +fi + +# SET UP HOST-DEPENDANT VARIABLES, ETC. + +host=$(echo $(hostname) | tr A-Z a-z) + +user=`whoami` + +export HOST=${host} +export USER=${user} + +# User ID +if [ -z "${uid}" ]; then uid=$(id | cut -d = -f 2 | cut -d \( -f 1); fi + +# SET COMMAND SEARCH PATH AND MAN PATH +if [ -f ${bash_initdir}/path ]; then source ${bash_initdir}/path; fi + +# ENVIRONMENT SETUP + +if [ -n "${PS1}" ]; then interactive="YES"; fi + +if [ -z "${ENV_SET}" ]; then + if [ -f ${default_bash_initdir}/environment ]; then + #echo "Initializing environment..." + source ${default_bash_initdir}/environment + fi +fi + +if [ -r ${default_bash_initdir}/bash.defaults ]; then + source ${default_bash_initdir}/bash.defaults +fi + +if [ "${interactive}" = "YES" ]; then + # These aren't useful for non-interactive sessions + if [ -f ${default_bash_initdir}/aliases ]; then + source ${default_bash_initdir}/aliases + fi + if [ -f ${default_bash_initdir}/completions ]; then + source ${default_bash_initdir}/completions + fi +fi + +# DEFAULT LOGIN SOURCES +if [ -f ${bash_initdir}/rc.mine ]; then source ${bash_initdir}/rc.mine; fi + +# Local Variables: +# mode:shell-script +# sh-shell:bash +# End: diff -u -Naur bash-2.05b/pathnames.h bash-2.05b.fink/pathnames.h --- bash-2.05b/pathnames.h Thu Aug 5 07:21:53 1999 +++ bash-2.05b.fink/pathnames.h Fri Nov 29 18:09:30 2002 @@ -25,6 +25,6 @@ #define DEFAULT_HOSTS_FILE "/etc/hosts" /* The default login shell startup file. */ -#define SYS_PROFILE "/etc/profile" +#define SYS_PROFILE "@PREFIX@/etc/profile" #endif /* _PATHNAMES_H */ diff -u -Naur bash-2.05b/profile.fink bash-2.05b.fink/profile.fink --- bash-2.05b/profile.fink Wed Dec 31 19:00:00 1969 +++ bash-2.05b.fink/profile.fink Fri Nov 29 18:09:30 2002 @@ -0,0 +1 @@ +source @PREFIX@/share/init/bash/profile diff -u -Naur bash-2.05b/support/Makefile.in bash-2.05b.fink/support/Makefile.in --- bash-2.05b/support/Makefile.in Tue Apr 16 10:31:35 2002 +++ bash-2.05b.fink/support/Makefile.in Fri Nov 29 18:09:30 2002 @@ -75,7 +75,7 @@ all: man2html$(EXEEXT) man2html$(EXEEXT): $(OBJ1) - $(CC) $(CCFLAGS) $(OBJ1) -o $@ ${LIBS} + $(CC) $(CCFLAGS) $(OBJ1) -o $@ ${LDFLAGS} ${LIBS} clean: rm man2html