update shells/sash to 3.5; from maintainer Wilbern Cobb <vedge@csoft.org>

This commit is contained in:
lebel 2002-03-13 13:26:59 +00:00
parent d9a1fcdded
commit 5e8437204b
9 changed files with 152 additions and 149 deletions

View File

@ -1,11 +1,11 @@
# $OpenBSD: Makefile,v 1.3 2001/07/25 16:31:14 lebel Exp $
# $OpenBSD: Makefile,v 1.4 2002/03/13 13:26:59 lebel Exp $
COMMENT= "stand-alone shell with built-in commands"
VER= 3.4
DISTNAME= sash-${VER}
VERSION= 3.5
DISTNAME= sash-${VERSION}
CATEGORIES= shells
NEED_VERSION= 1.402
NEED_VERSION= 1.509
HOMEPAGE= http://www.canb.auug.org.au/~dbell/
PERMIT_PACKAGE_CDROM= Yes
@ -15,14 +15,14 @@ PERMIT_DISTFILES_FTP= Yes
MAINTAINER= Wilbern Cobb <cobb@vedge.com.ar>
MASTER_SITES= http://www.canb.auug.org.au/~dbell/programs/
MASTER_SITES= http://www.canb.auug.org.au/~dbell/programs/ \
http://mirror.csoft.org/sash/ \
ftp://vedge.com.ar/pub/mirror/sash
DOCS= README
ALL_TARGET= sash
do-install:
cd ${WRKSRC} && ${INSTALL_PROGRAM} sash ${PREFIX}/bin
cd ${WRKSRC} && ${INSTALL_MAN} sash.1 ${PREFIX}/man/man1
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/sash
cd ${WRKSRC} && ${INSTALL_DATA} ${DOCS} ${PREFIX}/share/doc/sash
.include <bsd.port.mk>

View File

@ -1,3 +1,3 @@
MD5 (sash-3.4.tar.gz) = 9c631eb171371b69276ff6692100beb6
RMD160 (sash-3.4.tar.gz) = dc879f76f20d36096922725a21da9f1659691799
SHA1 (sash-3.4.tar.gz) = 19150eaa7a18cf37def3398ae7a6e55bf37f42c9
MD5 (sash-3.5.tar.gz) = 8de625cd380fd35064f1d59b2dff48c9
RMD160 (sash-3.5.tar.gz) = 135eb0e6d798801d8d26489ffa6fd61e3c64ecc7
SHA1 (sash-3.5.tar.gz) = 118b521ae5d83d5aa63ce6c8d4a444be5ce7ca25

View File

@ -1,25 +1,33 @@
$OpenBSD: patch-Makefile,v 1.1.1.1 2001/07/06 13:33:48 lebel Exp $
--- Makefile.orig Sat Sep 25 01:21:34 1999
+++ Makefile Fri Jul 6 09:21:42 2001
@@ -5,11 +5,11 @@
# The HAVE_EXT2 definition adds the -chattr and -lsattr comamnds.
$OpenBSD: patch-Makefile,v 1.2 2002/03/13 13:26:59 lebel Exp $
--- Makefile.orig Fri Mar 8 07:29:53 2002
+++ Makefile Wed Mar 13 06:44:16 2002
@@ -7,14 +7,16 @@
# The MOUNT_TYPE definition sets the default file system type for -mount.
#
HAVE_GZIP = 1
-HAVE_LINUX_ATTR = 1
-HAVE_LINUX_MOUNT = 1
-MOUNT_TYPE = '"ext3"'
+HAVE_LINUX_ATTR = 0
+HAVE_LINUX_MOUNT = 0
+HAVE_BSD_MOUNT = 1
+MOUNT_TYPE = '"ffs"'
-CFLAGS = -O3 -Wall -Wmissing-prototypes \
+CFLAGS += \
-DHAVE_GZIP=$(HAVE_GZIP) \
-DHAVE_LINUX_ATTR=$(HAVE_LINUX_ATTR) \
-DHAVE_LINUX_MOUNT=$(HAVE_LINUX_MOUNT) \
+ -DHAVE_BSD_MOUNT=$(HAVE_BSD_MOUNT) \
-DMOUNT_TYPE=$(MOUNT_TYPE)
-CFLAGS = -O3 -Wall -Wmissing-prototypes -DHAVE_GZIP -DHAVE_EXT2
+CFLAGS += -DHAVE_GZIP
+# CFLAGS += -DHAVE_EXT2
LDFLAGS = -static -s
LIBS = -lz
@@ -30,7 +32,7 @@ OBJS = sash.o cmds.o cmd_dd.o cmd_ed.o c
-
BINDIR = /bin
MANDIR = /usr/man/man1
@@ -17,6 +17,7 @@ MANDIR = /usr/man/man1
OBJS = sash.o cmds.o cmd_dd.o cmd_ed.o cmd_grep.o cmd_ls.o cmd_tar.o \
cmd_gzip.o cmd_find.o cmd_file.o cmd_chattr.o cmd_ar.o utils.o
+all: sash
sash: $(OBJS)
$(CC) $(LDFLAGS) -o sash $(OBJS) $(LIBS)
- $(CC) $(LDFLAGS) -o sash $(OBJS) $(LIBS)
+ $(CC) $(CFLAGS) $(LDFLAGS) -o sash $(OBJS) $(LIBS)
clean:
rm -f $(OBJS) sash

View File

@ -1,49 +1,30 @@
$OpenBSD: patch-cmds_c,v 1.1.1.1 2001/07/06 13:33:48 lebel Exp $
--- cmds.c.orig Thu Jun 3 17:42:17 1999
+++ cmds.c Fri Jul 6 09:21:42 2001
@@ -10,14 +10,20 @@
$OpenBSD: patch-cmds_c,v 1.2 2002/03/13 13:26:59 lebel Exp $
--- cmds.c.orig Fri Mar 8 03:27:36 2002
+++ cmds.c Wed Mar 13 06:53:25 2002
@@ -10,7 +10,9 @@
#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/mount.h>
+#if HAVE_BSD_MOUNT
#include <sys/mount.h>
+#endif
#include <signal.h>
#include <pwd.h>
#include <grp.h>
#include <utime.h>
#include <errno.h>
+
+#ifdef __Linux__
@@ -21,7 +23,6 @@
#include <linux/fs.h>
+#endif
+#ifdef __OpenBSD__
+#include <sys/param.h>
+#endif
+#include <sys/mount.h>
#endif
-
void
do_echo(int argc, const char ** argv)
@@ -511,8 +517,15 @@ do_mount(int argc, const char ** argv)
argc--;
argv++;
+
+#ifdef __OpenBSD__
+ type = "ffs";
+#endif
+
+#ifdef __Linux__
type = "ext2";
flags = MS_MGC_VAL;
+#endif
while ((argc > 0) && (**argv == '-'))
{
@@ -533,6 +546,21 @@ do_mount(int argc, const char ** argv)
argc--;
{
@@ -550,8 +551,19 @@ do_mount(int argc, const char ** argv)
case 'm':
flags |= MS_REMOUNT;
break;
+#ifdef __OpenBSD__
-#endif
+#elif HAVE_BSD_MOUNT
+ case 'r':
+ flags |= MNT_RDONLY;
+ break;
@ -51,30 +32,26 @@ $OpenBSD: patch-cmds_c,v 1.1.1.1 2001/07/06 13:33:48 lebel Exp $
+ case 's':
+ flags |= MNT_NOSUID;
+ break;
+
+ case 'e':
+ flags |= MNT_NOEXEC;
+ break;
+#endif
+
+#ifdef __Linux__
case 'r':
flags |= MS_RDONLY;
break;
@@ -540,6 +568,7 @@ do_mount(int argc, const char ** argv)
case 'm':
flags |= MS_REMOUNT;
break;
+#endif
default:
fprintf(stderr, "Unknown option\n");
@@ -555,16 +584,85 @@ do_mount(int argc, const char ** argv)
@@ -566,16 +578,83 @@ do_mount(int argc, const char ** argv)
return;
}
+#ifdef __OpenBSD__
- if (mount(argv[0], argv[1], type, flags, 0) < 0)
- perror("mount failed");
+#if HAVE_LINUX_MOUNT
+
+ if (mount(argv[0], argv[1], type, flags, 0) < 0)
+ perror("mount failed");
+
+#elif HAVE_BSD_MOUNT
+ {
+ struct ufs_args ufs;
+ struct adosfs_args adosfs;
@ -104,53 +81,47 @@ $OpenBSD: patch-cmds_c,v 1.1.1.1 2001/07/06 13:33:48 lebel Exp $
+ args = &msdosfs;
+ } else {
+ fprintf(stderr, "Unknown filesystem type: %s", type);
+ fprintf(stderr,
+ "Supported: ffs ufs adosfs cd9660 mfs msdos\n");
+ return;
+ }
+
+ fprintf(stderr, "type=%s, dev=%s, point=%s\n", type,
+ argv[0], argv[1]);
+ if (mount(type, argv[1], flags, args) < 0)
+ perror(argv[0]);
+ }
+#endif
+
+#ifdef __Linux__
if (mount(argv[0], argv[1], type, flags, 0) < 0)
perror("mount failed");
+#endif
+
}
void
do_umount(int argc, const char ** argv)
{
+ const char * str;
+ int flags = 0;
+
+#ifdef __OpenBSD__
+ argc--;
+ argv++;
+
+ while ((argc > 0) && (**argv == '-'))
+ {
+ argc--;
+ str = *argv++;
+
+ while (*++str) switch (*str)
+ {
+ case 'r':
+ flags = MNT_FORCE;
+ break;
+ }
+ }
+
+ if (unmount(argv[0], flags) < 0)
+ perror(argv[0]);
+#endif
+
+#ifdef __Linux__
+#if HAVE_LINUX_MOUNT
if (umount(argv[1]) < 0)
perror(argv[1]);
+#elif HAVE_BSD_MOUNT
+ {
+ const char * str;
+ int flags = 0;
+
+ for (argc--, argv++;
+ (argc > 0) && (**argv == '-');) {
+ argc--;
+ str = *argv++;
+
+ while (*++str) {
+ switch (*str)
+ {
+ case 'f':
+ flags = MNT_FORCE;
+ break;
+ }
+ }
+ }
+
+ if (unmount(argv[0], flags) < 0)
+ perror(argv[0]);
+ }
+#endif
}

View File

@ -1,26 +1,29 @@
$OpenBSD: patch-sash_1,v 1.1.1.1 2001/07/06 13:33:48 lebel Exp $
--- sash.1.orig Sat Oct 2 06:16:45 1999
+++ sash.1 Fri Jul 6 09:21:42 2001
@@ -359,9 +359,10 @@ LINES and COLS can be used to set the pa
$OpenBSD: patch-sash_1,v 1.2 2002/03/13 13:26:59 lebel Exp $
--- sash.1.orig Wed Mar 13 06:29:36 2002
+++ sash.1 Wed Mar 13 06:36:54 2002
@@ -369,10 +369,14 @@ LINES and COLS can be used to set the pa
.TP
.B -mount [-t type] [-r] [-m] devName dirName
Mount a filesystem on a directory name. The -t option specifies the
-type of filesystem being mounted, and defaults to "ext2".
+type of filesystem being mounted, and defaults to "ffs".
-type of filesystem being mounted, and defaults to "ext3" for Linux.
+type of filesystem being mounted, and defaults to "ext3" for Linux
+and "ffs" for BSD.
The -r option indicates to mount the filesystem read-only.
-The -m option indicates to remount an already mounted filesystem.
+The -s option indicates to mount the filesystem with nosuid.
+The -e option indicates to mount the filesystem with noexec.
The -m option indicates to remount an already mounted filesystem.
-The -r and -m options are only available on Linux.
+The -s option indicates to mount the filesystem nosuid.
+The -e option indicates to mount the filesystem noexec.
+The -r and -m options are only available on Linux. The -s and -e
+options are only availble on BSD.
.TP
.B -mv srcName ... destName
Moves one or more files from the
@@ -443,7 +444,8 @@ current umask value is printed. The mas
.B -umount fileName
@@ -455,6 +459,8 @@ current umask value is printed. The mas
Unmounts a file system. The file name can either be the device name
which is mounted, or else the directory name which the file system
-is mounted onto.
+is mounted onto. The -f option unmounts the filesystem even if it is
+being used.
is mounted onto.
+The -f option unmounts the filesystem even if it is being used.
+The -f option is only available on BSD.
.TP
.B unalias name
Remove the definition for the specified alias.

View File

@ -1,12 +1,28 @@
$OpenBSD: patch-sash_c,v 1.1.1.1 2001/07/06 13:33:48 lebel Exp $
--- sash.c.orig Sat Sep 25 00:03:29 1999
+++ sash.c Fri Jul 6 09:21:42 2001
@@ -312,7 +312,7 @@ static const CommandEntry commandEntryTa
{
"-umount", do_umount, 2, 2,
"Unmount a filesystem",
- "fileName"
+ "[-f] fileName"
$OpenBSD: patch-sash_c,v 1.2 2002/03/13 13:26:59 lebel Exp $
--- sash.c.orig Fri Mar 8 07:28:21 2002
+++ sash.c Wed Mar 13 07:11:35 2002
@@ -224,6 +224,8 @@ static const CommandEntry commandEntryTa
"Mount or remount a filesystem on a directory",
#if HAVE_LINUX_MOUNT
"[-t type] [-r] [-m] devName dirName"
+#elif HAVE_BSD_MOUNT
+ "[-t type] [-r] [-s] [-e] devName dirName"
#else
"[-t type] devName dirName"
#endif
@@ -314,9 +316,15 @@ static const CommandEntry commandEntryTa
},
{
+#if HAVE_BSD_MOUNT
+ "-umount", do_umount, 2, 3,
+ "Unmount a filesystem",
+ "[-f] fileName"
+#else
"-umount", do_umount, 2, 2,
"Unmount a filesystem",
"fileName"
+#endif
},
{

View File

@ -1,11 +1,23 @@
$OpenBSD: patch-sash_h,v 1.1.1.1 2001/07/06 13:33:48 lebel Exp $
--- sash.h.orig Sat Sep 25 00:03:29 1999
+++ sash.h Fri Jul 6 09:21:42 2001
@@ -16,7 +16,6 @@
$OpenBSD: patch-sash_h,v 1.2 2002/03/13 13:26:59 lebel Exp $
--- sash.h.orig Fri Mar 8 03:21:18 2002
+++ sash.h Wed Mar 13 06:53:22 2002
@@ -9,14 +9,18 @@
#ifndef SASH_H
#define SASH_H
-
+#if __OpenBSD__
+#include <sys/param.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <memory.h>
-#include <malloc.h>
+#if __Linux__
#include <malloc.h>
+#endif
#include <time.h>
#include <ctype.h>

View File

@ -1,11 +1,6 @@
SASH - Stand-alone shell with built-in commands.
The sash program is a stand-alone shell which is useful for recovering
from certain types of system failures. In particular, it was created
in order to cope with the problem of missing shared libraries or
important executable.
Flavors:
static - Build with statically linked binaries.
important executables.
WWW: ${HOMEPAGE}

View File

@ -1,5 +1,3 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2001/07/06 13:33:47 lebel Exp $
share/doc/sash/README
@comment $OpenBSD: PLIST,v 1.2 2002/03/13 13:26:59 lebel Exp $
bin/sash
man/man1/sash.1
@dirrm share/doc/sash