Hello community,
here is the log from the commit of package sash for openSUSE:Factory
checked in at Fri Feb 5 15:02:14 CET 2010.
--------
--- sash/sash.changes 2009-05-06 16:00:41.000000000 +0200
+++ /mounts/work_src_done/STABLE/sash/sash.changes 2010-02-04 13:35:28.000000000 +0100
@@ -1,0 +2,7 @@
+Thu Feb 4 11:33:56 CET 2010 - pgajdos@suse.cz
+
+- fixed marking lines in -ed [bnc#576598]
+- added sash-plus-patches
+ http://freshmeat.net/projects/sash-plus-patches/
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
New:
----
sash-3.7-ed-line-marking.diff
sash-plus-patches-3.7.diff
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ sash.spec ++++++
--- /var/tmp/diff_new_pack.8eUK6h/_old 2010-02-05 15:01:45.000000000 +0100
+++ /var/tmp/diff_new_pack.8eUK6h/_new 2010-02-05 15:01:45.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package sash (Version 3.7)
#
-# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -20,11 +20,11 @@
Name: sash
BuildRequires: ncurses-devel zlib-devel-static
-License: Any permissive
+License: PERMISSIVE-OSI-COMPLIANT
Group: System/Shells
AutoReqProv: on
Version: 3.7
-Release: 170
+Release: 171
Summary: A stand-alone shell with built-in commands
Source: sash-%{version}.tar.bz2
Url: http://www.tip.net.au/~dbell
@@ -34,6 +34,8 @@
Patch3: sash-%{version}-strip.diff
Patch4: sash-%{version}-fs.diff
Patch5: sash-3.7-shared_libc.patch
+Patch6: sash-%{version}-ed-line-marking.diff
+Patch7: sash-plus-patches-%{version}.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@@ -57,6 +59,8 @@
%patch3
%patch4
%patch5
+%patch6 -p1
+%patch7 -p1
%build
export RPM_OPT_FLAGS
++++++ sash-3.7-ed-line-marking.diff ++++++
Index: sash-3.7/cmd_ed.c
===================================================================
--- sash-3.7.orig/cmd_ed.c
+++ sash-3.7/cmd_ed.c
@@ -247,7 +247,7 @@ doCommands(void)
while (isBlank(*cp))
cp++;
- if ((*cp < 'a') || (*cp > 'a') || cp[1])
+ if ((*cp < 'a') || (*cp > 'z') || cp[1])
{
fprintf(stderr, "Bad mark name\n");
break;
++++++ sash-plus-patches-3.7.diff ++++++
Index: sash-3.7/Makefile
===================================================================
--- sash-3.7.orig/Makefile
+++ sash-3.7/Makefile
@@ -3,12 +3,18 @@
#
# The HAVE_GZIP definition adds the -gzip and -gunzip commands.
# The HAVE_LINUX_ATTR definition adds the -chattr and -lsattr commands.
+# The HAVE_LINUX_CHROOT definition adds the -chroot command.
+# The HAVE_LINUX_PIVOT definition adds the -pivot_root command.
+# The HAVE_LINUX_LOSETUP definition adds the -losetup command.
# The HAVE_LINUX_MOUNT definition makes -mount and -umount work on Linux.
# The HAVE_BSD_MOUNT definition makes -mount and -umount work on BSD.
# The MOUNT_TYPE definition sets the default file system type for -mount.
#
HAVE_GZIP = 1
HAVE_LINUX_ATTR = 1
+HAVE_LINUX_CHROOT = 1
+HAVE_LINUX_LOSETUP = 1
+HAVE_LINUX_PIVOT = 1
HAVE_LINUX_MOUNT = 1
HAVE_BSD_MOUNT = 0
MOUNT_TYPE = '"ext3"'
@@ -17,6 +23,9 @@ MOUNT_TYPE = '"ext3"'
CFLAGS = -Wall -Wmissing-prototypes $(RPM_OPT_FLAGS) \
-DHAVE_GZIP=$(HAVE_GZIP) \
-DHAVE_LINUX_ATTR=$(HAVE_LINUX_ATTR) \
+ -DHAVE_LINUX_CHROOT=$(HAVE_LINUX_CHROOT) \
+ -DHAVE_LINUX_LOSETUP=$(HAVE_LINUX_LOSETUP) \
+ -DHAVE_LINUX_PIVOT=$(HAVE_LINUX_PIVOT) \
-DHAVE_LINUX_MOUNT=$(HAVE_LINUX_MOUNT) \
-DHAVE_BSD_MOUNT=$(HAVE_BSD_MOUNT) \
-DMOUNT_TYPE=$(MOUNT_TYPE)
Index: sash-3.7/cmds.c
===================================================================
--- sash-3.7.orig/cmds.c
+++ sash-3.7/cmds.c
@@ -24,6 +24,16 @@
#include
#endif
+/* Need to tell loop.h what the actual dev_t type is. */
+#undef dev_t
+#if defined(__alpha) || (defined(__sparc__) && defined(__arch64__))
+#define dev_t unsigned int
+#else
+#define dev_t unsigned short
+#endif
+#include
+#undef dev_t
+#define dev_t dev_t
void
do_echo(int argc, const char ** argv)
@@ -150,6 +160,28 @@ do_mknod(int argc, const char ** argv)
}
+#if HAVE_LINUX_PIVOT
+
+void
+do_pivot_root(int argc, const char ** argv)
+{
+ if (pivot_root(argv[1], argv[2]) < 0)
+ perror("");
+}
+
+#endif
+
+#if HAVE_LINUX_CHROOT
+
+void
+do_chroot(int argc, const char ** argv)
+{
+ if (chroot(argv[1]) < 0)
+ perror("");
+}
+
+#endif
+
void
do_rmdir(int argc, const char ** argv)
{
@@ -1256,4 +1288,62 @@ do_where(int argc, const char ** argv)
printf("Program \"%s\" not found in PATH\n", program);
}
+#if HAVE_LINUX_LOSETUP
+
+void
+do_losetup(int argc, const char ** argv)
+{
+ int loopfd;
+ int targfd;
+ struct loop_info loopInfo;
+
+ if (!strcmp(argv[1], "-d")) {
+ loopfd = open(argv[2], O_RDWR);
+ if (loopfd < 0) {
+ fprintf(stderr, "Error opening %s: %s\n", argv[2],
+ strerror(errno));
+ return;
+ }
+
+ if (ioctl(loopfd, LOOP_CLR_FD, 0)) {
+ fprintf(stderr, "Error unassociating device: %s\n",
+ strerror(errno));
+ return;
+ }
+ }
+
+ loopfd = open(argv[1], O_RDWR);
+ if (loopfd < 0) {
+ fprintf(stderr, "Error opening %s: %s\n", argv[1],
+ strerror(errno));
+ return;
+ }
+
+ targfd = open(argv[2], O_RDWR);
+ if (targfd < 0) {
+ fprintf(stderr, "Error opening %s: %s\n", argv[2],
+ strerror(errno));
+ return;
+ }
+
+ if (ioctl(loopfd, LOOP_SET_FD, targfd)) {
+ fprintf(stderr, "Error setting up loopback device: %s\n",
+ strerror(errno));
+ return;
+ }
+
+ memset(&loopInfo, 0, sizeof(loopInfo));
+ strcpy(loopInfo.lo_name, argv[2]);
+
+ if (ioctl(loopfd, LOOP_SET_STATUS, &loopInfo)) {
+ fprintf(stderr, "Error setting up loopback device: %s\n",
+ strerror(errno));
+ return;
+ }
+
+ return;
+}
+
+#endif
+
/* END CODE */
Index: sash-3.7/sash.1
===================================================================
--- sash-3.7.orig/sash.1
+++ sash-3.7/sash.1
@@ -22,11 +22,11 @@ is that many of the standard system comm
These built-in commands are:
.PP
.nf
- -ar, -chattr, -chgrp, -chmod, -chown, -cmp, -cp,
- -dd, -echo, -ed, -grep, -file, -find, -gunzip,
- -gzip, -kill, -ln, -ls, -lsattr, -mkdir, -mknod,
- -more, -mount, -mv, -printenv, -pwd, -rm, -rmdir,
- -sum, -sync, -tar, -touch, -umount, -where
+ -ar, -chattr, -chgrp, -chmod, -chown, -chroot, -cmp,
+ -cp, -dd, -echo, -ed, -grep, -file, -find, -gunzip,
+ -gzip, -kill, -losetup, -ln, -ls, -lsattr, -mkdir,
+ -mknod, -more, -mount, -mv, -pivot_root, -printenv, -pwd,
+ -rm, -rmdir, -sum, -sync, -tar, -touch, -umount, -where
.fi
.PP
These commands are generally similar to the standard programs with similar
@@ -138,6 +138,13 @@ Change the owner id for the specified li
can
either be a user name, or a decimal value.
.TP
+.B -chroot path
+Changes the root directory to that specified in
+.I path.
+This directory
+will be used for path names beginning with /. The root directory is
+inherited by all children of the current process.
+.TP
.B -cmp fileName1 fileName2
Determines whether or not the specified file names have identical data.
This says that the files are links to each other, are different sizes,
@@ -312,6 +319,20 @@ is a numeric value, or one of the specia
QUIT, KILL, TERM, STOP, CONT, USR1 or USR2.
If no signal is specified then SIGTERM is used.
.TP
+.B -losetup [-d] loopDev [file]
+Associates loopback devices with files on the system. If
+.I -d
+is not given,
+the loopback device
+.I loopDev
+is associated with
+.I file.
+If
+.I -d
+is given,
+.I loopDev
+is unassociated with the file it's currently configured for.
+.TP
.B -ln [-s] srcName ... destName
Links one or more files from the
.I srcName
@@ -388,6 +409,13 @@ same names as the srcNames. Renames are
this fails because of the files being on different filesystems,
then copies and deletes are done instead.
.TP
+.B -pivot_root newRoot putOld
+Moves the root file system of the current process to the directory
+.I putOld
+and makes
+.I newRoot
+the new root file system of the current process.
+.TP
.B -printenv [name]
If
.I name
Index: sash-3.7/sash.c
===================================================================
--- sash-3.7.orig/sash.c
+++ sash-3.7/sash.c
@@ -18,7 +18,7 @@
#include
#include
-static const char * const version = "3.7";
+static const char * const version = "3.7-fb";
/*
@@ -110,6 +110,14 @@ static const CommandEntry commandEntryTa
"srcName ... destName"
},
+#ifdef HAVE_LINUX_CHROOT
+ {
+ "-chroot", do_chroot, 2, 2,
+ "change root file system",
+ "new_root_dir"
+ },
+#endif
+
{
"-dd", do_dd, 3, INFINITE_ARGS,
"Copy data between two files",
@@ -184,6 +192,14 @@ static const CommandEntry commandEntryTa
"[-sig] pid ..."
},
+#ifdef HAVE_LINUX_LOSETUP
+ {
+ "-losetup", do_losetup, 3, 3,
+ "Associate a loopback device with a file",
+ "[-d] device\n -losetup device filename"
+ },
+#endif
+
{
"-ln", do_ln, 3, INFINITE_ARGS,
"Link one fileName to another",
@@ -240,6 +256,14 @@ static const CommandEntry commandEntryTa
"srcName ... destName"
},
+#ifdef HAVE_LINUX_PIVOT
+ {
+ "-pivot_root", do_pivot_root, 3, 3,
+ "pivot the root file system",
+ "new_dir old_dir"
+ },
+#endif
+
{
"-printenv", do_printenv, 1, 2,
"Print environment variables",
@@ -392,6 +416,7 @@ static void childProcess(const char * cm
static void showPrompt(void);
static void usage(void);
static Alias * findAlias(const char * name);
+static void expandVariable(char * name);
/*
@@ -711,6 +736,11 @@ command(const char * cmd)
}
/*
+ * Expand simple environment variables
+ */
+ while (strstr(cmd, "$(")) expandVariable((char *)cmd);
+
+ /*
* Now look for the command in the builtin table, and execute
* the command if found.
*/
@@ -1296,4 +1326,29 @@ usage(void)
exit(1);
}
+/*
+ * Expand one environment variable: Syntax $(VAR)
+ */
+static void
+expandVariable(char * cmd)
+{
+ char tmp[CMD_LEN];
+ char *cp;
+ char *ep;
+
+ strcpy(tmp, cmd);
+ cp = strstr(tmp, "$(");
+ if (cp) {
+ *cp++ = '\0';
+ strcpy(cmd, tmp);
+ ep = ++cp;
+ while (*ep && (*ep != ')')) ep++;
+ if (*ep == ')') *ep++ = '\0';
+ cp = getenv(cp);
+ if (cp) strcat(cmd, cp);
+ strcat(cmd, ep);
+ }
+ return;
+}
+
/* END CODE */
Index: sash-3.7/sash.h
===================================================================
--- sash-3.7.orig/sash.h
+++ sash-3.7/sash.h
@@ -111,6 +111,18 @@ extern void do_lsattr(int argc, const ch
extern void do_chattr(int argc, const char ** argv);
#endif
+#if HAVE_LINUX_CHROOT
+extern void do_chroot(int argc, const char ** argv);
+#endif
+
+#if HAVE_LINUX_LOSETUP
+extern void do_losetup(int argc, const char ** argv);
+#endif
+
+#if HAVE_LINUX_PIVOT
+extern void do_pivot_root(int argc, const char ** argv);
+extern int pivot_root(const char *new_root, const char *put_old);
+#endif
/*
* Global utility routines.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org