diff options
-rw-r--r-- | configure.ac | 21 | ||||
-rw-r--r-- | debian/changelog | 63 | ||||
-rw-r--r-- | debian/control | 1 | ||||
-rw-r--r-- | debian/dash.postinst | 14 | ||||
-rw-r--r-- | debian/gbp.conf | 3 | ||||
-rwxr-xr-x | debian/rules | 14 | ||||
-rw-r--r-- | src/eval.c | 12 | ||||
-rw-r--r-- | src/input.c | 1 | ||||
-rw-r--r-- | src/jobs.c | 18 | ||||
-rw-r--r-- | src/parser.c | 5 | ||||
-rw-r--r-- | src/parser.h | 1 |
11 files changed, 116 insertions, 37 deletions
diff --git a/configure.ac b/configure.ac index e676e7d..1bf5f58 100644 --- a/configure.ac +++ b/configure.ac @@ -41,8 +41,7 @@ fi AC_ARG_ENABLE(fnmatch, AS_HELP_STRING(--disable-fnmatch, \ [Do not use fnmatch(3) from libc])) -AC_ARG_ENABLE(glob, AS_HELP_STRING(--disable-glob, \ - [Do not use glob(3) from libc])) +AC_ARG_ENABLE(glob, AS_HELP_STRING(--enable-glob, [Use glob(3) from libc])) dnl Checks for libraries. @@ -130,7 +129,7 @@ if test "$enable_fnmatch" != no; then AC_CHECK_FUNCS(fnmatch, use_fnmatch=yes) fi -if test "$use_fnmatch" = yes && test "$enable_glob" != no; then +if test "$use_fnmatch" = yes && test "$enable_glob" = yes; then AC_CHECK_FUNCS(glob) fi @@ -143,15 +142,12 @@ if test "$ac_cv_func_signal" != yes; then fi dnl Check for stat64 (dietlibc/klibc). -AC_CHECK_FUNC(stat64,, [ +AC_CHECK_DECL(stat64, AC_CHECK_FUNC(stat64)) +if test "$ac_cv_func_stat64" != yes; then AC_DEFINE(fstat64, fstat, [64-bit operations are the same as 32-bit]) AC_DEFINE(lstat64, lstat, [64-bit operations are the same as 32-bit]) AC_DEFINE(stat64, stat, [64-bit operations are the same as 32-bit]) - AC_DEFINE(readdir64, readdir, - [64-bit operations are the same as 32-bit]) - AC_DEFINE(dirent64, dirent, - [64-bit operations are the same as 32-bit]) -]) +fi AC_CHECK_FUNC(glob64,, [ AC_DEFINE(glob64_t, glob_t, [64-bit operations are the same as 32-bit]) @@ -163,6 +159,10 @@ AC_CHECK_FUNC(glob64,, [ dnl OS X apparently has stat64 but not open64. AC_CHECK_FUNC(open64,, [ AC_DEFINE(open64, open, [64-bit operations are the same as 32-bit]) + AC_DEFINE(readdir64, readdir, + [64-bit operations are the same as 32-bit]) + AC_DEFINE(dirent64, dirent, + [64-bit operations are the same as 32-bit]) ]) dnl Check if struct stat has st_mtim. @@ -185,7 +185,8 @@ if test "$with_libedit" = "yes"; then AC_CHECK_LIB(edit, history_init, [ AC_CHECK_HEADER([histedit.h], [use_libedit="yes"], AC_MSG_ERROR( - [Can't find required header files.]))]) + [Can't find required header files.]))], [ + AC_MSG_ERROR([Can't find libedit.])]) fi if test "$use_libedit" != "yes"; then AC_DEFINE([SMALL], 1, [Define if you build with -DSMALL]) diff --git a/debian/changelog b/debian/changelog index 1c08f25..6af99ad 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,66 @@ +dash (0.5.11+git20210903+057cd650a4ed-2exp1) experimental; urgency=medium + + * Upload to experimental + + -- Andrej Shadura <andrewsh@debian.org> Wed, 03 Nov 2021 11:52:29 +0100 + +dash (0.5.11+git20210903+057cd650a4ed-2) unstable; urgency=medium + + * Re-enable LINENO support (Closes: #842242)/ + * Enable libedit (Closes: #524839, #561663). + + -- Andrej Shadura <andrewsh@debian.org> Tue, 02 Nov 2021 12:58:31 +0100 + +dash (0.5.11+git20210903+057cd650a4ed-1) unstable; urgency=medium + + * New upstream snapshot. + + -- Andrej Shadura <andrewsh@debian.org> Fri, 29 Oct 2021 09:21:09 +0200 + +dash (0.5.11+git20210120+802ebd4-2) unstable; urgency=medium + + [ Johannes Schauer Marin Rodrigues ] + * Support DPKG_ROOT. + + -- Andrej Shadura <andrewsh@debian.org> Sat, 23 Oct 2021 11:44:50 +0200 + +dash (0.5.11+git20210120+802ebd4-1) unstable; urgency=medium + + * New upstream snapshot. + * Drop a patch applied upstream. + + -- Andrej Shadura <andrewsh@debian.org> Thu, 04 Mar 2021 10:22:32 +0100 + +dash (0.5.11+git20200708+dd9ef66-5) unstable; urgency=medium + + * Actually set PATH_MAX for Hurd. + + -- Andrej Shadura <andrewsh@debian.org> Thu, 10 Dec 2020 14:23:19 +0100 + +dash (0.5.11+git20200708+dd9ef66-4) unstable; urgency=medium + + * Define PATH_MAX=4096 on Hurd. + + -- Andrej Shadura <andrewsh@debian.org> Thu, 10 Dec 2020 10:55:18 +0100 + +dash (0.5.11+git20200708+dd9ef66-3) unstable; urgency=medium + + [ Johannes 'josch' Schauer ] + * Don’t rely on /usr/share/man/man1/ existing (Closes: #974825). + + [ Andrej Shadura ] + * Disable libc glob support (Closes: #974900, #976685). + * Apply upstream patch: + - jobs: Only block in waitcmd on first run (Closes: #974705, #975010). + + -- Andrej Shadura <andrewsh@debian.org> Thu, 10 Dec 2020 10:07:56 +0100 + +dash (0.5.11+git20200708+dd9ef66-2) unstable; urgency=medium + + * Upload to unstable. + + -- Andrej Shadura <andrewsh@debian.org> Thu, 12 Nov 2020 08:58:00 +0100 + dash (0.5.11+git20200708+dd9ef66-1) experimental; urgency=medium * New upstream snapshot diff --git a/debian/control b/debian/control index 64318ac..a9578b2 100644 --- a/debian/control +++ b/debian/control @@ -6,6 +6,7 @@ Uploaders: Gerrit Pape <pape@smarden.org> Build-Depends: debhelper-compat (= 12), dpkg-dev (>= 1.16.1), + libedit-dev, po-debconf Standards-Version: 4.2.1 Homepage: http://gondor.apana.org.au/~herbert/dash/ diff --git a/debian/dash.postinst b/debian/dash.postinst index 958b6ed..cc6e1fa 100644 --- a/debian/dash.postinst +++ b/debian/dash.postinst @@ -3,8 +3,8 @@ set -e # $1: dfile, $2: link target, $3: distrib replace_with_link() { - dfile=$1; ltarget=$2; distrib=$3 - temp=$dfile.tmp + dfile="$DPKG_ROOT$1"; ltarget=$2; distrib="$DPKG_ROOT$3" + temp="$dfile.tmp" # Safely create a symlink to $ltarget at $dfile, first # making a backup of $dfile (the file being diverted) # in $distrib (if specified). @@ -47,8 +47,8 @@ claim_binsh() { dpkg-divert --package bash --no-rename --remove $dfile dpkg-divert --package dash --no-rename --divert $distrib --add $dfile # remove the old equivalent of $distrib, if it existed. - if [ -n "$truename" ]; then - rm -f "$truename" + if [ -n "$DPKG_ROOT$truename" ]; then + rm -f "$DPKG_ROOT$truename" fi replace_with_link $dfile $ltarget $distrib } @@ -132,8 +132,10 @@ if [ $debconf ]; then db_get dash/sh if [ "$RET" = true ]; then claim_binsh /bin/sh dash - claim_binsh /usr/share/man/man1/sh.1.gz dash.1.gz \ - /usr/share/man/man1/sh.distrib.1.gz + if [ -d "$DPKG_ROOT/usr/share/man/man1/" ]; then + claim_binsh /usr/share/man/man1/sh.1.gz dash.1.gz \ + /usr/share/man/man1/sh.distrib.1.gz + fi else unclaim_binsh /bin/sh dash unclaim_binsh /usr/share/man/man1/sh.1.gz dash.1.gz \ diff --git a/debian/gbp.conf b/debian/gbp.conf index d6b9ab0..e3460bd 100644 --- a/debian/gbp.conf +++ b/debian/gbp.conf @@ -1,3 +1,4 @@ [DEFAULT] -debian-branch=debian/master +debian-branch=debian/unstable upstream-branch=upstream/latest +upstream-vcs-tag=v%(version)s diff --git a/debian/rules b/debian/rules index 20fb24d..2717c4f 100755 --- a/debian/rules +++ b/debian/rules @@ -5,9 +5,14 @@ DEB_BUILD_MAINT_OPTIONS =hardening=+all -# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/* +include /usr/share/dpkg/architecture.mk + +ifeq ($(DEB_HOST_ARCH_OS),hurd) +DEB_CPPFLAGS_MAINT_APPEND = -DPATH_MAX=4096 +endif + DPKG_EXPORT_BUILDFLAGS = 1 -include /usr/share/dpkg/default.mk +include /usr/share/dpkg/buildflags.mk ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS))) CC =diet -v -Os gcc @@ -20,7 +25,10 @@ endif dh $@ override_dh_auto_configure: - dh_auto_configure -- --enable-fnmatch --disable-lineno + dh_auto_configure -- \ + --enable-fnmatch \ + --with-libedit \ + --disable-glob override_dh_auto_build: po-templates dh_auto_build @@ -253,18 +253,10 @@ evaltree(union node *n, int flags) popredir(0); goto setstatus; case NCMD: -#ifdef notyet - if (eflag && !(flags & EV_TESTED)) - checkexit = ~0; - status = evalcommand(n, flags, (struct backcmd *)NULL); - goto setstatus; -#else evalfn = evalcommand; checkexit: - if (eflag && !(flags & EV_TESTED)) - checkexit = ~0; + checkexit = ~flags & EV_TESTED; goto calleval; -#endif case NFOR: evalfn = evalfor; goto calleval; @@ -324,7 +316,7 @@ setstatus: out: dotrap(); - if (checkexit & status) + if (eflag && checkexit && status) goto exexit; if (flags & EV_EXIT) { diff --git a/src/input.c b/src/input.c index 4987732..d7c101b 100644 --- a/src/input.c +++ b/src/input.c @@ -87,6 +87,7 @@ INIT { RESET { /* clear input buffer */ basepf.lleft = basepf.nleft = 0; + basepf.unget = 0; popallfiles(); } @@ -81,6 +81,7 @@ #define DOWAIT_NONBLOCK 0 #define DOWAIT_BLOCK 1 #define DOWAIT_WAITCMD 2 +#define DOWAIT_WAITCMD_ALL 4 /* array of jobs */ static struct job *jobtab; @@ -615,7 +616,7 @@ waitcmd(int argc, char **argv) jp->waited = 1; jp = jp->prev_job; } - if (!dowait(DOWAIT_WAITCMD, 0)) + if (!dowait(DOWAIT_WAITCMD_ALL, 0)) goto sigout; } } @@ -891,10 +892,8 @@ static void forkchild(struct job *jp, union node *n, int mode) } } if (!oldlvl && iflag) { - if (mode != FORK_BG) { - setsignal(SIGINT); - setsignal(SIGQUIT); - } + setsignal(SIGINT); + setsignal(SIGQUIT); setsignal(SIGTERM); } @@ -1138,6 +1137,7 @@ static int dowait(int block, struct job *jp) pid = waitone(block, jp); rpid &= !!pid; + block &= ~DOWAIT_WAITCMD_ALL; if (!pid || (jp && jp->state != JOBRUNNING)) block = DOWAIT_NONBLOCK; } while (pid >= 0); @@ -1510,7 +1510,13 @@ showpipe(struct job *jp, struct output *out) STATIC void xtcsetpgrp(int fd, pid_t pgrp) { - if (tcsetpgrp(fd, pgrp)) + int err; + + sigblockall(NULL); + err = tcsetpgrp(fd, pgrp); + sigclearmask(); + + if (err) sh_error("Cannot set tty process group (%s)", strerror(errno)); } #endif diff --git a/src/parser.c b/src/parser.c index 3c80d17..13c2df5 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1252,7 +1252,8 @@ varname: do { STPUTC(c, out); c = pgetc_eatbnl(); - } while (!subtype && is_digit(c)); + } while ((subtype <= 0 || subtype >= VSLENGTH) && + is_digit(c)); } else if (c != '}') { int cc = c; @@ -1312,6 +1313,8 @@ varname: break; } } else { + if (subtype == VSLENGTH && c != '}') + subtype = 0; badsub: pungetc(); } diff --git a/src/parser.h b/src/parser.h index 524ac1c..7d2749b 100644 --- a/src/parser.h +++ b/src/parser.h @@ -62,6 +62,7 @@ #define VSTRIMLEFT 0x8 /* ${var#pattern} */ #define VSTRIMLEFTMAX 0x9 /* ${var##pattern} */ #define VSLENGTH 0xa /* ${#var} */ +/* VSLENGTH must come last. */ /* values of checkkwd variable */ #define CHKALIAS 0x1 |