--- dash-0.5.6.1.orig/debian/README.Debian.diet +++ dash-0.5.6.1/debian/README.Debian.diet @@ -0,0 +1,15 @@ +Building with the diet libc +--------------------------- + +This package optionally can be built with the diet libc instead of the +glibc to provide small statically linked programs. The resulting package +has no dependency on any other package. + +To use the diet libc, make sure the latest versions of the dietlibc-dev +package is installed, and set DEB_BUILD_OPTIONS=diet in the environment +when building the package, e.g.: + + # apt-get install dietlibc-dev + $ DEB_BUILD_OPTIONS=diet fakeroot apt-get source -b dash + + -- Gerrit Pape , Wed, 23 Jun 2004 05:11:20 +0000 --- dash-0.5.6.1.orig/debian/ash.postinst +++ dash-0.5.6.1/debian/ash.postinst @@ -0,0 +1,52 @@ +#!/bin/sh +# +# post-install script for the Debian GNU/Linux ash package +# +# $Id: ash.postinst,v 1.9 2002/10/26 11:27:48 herbert Exp $ + +set -e + +check_divert() { + div=$(dpkg-divert --list $1) + distrib=${3:-$1.distrib} + case $div in + '' | *by\ dash) + ;; + *by\ ash) + dst=${div% by ash} + dst=${dst##* to } + + # Work around dpkg-divert bug. + if [ -e "$dst" ]; then + mv "$dst" "$dst.ash-tmp" + fi + dpkg-divert --package ash --remove $1 + if [ -e "$dst.ash-tmp" ]; then + mv "$dst.ash-tmp" "$dst" + fi + + dpkg-divert --package dash --divert $distrib --add $1 + if [ "$dst" != $distrib ] && [ -e "$dst" ]; then + mv "$dst" $distrib + fi + ln -sf $2 $1 + ;; + *) + d=${1%/*} + if + [ -h $1 ] && [ -f $1 ] && [ -f $d/$4 ] && + cmp $1 $d/$4 + then + ln -sf $2 $1 + fi + ;; + esac +} + +dcv='dpkg --compare-versions' + +if [ "$1" = configure ] && [ -n "$2" ] && $dcv "$2" lt 0.4.3; then + check_divert /bin/sh dash '' ash + check_divert /usr/share/man/man1/sh.1.gz dash.1.gz \ + /usr/share/man/man1/sh.distrib.1.gz ash.1.gz +fi --- dash-0.5.6.1.orig/debian/ash.postrm +++ dash-0.5.6.1/debian/ash.postrm @@ -0,0 +1,9 @@ +#!/bin/sh +# $Id: ash.postrm,v 1.1 2003/11/21 08:47:16 herbert Exp $ + +set -e + +if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule + db_purge +fi --- dash-0.5.6.1.orig/debian/changelog +++ dash-0.5.6.1/debian/changelog @@ -0,0 +1,1749 @@ +dash (0.5.6.1-1~exp2) experimental; urgency=low + + * debian/diff/: + - 0036-BUILTIN-Fix-corruption-of-reads...diff: remove; fixed + upstream. + - 0037-EVAL-Make-.-dev-null-return-.diff: remove; applied + upstream. + - 0034-SHELL-print-n-upon...diff: rename to 0045-*. + - 0035-PARSER-Remove-backslash...diff: rename to 0046-*. + - 0034...0044: new from the upstream "master" branch. + - 0042-EXPAND-Free-IFS-state...diff: new from upstream: + do not let parameter expansion in here documents corrupt word + splitting state (thx Aurelien Jarno; closes: #618023). + + -- Jonathan Nieder Thu, 24 Mar 2011 17:24:05 -0500 + +dash (0.5.6.1-1~exp1) experimental; urgency=low + + * new upstream release. + * add preliminary LINENO support (closes: #540685, reopens: + #582952). + * fix corruption of redirections with byte 0x81 (closes: + #532302). + * honor tab as IFS whitespace in read (closes: #429251, + #607174). + * debian/diff/: + - remove patches applied upstream (0001-0016, 0020). + - 0021--INPUT-exit-127...diff: remove; patch is faulty + (reopens: #548687). + - 0022--EVAL-with-set-e-exit: remove; fixed upstream. + - 0019--SHELL-print-n-upon...diff: rename to 0034-*. + - 0001...0033: new from the upstream "master" branch. + - 0035-PARSER-Remove-backslash-before...diff: new from the + mailing list: remove backslashes used to escape closing + braces in ${...} expressions (thx Jilles Tjoelker). + - 0036-BUILTIN-Fix-corruption-of-reads...diff: new from the + mailing list: do not corrupt input by removing CTLESC bytes + ('\x81') in readcmd (thx Alexey Gladkov). + - 0037-EVAL-Make-.-dev-null-return-0.diff: new from the + mailing list: dotcmd should yield status 0 when no command + is executed (thx Tim Allen, closes: #615922). + * debian/watch: document upstream source location. + + -- Jonathan Nieder Sun, 06 Mar 2011 21:11:25 -0600 + +dash (0.5.5.1-7.4) unstable; urgency=low + + * Non-maintainer upload. + * dash.preinst: Do not error out if /bin/sh or its manpage is + not already present (thx Brian Potkin; closes: #606756). + * dash.postinst: Cope with missing files. Atomically replace + /bin/sh and its manpage rather than removing and re-creating them + (thx Adam D. Barratt). + + -- Jonathan Nieder Tue, 14 Dec 2010 01:33:42 -0600 + +dash (0.5.5.1-7.3) unstable; urgency=medium + + * Non-maintainer upload. + * Modify the preinst to use /bin/bash rather than /bin/sh to avoid having + to rely on /bin/sh being available during unpack. (Closes: #546528) + * Adapt preinst diversion handling to be idempotent; thanks to + Jonathan Nieder. + + -- Adam D. Barratt Wed, 17 Nov 2010 21:41:30 +0000 + +dash (0.5.5.1-7.2) unstable; urgency=low + + * Non-maintainer upload to correct previous NMU. + * Drop dependency on debconf as that change was not agreed + with the maintainer when the NMU was prepared. + + -- Christian Perrier Wed, 27 Oct 2010 08:10:28 +0200 + +dash (0.5.5.1-7.1) unstable; urgency=low + + * Non-maintainer upload with maintainer approval. + * Add "debconf | debconf-2.0" to dependencies as this package is + using debconf + * Explicitly re-include the text of the BSD licence as + /usr/share/common-licenses/BSD could be dropped in the future + because of minor wording changes in the different version of + the BSD licence text + * Fix pending l10n issues. Debconf translations: + - Czech (Miroslav Kure). Closes: #598331 + - Finnish (Esko Arajärvi). Closes: #600518 + + -- Christian Perrier Mon, 18 Oct 2010 09:39:14 +0200 + +dash (0.5.5.1-7) unstable; urgency=low + + [ Raphael Geissert ] + * Re-add code to allow taking over bash's diversion (Closes: #82554). + + [ Gerrit Pape ] + * debian/dash.README.source: new; document how to use the Debian + package source. + * debian/po/pt_BR.po: [INTL:pt_BR] Brazilian Portuguese debconf + templates (thx Adriano Rafael Gomes; closes: #582973). + * debian/po/da.po: [INTL:da] Danish translation of the debconf + templates Dash (thx Joe Dalton; closes: #584484). + * debian/implicit: update to revision 60d9070. + + -- Gerrit Pape Thu, 10 Jun 2010 01:56:32 +0000 + +dash (0.5.5.1-6) unstable; urgency=high + + * debian/diff/0001-JOBS-Fix-dowait-signal-race.diff, + debian/diff/0002-SIGNAL-Remove-EXSIG.diff: remove (closes: #581425). + * debian/diff/: remove patches with reverts (0009, 0013, 0015, 0018, + 0019). + * debian/diff/0010-SHELL-Add-preliminary-LINENO-support.diff: remove + (re-opens: #540685, closes: #582952). + * debian/diff/0015--BUILTIN-Use-TMPDIR-in-mkbuiltins.diff, + debian/diff/0016--BUILTIN-Make-trap-signal-name-number-...diff, + debian/diff/0017--JOBS-Fix-for-job-control-off-warning.diff: new; + cherry-picked from upstream git. + * debian/po/pt_BR.po: [INTL:pt_BR] Brazilian Portuguese debconf + templates (thx Adriano Rafael Gomes; closes: #582973). + + -- Gerrit Pape Wed, 26 May 2010 12:25:47 +0000 + +dash (0.5.5.1-5) unstable; urgency=low + + * debian/diff/0029-Revert-BUILTIN-Fix-off-by-one-recordregion-...diff, + debian/diff/0030-Revert-BUILTIN-Avoid-compiler-warnings-on-...diff, + debian/diff/0031-Revert-BUILTIN-Fix-NUL-termination-in-readcmd.diff, + debian/diff/0032-Revert-BUILTIN-Honor-tab-as-IFS-whitespace-...diff: + new; revert "Honor tab as IFS whitespace when splitting fields in + readcmd" fix (re-opens: #429251, closes: #581351). + + -- Gerrit Pape Thu, 13 May 2010 23:06:46 +0000 + +dash (0.5.5.1-4) unstable; urgency=low + + * debian/diff/0002--SHELL-print-n-upon-EOF-CTRL-D-when-run-...diff: + rename to 0023-*.diff. + * debian/diff/0001--MAN-rename-sh-to-dash-update-DESCRIPTION-...diff: + remove; applied upstream. + * debian/diff/0001-*...0022-*.diff: new from upstream git. + * debian/diff/0010-*.diff: Add preliminary LINENO support (closes: + #540685). + * debian/diff/0017-*.diff: Fix syntax array size (closes: #548493). + * debian/diff/0009-*.diff: Honor tab as IFS whitespace when + splitting fields in readcmd (closes: #429251). + * debian/diff/0024-INPUT-exit-127-if-command_file-is-given-...diff: + new; exit 127 if command_file is given but does not exist (closes: + #548743). + * debian/diff/0025-INPUT-exit-127-if-command_file-is-given-...diff: + new; exit 127 if command_file is given but is a directory (closes: + #548687). + * debian/diff/0026-EVAL-with-set-e-exit-the-shell-if-a-...diff: new; + with set -e exit the shell if a subshell exits non-zero (closes: + #514863). + * debian/diff/0027-EVAL-don-t-clear-eflag-when-forking-subshell.diff: + new; don't clear eflag when forking subshell (closes: #514863). + * debian/po/ja.po: [INTL:ja] Update po-debconf template translation + (thx Hideki Yamane; closes: #564483). + * debian/po/bg.po: [I18N:bg] Updated Bulgarian debconf translation + (thx Damyan Ivanov; closes: #562836). + * debian/dash.preinst: remove superfluous code (closes: #557755). + * debian/control: Standards-Version: 3.8.4.0. + * debian/po/vi.po: [INTL:vi] Vietnamese debconf templates translation + update (thx Clytie Siddall; closes: #577156). + * debian/po/eu.po: [l10n:eu] dash 0.5.5.1-3.1: updated Basque + translation (thx dooteo; closes: #577506). + * debian/po/pt.po: [INTL:pt] Updated Portuguese translation for + debconf messages (thx Traduz - Portuguese Translation Team; closes: + #578104). + * debian/diff/0028-EVAL-Fix-command-crash.diff: new; Fix command -- + crash (closes: #579543). + + [ Raphael Geissert ] + * Document "/bin/sh -> dash" NMU changes + * Pass package name to dpkg-divert when removing diversion + * Simplify prerm by making dpkg-divert do most of the work + * Pass --package name to dpkg-divert call to replace ash's diversion + * Quoting style changes + * Let the postinst script abort if there was already a diversion in + place + * Pass --package name to dpkg-divert call to remove ash's diversion + * Add watch file + + -- Gerrit Pape Mon, 10 May 2010 23:12:45 +0000 + +dash (0.5.5.1-3) unstable; urgency=low + + * Thanks Luk Claes for NUMs (closes: #538682). + * debian/NEWS: rename to debian/dash.NEWS.Debian. + * debian/rules: don't explicitely install dash's NEWS file, + debian/implicit takes care of that. + * debian/dash.NEWS.Debian: when upgrading existing installations, + the system shell will not be changed automatically (closes: + #539363). + * debian/control: update long description (thx Justin B Rye; closes: + #546458). + * debian/po/sv.po: [INTL:sv] Swedish strings for dash debconf (thx + Martin Bagge; closes: #539070). + * debian/po/ru.po: [INTL:ru] Russian debconf templates translation + update (thx Yuri Kozlov; closes: #539189). + * debian/po/fr.po: fr.po: French program translation (thx julien + patriarca; closes: #539630). + * debian/po/de.po: [INTL:de] updated German debconf translation (thx + Helge Kreutzmann; closes: #540221). + * debian/po/it.po: [INTL:it] Italian translation (thx Luca Monducci; + closes: #540631). + * debian/po/es.po: [INTL:es] Spanish debconf template translation for + dash (closes: #540707). + + -- Gerrit Pape Wed, 16 Sep 2009 14:22:37 +0000 + +dash (0.5.5.1-2.3) unstable; urgency=low + + * Non-maintainer upload. + * Update the debconf templates according to the feedback on + debian-l10n-english. + * Install the NEWS file in the right location (Closes: #538809). + + -- Luk Claes Mon, 27 Jul 2009 12:45:48 +0000 + +dash (0.5.5.1-2.2) unstable; urgency=low + + [ Luk Claes ] + * Non-maintainer upload with maintainer's permission. + * Change the default for the system shell to dash. + * Ship /bin/sh in the package and fix the diversion handling + for it to make sure /bin/sh is always present. + * Set debconf priority to high when upgrading from an existing + system. + * Add versioned dpkg dependency for dpkg-divert --listpackage. + * Add NEWS file about changing /bin/sh. + * Adjusted the debconf template accordingly. + * Make dash Priority: Required + + [ Raphael Geissert ] + * Make dash Essential: yes + + -- Luk Claes Wed, 22 Jul 2009 20:17:31 +0200 + +dash (0.5.5.1-2.1) unstable; urgency=high + + * Non-maintainer upload. + * Depend on debianutils (Closes: #537990). + + -- Luk Claes Wed, 22 Jul 2009 18:50:45 +0000 + +dash (0.5.5.1-2) unstable; urgency=low + + * debian/diff/0001--SHELL-execute-EXIT-trap-if-the-shell-...diff; + remove; patch is faulty (reopens: #390433, closes: #515229, + #515064). + + -- Gerrit Pape Mon, 16 Feb 2009 12:49:32 +0000 + +dash (0.5.5.1-1) unstable; urgency=low + + * new upstream release. + * builds again with DEB_BUILD_OPTIONS=diet (closes: #493301). + * debian/diff/*.diff: remove; obsolete. + * debian/po/es.po: [INTL:es] Spanish debconf template translation + for dash (thx Francisco Javier Cuadrado, closes: #513689). + * debian/diff/0001--SHELL-execute-EXIT-trap-if-the-shell-...diff: + new; [SHELL] execute EXIT trap if the shell is killed through a + signal (thx Chris Lamb for the patch, closes: #390433). + * debian/diff/0002--MAN-rename-sh-to-dash-update-DESCRIPTION...diff: + new; [MAN] rename sh to dash, update DESCRIPTION and HISTORY (thx + jaalto, closes: #499838). + * debian/diff/0003--SHELL-print-n-upon-EOF-CTRL-D-when-run-...diff: + new; [SHELL] print \n upon EOF (CTRL-D) when run interactively + (closes: #476422). + + -- Gerrit Pape Wed, 11 Feb 2009 01:55:05 +0000 + +dash (0.5.4-12) unstable; urgency=low + + * debian/po/nl.po: [INTL:nl] Updated debconf templates translation + for Dutch (thx Thijs Kinkhorst, closes: #492069). + * debian/po/pt.po: [INTL:pt] Updated Portuguese translation for + debconf messages (thx Traduz - Portuguese Translation Team, + closes: #489805). + * debian/po/sv.po: [INTL:sv] po-debconf file for dash (thx Martin + Ågren, closes: #491532). + + -- Gerrit Pape Mon, 25 Aug 2008 19:47:04 +0000 + +dash (0.5.4-11) unstable; urgency=low + + * debian/diff/0045-Fix-null-pointer-dereference.diff, + debian/diff/0046-Fix-bitwise-AND-and-OR-operator-parsing.diff, + debian/diff/0047--MAN-add-missing-right-parenthesis...diff: remove; + applied upstream. + * debian/diff/0048--SHELL-add-l-option-to-force-login-shell.diff: + remove; fixed upstream. + * debian/diff/0044--*..0061--*: new; from upstream git. + * 0055--BUILTIN-Fixed-3-4-argument-cases-for-test-per-POSIX.diff: + [BUILTIN] Fixed 3,4-argument cases for test per POSIX (closes: + #455828). + * debian/diff/0044-run-aclocal-autoconf-autoheader-automake.diff: + redo as 0062-run-aclocal-autoconf-autoheader-automake.diff. + + -- Gerrit Pape Wed, 16 Jul 2008 19:24:54 +0000 + +dash (0.5.4-10) unstable; urgency=low + + * debian/po/it.po: [INTL:it] Italian debconf templates translation + (thx Luca Monducci, closes: #479361). + * debian/po/ru.po: [INTL:ru] Russian debconf templates translation + update (thx Yuri Kozlov, closes: #479592). + * debian/po/gl.po: [INTL:gl] Galician debconf template translation + for dash (thx Jacobo Tarrio, closes: #480978). + * debian/po/ja.po: [INTL:ja] updated Japanese debconf translation + (thx Kenshi Muto, closes: #483509). + * debian/control: Homepage: http://gondor.apana.org.au/~herbert/dash/ + (closes: #484665). + * debian/diff/0047--MAN-add-missing-right-parenthesis...diff: new; + [MAN] add missing right parenthesis in section Redirection (closes: + #481365). + * debian/diff/0048--SHELL-add-l-option-to-force-login...diff: new; + [SHELL] add -l option to force login shell (closes: #483287). + * debian/po/tr.po: new; [INTL:tr] Turkish debconf template translation + for dash (thx Mert Dirik, closes: #486571). + * debian/po/bg.po: new; [INTL:bg] Bulgarian debconf translation (thx + Damyan Ivanov, closes: #486800). + * debian/po/vi.po: [INTL:vi] Vietnamese debconf templates translation + update (thx Clytie Siddall, closes: #486801). + * debian/po/cs.po: [l10n] Updated Czech translation of dash debconf + messages (thx Miroslav Kure, closes: #487266). + * debian/po/pt.po: [INTL:pt] Updated Portuguese translation for + debconf messages (thx Ricardo Silva, closes: #487290). + * debian/po/ko.po: [INTL:ko] Korean dash debconf PO translation (thx + Sunjae Park, closes: #487897). + * debian/po/eu.po: new; [INTL:eu] dash debconf templates Basque + translation (thx xabier bilbao, closes: #488057). + * debian/po/pt_BR.po: [INTL:pt_BR] Brazilian Portuguese debconf + templates (thx Adriano Rafael Gomes, closes: #488390). + * debian/po/ro.po: new; [l10n:ro] dash: New Romanian translation of + po-debconf templates (thx Eddy Petrișor, closes: #488435). + * debian/control: Standards-Version: 3.8.0.1. + + -- Gerrit Pape Sun, 06 Jul 2008 15:59:18 +0000 + +dash (0.5.4-9) unstable; urgency=low + + * debian/diff/0046-Fix-bitwise-AND-and-OR-operator-parsing.diff: new: + Fix bitwise AND and OR operator parsing (closes: #470914). + * debian/dash.menu: change menu section from Apps/Shells to + Applications/Shells (thx Christian Perrier). + * debian/po/fr.po: [INTL:fr] French debconf templates translation update + (thx Christian Perrier, closes: #469253). + * debian/po/fi.po: [INTL:fi] Updated Finnish translation of the debconf + templates (thx Esko Arajärvi, closes: #469466). + * debian/po/de.po: [INTL:de] updated German debconf translation (thx + Helge Kreutzmann, closes: #469755). + + -- Gerrit Pape Thu, 17 Apr 2008 20:34:15 +0000 + +dash (0.5.4-8) unstable; urgency=low + + * debian/diff/0045-Fix-null-pointer-dereference.diff: new from Larry + Doolittle, blessed by upstream: Fix null pointer dereference (thx!, + closes: #467065; most probably closes: #462414, #462977, #463649, + #467358, #468376, #468449, #468837, #469102). + * debian/dash.templates.in: don't mention 'distribution policy' or + 'Debian policy' at all, but talk only about POSIX-compliance; run + debconf-updatepo (closes: #455550). + * debian/control: Standards-Version: 3.7.3.0. + + -- Gerrit Pape Sun, 02 Mar 2008 21:36:20 +0000 + +dash (0.5.4-7) unstable; urgency=low + + * debian/po/nl.po: [INTL:nl] New po-debconf translation in Dutch for dash + (thx Tim Dijkstra, closes: #458425). + * debian/rules: apply patch for cross building support, slightly modified + (thx Neil Williams, closes: #450512). + + -- Gerrit Pape Wed, 13 Feb 2008 19:19:53 +0000 + +dash (0.5.4-6) unstable; urgency=low + + * debian/control: add Vcs-Git: http://smarden.org/git/dash.git/. + * debian/diff/0041-PARSER-Add-FAKEEOFMARK-for-expandstr.diff, + debian/diff/0042-PARSER-Do-not-show-prompts-in-expandstr.diff: new + from upstream git. + * debian/diff/0043-EXPAND-Fix-slash-treatment-in-expmeta.diff: new + from upstream git: [EXPAND] Fix slash treatment in expmeta (closes: + #458687, #458690, #459049). + * debian/diff/0041-run-aclocal-autoconf-autoheader-automake.diff: redo + as debian/diff/0044-run-aclocal-autoconf-autoheader-automake.diff. + * debian/dash.templates.in: remove empty line after comments, hmm. + + -- Gerrit Pape Mon, 07 Jan 2008 10:37:47 +0000 + +dash (0.5.4-5) unstable; urgency=low + + * debian/diff/0038-EVAL-Fix-unaligned-trap-on-sparc.diff: applied + upstream, rename to + 0038-EVAL-Fix-bad-pointer-arithmetic-in-evalcommand.diff. + * debian/diff/0039-ARITH-If-imaxdiv-isn-t-available-use-and-ope.diff: + applied upstream, rename to + 0040-ARITH-If-imaxdiv-isn-t-available-use-and-ope.diff. + * debian/diff/0040-run-aclocal-autoconf-autoheader-automake.diff: redo + as debian/diff/0041-run-aclocal-autoconf-autoheader-automake.diff. + * debian/diff/0039-BUILTIN-Add-set-o-support.diff: new; from upstream + git: Add set +o support (closes: #456990). + * debian/diff/ja.po: remove again, doh. + + -- Gerrit Pape Thu, 27 Dec 2007 12:23:12 +0000 + +dash (0.5.4-4) unstable; urgency=low + + * debian/diff/0038-EVAL-Fix-unaligned-trap-on-sparc.diff: new; fix + unaligned trap on sparc (thx Steve Langasek, closes: #456399). + * debian/diff/0039-ARITH-If-imaxdiv-isn-t-available-use-and-ope.diff: new; + if imaxdiv() isn't available, use / and % operators (closes: #456398). + * debian/diff/0038-run-aclocal-autoconf-autoheader-automake.diff: redo + as debian/diff/0040-*. + * debian/po/vi.po: [INTL:vi] Vietnamese debconf templates translation + update (thx Clytie Siddall, closes: #453625). + * debian/diff/ja.po: new; [INTL:ja] Japanese debconf translation (thx + Kenshi Muto, closes: #446573). + + -- Gerrit Pape Fri, 21 Dec 2007 09:21:34 +0000 + +dash (0.5.4-3) unstable; urgency=low + + * debian/diff/0005-*..0037-*: new: from upstream git. + * 0025-*: Report substition errors at expansion time (closes: #418774). + * debian/diff/0005-dash.1-clarify-description-of-nt-ot-options-to-te.diff, + debian/diff/0006-dash.1-clarify-syntax-of-the-for-command.diff: remove; + applied upstream. + * debian/rules: no longer build dash.udeb package (on request of Otavio + Salvador, closes: #439139, #431312). + * debian/control: no longer Build-Depends: dietlibc; remove dash.udeb + package. + * Debconf templates and debian/control reviewed by the debian-l10n- + english team as part of the Smith review project (thx Christian Perrier + for the patch, closes: #449517): + * Convert debian/changelog to UTF-8 (closes: #451080, #453962, #453960). + * [Debconf translation updates] + * Galician (closes: #450864). + * Finnish (closes: #451015). + * Korean (closes: #451419). + * Italian (closes: #451607). + * Czech (closes: #451826). + * German (closes: #452173). + * Russian (closes: #452733). + * Portuguese (closes: #453038). + + -- Gerrit Pape Mon, 10 Dec 2007 13:18:14 +0000 + +dash (0.5.4-2) unstable; urgency=low + + * debian/diff/0001-SHELL-Restore-foreground-process-group-on-exit.diff: + new; from upstream git, replaces + debian/diff/0001-Restore-pgrp-on-exit-fix-backgrounded-MC-bug.diff. + * debian/diff/0002-SHELL-Move-flushall-to-the-point-just-before-_exit.diff, + debian/diff/0003-BUILTIN-test-White-space-fixes.diff, + debian/diff/0004-BUILTIN-test-little-size-and-speed-optimizations.diff: + new; from upstream git (closes: #431320). + * debian/diff/0005-dash.1-clarify-description-of-nt-ot-options-to-te.diff: + new; dash.1: clarify description of -nt, -ot options to test builtin + (closes: #373611). + * debian/diff/0006-dash.1-clarify-syntax-of-the-for-command.diff: new; + dash.1: clarify syntax of the for command (closes: #387441). + + -- Gerrit Pape Tue, 25 Sep 2007 07:39:37 +0000 + +dash (0.5.4-1) unstable; urgency=low + + * new upstream version. + * debian/diff/????-*.diff: remove all but + ????-Restore-pgrp-on-exit-fix-backgrounded-MC-bug.diff; obsolete. + * debian/rules: dump config.log on build failure. + + -- Gerrit Pape Wed, 18 Jul 2007 09:33:06 +0000 + +dash (0.5.3-9) unstable; urgency=low + + * debian/rules: target patch, clean: apply diffs from debian/diff/ in + alphabetical order. + * debian/diff/0018-Restore-pgrp-on-exit-fix-backgrounded-MC-bug.diff: + new; Restore pgrp on exit (fix "backgrounded MC" bug) (thx Denis + Vlasenko, closes: #381878). + + -- Gerrit Pape Tue, 26 Jun 2007 13:38:39 +0000 + +dash (0.5.3-8) unstable; urgency=low + + * debian/diff/0009..0017-*.diff: new; from upstream master branch. + * 0009-BUILTIN-Fix-mkbuiltin-sort-order.diff: Fix mkbuiltin sort + order (closes: #415119). + * 0016-REDIR-Fix-redirect-restore-on-saved-file-descriptor.diff: + Fix redirect restore on saved file descriptors (closes: #357091). + * debian/po/it.po: [INTL:it] Italian debconf templates translation + (thx Luca Monducci; closes: #418174). + + -- Gerrit Pape Mon, 04 Jun 2007 18:46:04 +0000 + +dash (0.5.3-7) unstable; urgency=medium + + * Debconf translation updates (thx Christian Perrier for the patch): + - Czech updated (thx Miroslav Kure; closes: #407828). + - Galician added (thx Jacobo Tarrio; closes: #407952). + - Portuguese updated + - Russian updated + - Galician updated + - Dutch updated + - Vietnamese updated + - Swedish updated + * run debconf-updatepo to update PO files about debconf templates. + + -- Gerrit Pape Fri, 2 Feb 2007 07:03:36 +0000 + +dash (0.5.3-6) unstable; urgency=medium + + * debian/po/es: [INTL:es] Spanish po-debconf translation (thx Fernando + Cerezal; closes: #402981). + * debian/po/pt_BR: [INTL:pt_BR] updating the Brazilian Portuguese + translation (thx Andre Luis Lopes; closes: #403831). + + -- Gerrit Pape Sun, 31 Dec 2006 12:24:03 +0000 + +dash (0.5.3-5) unstable; urgency=low + + * debian/po/da.po: [INTL:da] Updated Danish debconf translation (thx Claus + Hindsgaul; closes: #398779). + * debian/po/de.po: [INTL:de] Update German debconf translation (thx Helge + Kreutzmann; closes: #397825). + * debian/po/fr.po: French debconf templates translation update (thx Cyril + Brulebois; closes: #397013). + + -- Gerrit Pape Tue, 21 Nov 2006 13:48:33 +0000 + +dash (0.5.3-4) unstable; urgency=low + + * debian/diff/0001-EVAL-Make-eval-with-empty-arguments-return-0.diff: new + from upstream git; replaces debian/diff/eval-exit-status.diff. + * debian/diff/0004-PARSER-Only-use-signed-char-for-syntax-arrays.diff: new + from upstream git; replaces debian/diff/dash-signed-char-syntax.diff. + * 0002-PARSER-Removed-useless-parsebackquote-flag.diff, + 0003-PARSER-Use-alloca-to-get-rid-of-setjmp.diff, + 0005-BUILD-Added-with-libedit-option-to-configure.diff, + 0006-EXPAND-Fixed-inverted-char-class-matching.diff, + 0007-SYSTEM-Check-return-code-for-getgroups-and-fwrite.diff, + 0008-BUILTIN-Fixed-command-v-segmentation-fault.diff (closes: #387458): + new from upstream git. + * debian/dash.templates.in: fix glitch in debconf message (thx Christian + Perrier, closes: #366099), + * debian/control: Standards-Version: 3.7.2.2. + + -- Gerrit Pape Mon, 23 Oct 2006 20:38:54 +0000 + +dash (0.5.3-3) unstable; urgency=low + + * debian/rules: target configure, configure-udeb: add --host option to + configure (adds the ability to cross-compile, patch from Pjotr + Kourzanov; closes: #355132, #355124). + * debian/po/it.po: new: initial Italian debconf translation (thx Andrea + Bolognani; closes: #355011). + * debian/diff/dash-signed-char-syntax.diff: new: patch from upstream: + don't remove special chars on expansion (closes: 349855). + * debian/implicit: update to revision 1.11. + + -- Gerrit Pape Sun, 16 Apr 2006 13:09:08 +0000 + +dash (0.5.3-2) unstable; urgency=low + + * debian/diff/eval-exit-status.diff: new; patch from upstream; fix exit + status of eval with null arguments (closes: #347232). + * debian/rules: new target patch: apply diffs from debian/diff/, + reverse-apply in target clean:. + + -- Gerrit Pape Tue, 17 Jan 2006 05:37:48 +0000 + +dash (0.5.3-1) unstable; urgency=low + + * new upstream version. + * Fix \c spillage across echo commands (closes: #337294). + * debian/copyright: adapt copyright notice. + * debian/rules: remove workaround for udeb build failure with dietlibc + on 64bit archs; fixed upstream. + + -- Gerrit Pape Mon, 28 Nov 2005 12:18:30 +0000 + +dash (0.5.2-8) unstable; urgency=low + + * src/input.c: apply patch from upstream (handle NUL characters + gracefully, closes: #317516). + * debian/po/sv.po: update Swedish translation (thx Daniel Nylander, + closes: #330315). + + -- Gerrit Pape Wed, 5 Oct 2005 13:24:33 +0000 + +dash (0.5.2-7) unstable; urgency=low + + * debian/rules: work around udeb build failure with dietlibc on 64bit + archs (closes: #318607). + + -- Gerrit Pape Fri, 5 Aug 2005 17:12:31 +0000 + +dash (0.5.2-6) unstable; urgency=low + + * debian/po/vi.po: new; initial Vietnamese debconf translation (closes: + #313502, thx Clytie Siddall). + * debian/rules: install dash menu file into /usr/share/menu/; build + dash.udeb against dietlibc on archs !m68k. + * debian/control: Build-Depends: dietlibc-dev [archs]; Standards-Version: + 3.6.2.0. + + -- Gerrit Pape Fri, 8 Jul 2005 16:17:00 +0000 + +dash (0.5.2-5) unstable; urgency=low + + * debian/po/cs.po: new; initial Czech debconf translation (closes: + #308043, thx Martin Sin, Miroslav Kure). + + -- Gerrit Pape Wed, 11 May 2005 14:01:40 +0000 + +dash (0.5.2-4) unstable; urgency=medium + + * debian/dash.postrm: fix typo in options to dpkg (in or list). + + -- Gerrit Pape Sat, 2 Apr 2005 18:04:39 +0000 + +dash (0.5.2-3) unstable; urgency=low + + * apply patch from upstream bk: + * src/var.c: add trailing equal sign in setvar for variables set to null + (closes: #299639). + * debian/dash.menu: new. + * debian/rules: install debian/dash.menu file (closes: #296297). + * debian/dash.postinst: conditionally run update-menus on configure. + * debian/dash.postrm: conditionally run update-menus on remove and upgrade + (actually downgrade). + + -- Gerrit Pape Mon, 28 Mar 2005 17:15:22 +0000 + +dash (0.5.2-2) unstable; urgency=high + + * debian/control: no longer Build-Depends: bison. + * apply patch from upstream: + * src/eval.c, src/eval.h: don't errexit on builtin in if condition and + or list (closes: #276964). + * src/dash.1: fix grammar, typo (thx A Costa, closes: #296396, #296545). + + -- Gerrit Pape Tue, 1 Mar 2005 21:14:37 +0000 + +dash (0.5.2-1) unstable; urgency=low + + * new upstream release. + * Fixed spelling errors in manual page; Spell behaviour consistently in + manual page (closes: #281803). + * Corrected manual entry about ENV and non-interactive shells (closes: + #292501). + + -- Gerrit Pape Mon, 31 Jan 2005 20:12:08 +0000 + +dash (0.5.1-3) unstable; urgency=low + + * apply patch from upstream bk: + * src/jobs.c: allow negative pid argument to kill(1). + * apply patch from upstream: + * src/expand.c: fix $@ expansion when leading argument is null (closes: + #266082). + + -- Gerrit Pape Sun, 22 Aug 2004 15:48:47 +0000 + +dash (0.5.1-2) unstable; urgency=low + + * apply patch from upstream: + * src/cd.c: fix cd - when OLDPWD is unset (closes: #263159). + + -- Gerrit Pape Thu, 5 Aug 2004 08:17:18 +0000 + +dash (0.5.1-1) unstable; urgency=low + + * new upstream release. + * debian/rules: reorganize; stop using debhelper, use implicit rules. + * debian/implicit: new; implicit Makefile rules. + * debian/control: no longer Build-Depends: debhelper, pmake; + Build-Depends: po-debconf. + * debian/copyright: adapt. + * debian/ash.dirs, debian/bsdyacc, debian/compat, debian/dash-udeb.dirs, + debian/dash.dirs, debian/dash.templates.merged: remove; obsolete. + * debian/dash.templates: rename to debian/dash.templates.in. + * debian/dash.postrm: new; run db_purge on purge if debconf is available. + * debian/ash.postinst, debian/ash.postrm, debian/dash.postinst, + debian/dash.prerm: remove "#DEBHELPER#". + * src/mystring.c, src/var.c, src/bltin/printf.c: #include "system.h" (for + diet libc). + + -- Gerrit Pape Fri, 9 Jul 2004 19:21:26 +0000 + +dash (0.4.26-3) unstable; urgency=low + + * apply patch approved by upstream: + * error.c, error.h, mystring.c, mystring.h, bltin/printf.c: optionally + compile with the diet libc. + * debian/README.Debian.diet, debian/dash.docs: new; how to build dash + with the diet libc. + * debian/rules: support "diet" in DEB_BUILD_OPTIONS to easily build the + packages with the diet libc instead of glibc. + + -- Gerrit Pape Sat, 26 Jun 2004 12:26:19 +0000 + +dash (0.4.26-2) unstable; urgency=low + + * apply patch from upstream: + * expand.c: add support for character classes to pmatch(), glibc's + fnmatch() still is broken (closes: #250499, works around: #243885). + + -- Gerrit Pape Tue, 1 Jun 2004 05:53:39 +0000 + +dash (0.4.26-1) unstable; urgency=low + + * new maintainer. + * add debian_revision to upstream_version, package no longer is debian + native, upstream is Herbert Xu. + * apply patch from upstream: + * Fixed vstype trim operator ordering in cmdputs. + * Fixed quote for CTLENDVAR in cmdputs. + * Fixed VSLENGTH crash in cmdputs (closes: #250855). + + -- Gerrit Pape Fri, 28 May 2004 18:40:53 +0000 + +dash (0.4.26) unstable; urgency=low + + * Disabled fnmatch code again (closes: #240887). + * Updated copyright. + * Updated German debconf translation (Florian Ernst, closes: #244507). + * Fixed obstack corruption in setprompt (closes: #246635). + + -- Herbert Xu Fri, 30 Apr 2004 21:48:52 +1000 + +dash (0.4.25) unstable; urgency=low + + * Fixed use-after-free bug in setvareq (Vladimir N. Oleynik). + * Fixed value of expdest after _STPUTC in expandarg (closes: #238265). + + -- Herbert Xu Thu, 18 Mar 2004 20:55:57 +1100 + +dash (0.4.24) unstable; urgency=low + + * Fixed segmentation fault when PWD is undefined. + + -- Herbert Xu Tue, 9 Mar 2004 19:58:41 +1100 + +dash (0.4.23) unstable; urgency=low + + * Verify PWD before using it. + + -- Herbert Xu Mon, 8 Mar 2004 20:12:27 +1100 + +dash (0.4.22) unstable; urgency=low + + * Read PWD from environment (closes: #228659). + * Added Danish debconf translation (Claus Hindsgaul, closes: #233756). + * Added check_gcc to support gcc 2.95 (closes: #235933). + * Perform here-doc expansion on PS1/PS2/PS4 (closes: #230858). + + -- Herbert Xu Sun, 7 Mar 2004 21:50:04 +1100 + +dash (0.4.21) unstable; urgency=low + + * Fixed typo that broke ulimit (GCS, closes: #228369). + + -- Herbert Xu Mon, 19 Jan 2004 19:02:32 +1100 + +dash (0.4.20) unstable; urgency=low + + * Added Dutch debconf translation (Tim Dijkstra, closes: #218904). + * Check existence RLIMIT symbols for ulimit. + * Removed table lookup in errmsg. + * Restored NULL check in cmdtxt. + * Restored ash postrm to purge debconf entries (closes: #221913). + * Fixed exit status of exit in EXIT trap (closes: #227734). + * Updated Brazilian debconf translation (Andre Luis Lopes, closes: #228095). + * Restored goodname check in prehash. + + -- Herbert Xu Sat, 17 Jan 2004 09:57:14 +1100 + +dash (0.4.19) unstable; urgency=low + + * Fixed handling of evalskip in dotcmd (closes: #212975). + * Updated Russian debconf translation (Ilgiz Kalmetev, closes: #214333). + * Added Portugese debconf translation (Bruno Rodrigues, closes: #216214). + * Updated Spanish debconf translation (Carlos Valdivia, closes: #216338). + * Fixed length expansion of special variables (closes: #216767). + * Replaced umask builtin with pdksh version. + * Reverted bogus eval change in 0.3.1-20. + * Added vmemory/locks support in ulimit. + * Call install -D instead of cp for merged template. + + -- Herbert Xu Wed, 29 Oct 2003 22:14:22 +1100 + +dash (0.4.18) unstable; urgency=low + + * Fixed boundary checks in getopts. + * Updated Japanese debconf template (Tomohiro KUBOTA, closes: #192382). + * Use -falign-* instead -malign-*. + * Use strtoll for parsing integers in arith expansion. + * Added support for add-shell/remove-shell (closes: #163131). + * Fixed JOBS ifdefs in sprint_status (closes: #211009). + * Fixed bit-wise or in arith expansion (Mototoshi KONDO, closes: #212825). + * Print PS4 on previous stderr. + * Converted debconf templates to gettext (Christian Perrier, + closes: #200112). + + -- Herbert Xu Sat, 27 Sep 2003 14:26:36 +1000 + +dash (0.4.17) unstable; urgency=low + + * Reset rehash when recylcing cmd entries. + * Fixed null arg0 segfault with -c (closes: #191687). + * Relocate job pointers in makejob (closes: #191595). + + -- Herbert Xu Sat, 3 May 2003 20:57:46 +1000 + +dash (0.4.16) unstable; urgency=low + + * Fixed printf so that exit status is cleared on entry. + * Call nextopt() in printf. + * Fixed command substitution corruption by grabbing expdest in expbackq + (closes: #187896). + + -- Herbert Xu Mon, 7 Apr 2003 21:21:30 +1000 + +dash (0.4.15) unstable; urgency=low + + * Fixed octal escapes in echo/printf (closes: #187827). + + -- Herbert Xu Sun, 6 Apr 2003 20:45:38 +1000 + +dash (0.4.14) unstable; urgency=low + + * Added missing newline when printing in dowait. + * Do not print status in dowait when stopped. + * Fixed job status display. + * Fixed current job setting. + * Fixed kill segfault with no arguments (closes: #187189). + * Fixed sorting of set output. + * Removed setvar builtin. + + -- Herbert Xu Thu, 3 Apr 2003 20:38:33 +1000 + +dash (0.4.13) unstable; urgency=low + + * Fixed precision type on 64 bit systems in showvars. + + -- Herbert Xu Wed, 26 Mar 2003 20:00:03 +1100 + +dash (0.4.12) unstable; urgency=low + + * Fixed dash_errno build problem with gcc 3.2. + + -- Herbert Xu Tue, 25 Mar 2003 22:28:50 +1100 + +dash (0.4.11) unstable; urgency=low + + * Removed unused pgrp field from job structure. + * Free jobs when calling wait with no arguments. + * Fixed build problem with bison. + * Merged changes from NetBSD 20030123. + . printf: + - Fixed mklong sefault. + - Fixed precision/field width with %b. + . Improved option parsing of command(1). + . Added rudimentary support for PS4. + * Moved builtin flags into builtins.def. + * Updated Spanish debconf template (Carlos Valdivia Yagüe, closes: #178359). + * Fixed ordering of redirection versus assignment substitution. + * Fixed potential setvareq memory leaks. + * Use bison instead of byacc. + * Fixed wait(1) race condition. + * Fixed alignment memory corruption bug in growstackblock(). + * Fixed potential memory corruption in parsing position parameters. + * Fixed getopts done check. + + -- Herbert Xu Mon, 24 Mar 2003 20:42:29 +1100 + +dash (0.4.10) unstable; urgency=low + + * Fixed redirection fd leak when execing. + + -- Herbert Xu Sun, 19 Jan 2003 13:25:41 +1100 + +dash (0.4.9) unstable; urgency=low + + * Reset exitstatus in evalsubshell if backgnd is true. + * Fixed glibc glob syntax error in expand.c. + + -- Herbert Xu Sat, 11 Jan 2003 16:04:02 +1100 + +dash (0.4.8) unstable; urgency=low + + * Removed backgnd flag from ncmd due to previous redirection change. + * Set lim after the stack stablises in updatepwd (closes: #173884). + * Do not clobber the exitstatus after redirection. + + -- Herbert Xu Mon, 23 Dec 2002 19:50:06 +1100 + +dash (0.4.7) unstable; urgency=low + + * Merged clearredir with reset code in redir.c. + * Redirect before command search in evalcommand (closes: #168862). + * Build binary-all packages in binary-indep (closes: #173191). + + -- Herbert Xu Sat, 21 Dec 2002 13:52:37 +1100 + +dash (0.4.6) unstable; urgency=low + + * Restored code for leaving job control. + + -- Herbert Xu Sun, 8 Dec 2002 15:21:58 +1100 + +dash (0.4.5) unstable; urgency=low + + * Optimised doformat so that vsnprintf is usually called only once. + * Reset redirlist in clearredir so that popredir can work (closes: #170247). + + -- Herbert Xu Sat, 23 Nov 2002 22:09:59 +1100 + +dash (0.4.4) unstable; urgency=low + + * Fixed duplicate define warnings in init.c. + * Set debhelper compat to 4. + * Vanishing mail boxes no longer elicit "you have mail" messages. + * Function redirection errors no longer abort the shell. + * Fixed potential memory leak in redirect. + * Only allocate memory if necessary in redirect. + * Reap dead here documents. + * Do not strdup default values of static shell variables. + * Removed unnecessary setprompt(0) calls. + * Read in BUFSIZ chunks rather than BUFSIZ - 1. + * Documented undefined escape behaviour for echo(1) (closes: #167893). + * Do va_copy when we use a va_list twice (closes: #169503). + + -- Herbert Xu Wed, 20 Nov 2002 19:48:31 +1100 + +dash (0.4.3) unstable; urgency=low + + * Added manual entry for PPID. + * Exporting an unset variable no longer causes it to be set. + * Fixed fd0 redirection in asynchronous lists. + * Only stat if necessary in cdcmd (see #42880). + * Removed extra newline in error message in arith lexer. + * Set heredoclist to 0 ASAP in parseheredoc. + * Removed BSD advertising clause from copyright file. + * Check non-ash diversions as well in dash.postinst. + * Duplicated diversion checking in ash.postinst (closes: #166441). + + -- Herbert Xu Sat, 26 Oct 2002 21:28:33 +1000 + +dash (0.4.2) unstable; urgency=low + + * Give benefits of dash in templates (closes: #161527). + * Fixed signed/unsigned on result of xwrite (closes: #161606). + * Removed support for SIG prefixes in kill and trap. + * Added -- processing in trap. + * Dropped use of unset in postinst (closes: 161868). + * Fixed printf(1) %* processing on bad integers and zero. + * Use stat64 in test(1). + * Allocate group_array with stalloc in test(1). + * Disabled alias checking after a pattern in a case statement. + * Wait now returns 128 + last trapped signal. + * Printf now keeps going after errors. + * Empty non-trivial parameter expansions are now removed correctly. + * Call reset() before exitshell() is called. This fixes the bug where + returning an error from a function running under set -e caused the exit + trap to be taken with evalskip set. + * Fixed quoting of empty strings in single_quote(). + * Show line numbers on all errors. + * Function names must be valid identifiers. + * Removed unused dependency on groff. + * Fixed race condition before entering a function. + * Fixed getopts initialisation for functions. + * Added memory barriers in INT macros. + * Banned empty compound lists in most places. + * Keep usage counters on functions (closes: #164234). + * Updated copyright file. + * Check evalskip in evalstring (closes: #165056). + * Merged changes from NetBSD 1.6: + . Added intmax support in printf(1). + . Implemented set -u. + + -- Herbert Xu Sat, 19 Oct 2002 14:23:11 +1000 + +dash (0.4.1) unstable; urgency=low + + * Removed extra new line in command -v output for aliases. + * Removed alais prefix in the output of alias. + * Recognise octal and hex numbers in arith expansion (closes: #151449). + * Added sh(1) entries for echo, printf and test (closes: #156446). + * Renamed to dash --- the Debian Almquist Shell. + * Cleaned up rules file (Matej Vela). + * Check mtime instead of size in chkmail per POSIX. + * Added support for LFS (closes: #157884). + * Added SuS options to cd and pwd (closes: #145828). + + -- Herbert Xu Fri, 13 Sep 2002 20:35:06 +1000 + +ash (0.3.8-38) unstable; urgency=low + + * Turned pre-dependency to dependency in udeb since the former is not allowed + (closes: #143749). + + -- Herbert Xu Sun, 28 Apr 2002 11:59:05 +1000 + +ash (0.3.8-37) unstable; urgency=low + + * Added Japanese debconf translation (Tomohiro KUBOTA, closes: #137431). + * Added missing escapes in manual page (Aaron Schrab, closes: #137966). + * Added Russian debconf translation (Ilgiz Kalmetev, closes: #137618). + * Fixed trap(1) documentation (closes: #140973). + * Do not abort if getcwd fails. + + -- Herbert Xu Wed, 3 Apr 2002 20:58:09 +1000 + +ash (0.3.8-36) unstable; urgency=low + + * Added library dependency for ash-udeb. + * Handle null case statements correctly. + * Fixed alias expansions in case statements (NetBSD). + * Disabled unused jobid command. + * Corrected documentation about shifting too much. + * Added French debconf translation (Denis Barbier, closes: #134625). + * Updated Spanish debconf translation (Carlos Valdivia, closes: #136366). + + -- Herbert Xu Sat, 2 Mar 2002 18:31:22 +1100 + +ash (0.3.8-35) unstable; urgency=low + + * Moved PWD initialisation into var.c (closes: #124032). + + -- Herbert Xu Mon, 24 Dec 2001 09:34:55 +1100 + +ash (0.3.8-34) unstable; urgency=low + + * NSEMI must be NOR + 1. + * Set exitstatus to zero before evaluating cases (closes: #124066). + * Explicitly set default answer of the ash/sh question to false so that + people whose debconf priority is set to low and who keeps banging on their + keyboards don't accidently end up with ash as /bin/sh. + + -- Herbert Xu Fri, 21 Dec 2001 20:30:49 +1100 + +ash (0.3.8-33) unstable; urgency=low + + * Added missing inclusion of bltin.h in bltin/times.c. + + -- Herbert Xu Thu, 13 Dec 2001 18:46:07 +1100 + +ash (0.3.8-32) unstable; urgency=low + + * Back slashes in expansions are now escaped (closes: #121516). + + -- Herbert Xu Wed, 28 Nov 2001 20:15:01 +1100 + +ash (0.3.8-31) unstable; urgency=low + + * Made sure all back slashes are escaped. + + -- Herbert Xu Mon, 26 Nov 2001 19:10:27 +1100 + +ash (0.3.8-30) unstable; urgency=low + + * Restored fnmatch(3) code. + * Treat escaped slashes correctly while globbing. + * Restored missing EV_EXIT check in evalcommand (closes: #120364). + * Fixed stack corruption in _rmescapes. + + -- Herbert Xu Sun, 25 Nov 2001 17:51:19 +1100 + +ash (0.3.8-29) unstable; urgency=low + + * Added missing va_end in fmtstr (NetBSD). + * Removed shellproc crap. + * Updated Swedish debconf translation (Mikael Hedin, closes: #116097). + * Updated German debconf translation (Andreas Metzler, closes: #117160). + * Break now treats illegal numbers according to SuS. + * Errors in special builtins now rise to the top. + * Normal redirection errors no longer abort the shell. + * Functions now have the same variable assignment properties as special + builtins. + + -- Herbert Xu Sat, 3 Nov 2001 11:36:36 +1100 + +ash (0.3.8-28) unstable; urgency=low + + * Local variables are now unset properly in shprocvar() (closes: #114917). + + -- Herbert Xu Sat, 13 Oct 2001 14:07:21 +1000 + +ash (0.3.8-27) unstable; urgency=low + + * Kill no longer aborts if it fails to kill someone. + + -- Herbert Xu Sun, 30 Sep 2001 22:20:36 +1000 + +ash (0.3.8-26) unstable; urgency=low + + * The sh.1.gz diversion now agrees with reality (closes: #113831). + + -- Herbert Xu Sat, 29 Sep 2001 08:43:27 +1000 + +ash (0.3.8-25) unstable; urgency=low + + * Only read ENV if the shell is interactive (closes: #110421). + + -- Herbert Xu Wed, 29 Aug 2001 19:18:53 +1000 + +ash (0.3.8-24) unstable; urgency=low + + * Handle SIGINT when waiting even if there is no trap (closes: #107699). + * Protect all makejob/forkshell/waitforjobs sequences from SIGINT. + * Work around gcc bug that generates bad ..ng references (closes: #107994). + + -- Herbert Xu Wed, 8 Aug 2001 20:28:28 +1000 + +ash (0.3.8-23) unstable; urgency=low + + * Fixed fence post error in scanleft (closes: #107229). + * Removed stunalloc in expname as it interferes with addfname. + * Fixed CTLESC skipping in scanright. + + -- Herbert Xu Thu, 2 Aug 2001 20:06:00 +1000 + +ash (0.3.8-22) unstable; urgency=low + + * Fixed trailing back slash bug in echo/printf (closes: #106693). + * Some quoted's are meant to be quotes. + * Added Brazilian translation (Andre Luis Lopes, closes: #107041). + + -- Herbert Xu Mon, 30 Jul 2001 20:21:52 +1000 + +ash (0.3.8-21) unstable; urgency=low + + * Fixed EV_EXIT/redirection bugs that caused core dumps. + + -- Herbert Xu Sat, 28 Jul 2001 17:03:28 +1000 + +ash (0.3.8-20) unstable; urgency=low + + * Don't save fd2 if job control is turned off. + * Don't push redirections when EV_EXIT is set. + * Fixed assignment recognition in the presence of back ticks. + * Combined checkkwd and checkalias. + + -- Herbert Xu Fri, 27 Jul 2001 22:29:41 +1000 + +ash (0.3.8-19) unstable; urgency=low + + * Recompute strings after growing in subevalvar (closes: #106050). + + -- Herbert Xu Mon, 23 Jul 2001 21:16:50 +1000 + +ash (0.3.8-18) unstable; urgency=low + + * Added more space optimisations for udeb on i386. + * Set stack mark in patmatch (closes: #106050). + * Fixed theoretical bug in expari. + + -- Herbert Xu Sat, 21 Jul 2001 20:08:15 +1000 + +ash (0.3.8-17) unstable; urgency=low + + * Don't complain about unknown escape codes in echo and printf + (closes: #105659). + * Updated build-time dependency on groff-base (closes: #105612). + + -- Herbert Xu Wed, 18 Jul 2001 19:33:20 +1000 + +ash (0.3.8-16) unstable; urgency=low + + * Fixed backslash bug in new pattern matching code. + + -- Herbert Xu Mon, 16 Jul 2001 21:47:39 +1000 + +ash (0.3.8-15) unstable; urgency=low + + * Added Swedish translation of templates (Martin Sj?n, closes: #103158). + * Restored escape code support in echo. + * Removed assignment builtins since it is at best undefined by the SuS and + also can't be implemented consistently. + * Removed extraneous volatile modifier (closes: #104518). + * General overhaul of word expansion (closes: #96588). + * Redirection prefixes no longer stop assignments from being recognised. + + -- Herbert Xu Sun, 15 Jul 2001 17:27:03 +1000 + +ash (0.3.8-14) unstable; urgency=low + + * Divert sh.1.gz to sh.distrib.1.gz (closes: #102251). + * Added HETIO support for ^D and ^U (Aaron Lehmann, closes: #102215). + * Added Spaniash translation of debconf templates (Carlos Valdivia Yage, + closes: #103040). + * Added versioned build-time dependency on groff. + + -- Herbert Xu Mon, 2 Jul 2001 19:32:03 +1000 + +ash (0.3.8-13) unstable; urgency=low + + * Fixed a bug where errors in pipelines which are part of andor lists were + not ignored when -e is in effect. + + -- Herbert Xu Mon, 25 Jun 2001 19:40:27 +1000 + +ash (0.3.8-12) unstable; urgency=low + + * Rewrote arith_lex.l in C (Aaron Lehmann, closes: #101741). + * && and || in arithmetic expansions now return either 0 or 1. + + -- Herbert Xu Sun, 24 Jun 2001 20:14:29 +1000 + +ash (0.3.8-11) unstable; urgency=low + + * Check for NULL argument in evaltree() (closes: #98865, #98867). + + -- Herbert Xu Sun, 27 May 2001 17:53:14 +1000 + +ash (0.3.8-10) unstable; urgency=low + + * Use /bin/ash in postinst to sidestep bugs in other shells (closes: #98739). + * Exit status is now tested on non-negated pipelines (closes: #98736). + + -- Herbert Xu Sat, 26 May 2001 23:56:07 +1000 + +ash (0.3.8-9) unstable; urgency=medium + + * IFS is now fetched using bltinlookup() again in read (closes: #98343). + * Divert sh(1) man page as well as /bin/sh (closes: #98525). + + -- Herbert Xu Fri, 25 May 2001 20:30:06 +1000 + +ash (0.3.8-8) unstable; urgency=low + + * Fixed diversion removal in prerm (duh, closes: #98031). + + -- Herbert Xu Mon, 21 May 2001 20:52:48 +1000 + +ash (0.3.8-7) unstable; urgency=low + + * Fixed diversion test in prerm (closes: #98031). + + -- Herbert Xu Sun, 20 May 2001 12:30:53 +1000 + +ash (0.3.8-6) unstable; urgency=low + + * Make sure that fd2 is closed when clearing redirects (closes: #96619). + * Fixed memory corruption in stunalloc(). + * The output of export/readonly/set is now correctly quoted. + * Fixed newline eating bug in expbackq(). + * Set OLDPWD. + * Removed ash-medium as neither bf or di uses it. + * Wait now waits for all its argument rather than the first one. + * Wait will exit with 129 when interrupted by a signal for a which a trap has + been set. + + -- Herbert Xu Fri, 18 May 2001 21:51:41 +1000 + +ash (0.3.8-5) unstable; urgency=low + + * Added German translation to template file (Sebastian Feltel, + closes: #96203). + * Added missing initialisation in setalias() (closes: #95433). + + -- Herbert Xu Fri, 4 May 2001 20:54:31 +1000 + +ash (0.3.8-4) unstable; urgency=low + + * Disabled fnmatch code as fnmatch(3) in glibc is broken. + * Fixed echo example in man page (Kalle Olavi Niemitalo, closes: #96014). + * Fixed trailing semicolon bug with eval (NetBSD). + * Fixed globbing inconsistency with broken symlinks (NetBSD). + + -- Herbert Xu Wed, 2 May 2001 22:57:16 +1000 + +ash (0.3.8-3) unstable; urgency=low + + * Work around broken autoconf scripts (closes: #95430). + + -- Herbert Xu Tue, 1 May 2001 18:27:50 +1000 + +ash (0.3.8-2) unstable; urgency=low + + * Save checkalias before calling xxreadtoken() (closes: #95628). + + -- Herbert Xu Sun, 29 Apr 2001 17:36:01 +1000 + +ash (0.3.8-1) unstable; urgency=low + + * NetBSD-current version as of 20010316. + * Removed code that sets IFS. + * Fixed memory leak with PWD. + * Set PPID. + * Fixed inconsistencies in alias expansion. + * Restored original output code. + * Enabled fnmatch code again. + * Added builtin printf. + * Offer to divert /bin/sh (closes: #70462). + + -- Herbert Xu Wed, 25 Apr 2001 22:32:39 +1000 + +ash (0.3.7-16) unstable; urgency=low + + * Fixed incorrect default IFS in readcmd (closes: #88950). + * Added missing return in hashcmd. + + -- Herbert Xu Fri, 9 Mar 2001 20:44:40 +1100 + +ash (0.3.7-15) unstable; urgency=low + + * Unknown escape codes are now prnted literally by echo (closes: #82869). + * Made hetio_read_input() fail if fd is not stdin. + * Some uses of VSQUOTE were really meant to be quotes (closes: #88777). + * Build different ashes in different subdirectories. + + -- Herbert Xu Thu, 8 Mar 2001 21:32:28 +1100 + +ash (0.3.7-14) unstable; urgency=low + + * Removed predependency from udeb (closes: #81995). + * Added /bin/sh symlink to udeb (closes: #81967). + + -- Herbert Xu Sat, 13 Jan 2001 15:23:21 +1100 + +ash (0.3.7-13) unstable; urgency=low + + * Renamed the udeb to ash-udeb. + + -- Herbert Xu Wed, 20 Dec 2000 19:32:34 +1100 + +ash (0.3.7-12) unstable; urgency=low + + * Added support for udebs (Randolph Chung, closes: #79237). + + -- Herbert Xu Sat, 16 Dec 2000 13:53:28 +1100 + +ash (0.3.7-11) unstable; urgency=low + + * Preserve the previous exit status upon entering a function + (closes: #78374). + + -- Herbert Xu Sun, 3 Dec 2000 13:34:27 +1100 + +ash (0.3.7-10) unstable; urgency=low + + * Merged changes for GNU from Igor Khavkine. + * Minimise the number of sigactions. + + -- Herbert Xu Fri, 3 Nov 2000 20:31:52 +1100 + +ash (0.3.7-9) unstable; urgency=low + + * Predepend on the libraries. + * Always save fd 2 when it is redirected (closes: #75302). + + -- Herbert Xu Sun, 22 Oct 2000 08:40:40 +1100 + +ash (0.3.7-8) unstable; urgency=high + + * More redirection fixes (closes: #73613). + + -- Herbert Xu Thu, 5 Oct 2000 18:22:17 +1100 + +ash (0.3.7-7) unstable; urgency=high + + * Added missing break in redirection code (closes: #72956). + + -- Herbert Xu Tue, 3 Oct 2000 07:58:04 +1100 + +ash (0.3.7-6) unstable; urgency=low + + * command -[vV] no longer displays an error message on stdout. + * Redirecting to /proc/self/fd/* now works (closes: #72852). + + -- Herbert Xu Sun, 1 Oct 2000 12:56:39 +1100 + +ash (0.3.7-5) unstable; urgency=low + + * Implemented set -a. + + -- Herbert Xu Sat, 30 Sep 2000 16:00:33 +1100 + +ash (0.3.7-4) unstable; urgency=low + + * Added build-time dependency on debhelper (closes: #69920). + * Extended maximum length of arithmetic expansions to match 32-bit integers. + + -- Herbert Xu Wed, 20 Sep 2000 14:28:16 +1100 + +ash (0.3.7-3) unstable; urgency=low + + * Switch to the old globbing code since glob(3) is hopelessly broken + (closes: #69455). + + -- Herbert Xu Mon, 21 Aug 2000 20:37:15 +1000 + +ash (0.3.7-2) unstable; urgency=low + + * Call glob(3) with GLOB_NOMAGIC (ouch). + + -- Herbert Xu Sun, 6 Aug 2000 17:47:08 +1000 + +ash (0.3.7-1) unstable; urgency=low + + * NetBSD-current version as of 20000729. + * Use fnmatch(3) and glob(3). + * Fixed the use of backslashes in the pattern in parameter substitutions, + hopefully for the last time. + * Applied HETIO patch and built ash.medium (closes: #50788). Will do ash.big + when readline is fixed so that it doesn't leak anymore. + + -- Herbert Xu Fri, 4 Aug 2000 21:36:44 +1000 + +ash (0.3.6-5) unstable; urgency=low + + * Fixed manpage entry for read with patch from Kevin Ryde (closes: #62500). + * Fixed a file descriptor leak for pipelines. + + -- Herbert Xu Wed, 19 Apr 2000 18:56:20 +1000 + +ash (0.3.6-4) unstable; urgency=low + + * Fixed the case of an empty command with redirections. + + -- Herbert Xu Fri, 7 Apr 2000 12:07:18 +1000 + +ash (0.3.6-3) unstable; urgency=low + + * ! is now recognised correctly. + * Ash is now more strict on the syntax, e.g., a lone ! is no longer accepted + as an alternative to ! true. + + -- Herbert Xu Fri, 7 Apr 2000 10:46:06 +1000 + +ash (0.3.6-2) unstable; urgency=low + + * Fixed a problem with fmtstr() which broke getopts. + + -- Herbert Xu Sun, 2 Apr 2000 10:49:26 +1000 + +ash (0.3.6-1) unstable; urgency=low + + * NetBSD-current version as of 20000326. + * Added a Build-Depends on groff (closes: #61041). + * Implemented noclobber (closes: #59028). + * Rewrote output.c to use stream IO. + + -- Herbert Xu Sat, 1 Apr 2000 19:24:31 +1000 + +ash (0.3.5-10) frozen unstable; urgency=low + + * Don't stat mail boxes in non-interactive mode (closes: #59213). + * Added an fflush(stdout) to the times builtin (closes: #59027). + * Documented the times builtin. + * Added source depends. + + -- Herbert Xu Sat, 18 Mar 2000 18:58:44 +1100 + +ash (0.3.5-9) unstable; urgency=low + + * Double quotes inside paramater substitutions inside double quotes are now + ignored as in bash (the originial behaviour was POSIX compliant too but + IMHO this one makes a little bit more sense). + This one broke mwm (but it was actually mwm's fault). + * Corrected backslash/CTLESC treatment for patterns in parameter + substitutions. + + -- Herbert Xu Sat, 6 Nov 1999 18:13:19 +1100 + +ash (0.3.5-8) unstable; urgency=low + + * Replaced use of echo -n in manual page with escape codes. + * Made FHS compliant (closes: #47978). + * Restored echo's option processing ability. + + -- Herbert Xu Fri, 22 Oct 1999 10:20:58 +1000 + +ash (0.3.5-7) unstable; urgency=low + + * echo no longer supports options. + * Don't quote patterns inside parameter substitutions enclosed by double + quotes (closes: #47842). + + -- Herbert Xu Wed, 20 Oct 1999 20:28:14 +1000 + +ash (0.3.5-6) unstable; urgency=low + + * Use getcwd() instead of /bin/pwd -- Zack Weinberg (closes: #46981). + + -- Herbert Xu Sun, 10 Oct 1999 16:31:49 +1000 + +ash (0.3.5-5) unstable; urgency=low + + * Only test for -e on simple commands (fixes #44559). + + -- Herbert Xu Wed, 8 Sep 1999 22:18:27 +1000 + +ash (0.3.5-4) unstable; urgency=low + + * Don't wait for stopped children if job control is disabled (fixes #42814). + * Allow an option '(' in a case statement (fixes #42364). + + -- Herbert Xu Thu, 12 Aug 1999 23:30:30 +1000 + +ash (0.3.5-3) unstable; urgency=low + + * OK, the fix to the esoteric problem in 0.3.5-1 actually breaks VSASSIGN + and VSQUESTION, they should work properly now (fixes #41327). + + -- Herbert Xu Thu, 15 Jul 1999 22:47:13 +1000 + +ash (0.3.5-2) unstable; urgency=low + + * PATH search and execution is now correct. + * hash no longer shows builtins. + * Added kill builtin. + * New description from James R. van Zandt reformatted by Josip Rodin. + + -- Herbert Xu Mon, 12 Jul 1999 18:51:42 +1000 + +ash (0.3.5-1) unstable; urgency=low + + * New upstream release. + * Adapted to new pmake (fixes #38737). + * Fixed behvaiour of backslashes preceding a closing brace for a parameter + substituion inside double quotes (even bash messes this one up :). + * Fixed command (fixes #34639). + * Fixed a pipe bug where stdin may be wrongly closed (fixes #35452). + * Revamped getopts (fixes #39694). + + -- Herbert Xu Sun, 4 Jul 1999 12:19:01 +1000 + +ash (0.3.4-7) unstable; urgency=low + + * Fixed a glibc 2.1 compatitibility problem. + * Fixed a PWD inconsistency that stuffed up the kernel compilation. + + -- Herbert Xu Mon, 17 May 1999 23:14:57 +1000 + +ash (0.3.4-6) unstable; urgency=low + + * Fixed incorrect -e test due to the last bug fix (fixes #26509). + + -- Herbert Xu Tue, 8 Sep 1998 10:02:46 +1000 + +ash (0.3.4-5) unstable; urgency=low + + * Use test_eaccess from bash instead of access(2) (fixes #26110). + + -- Herbert Xu Wed, 26 Aug 1998 21:22:49 +1000 + +ash (0.3.4-4) unstable; urgency=low + + * Only upload to unstable. + + -- Herbert Xu Tue, 5 May 1998 18:01:02 +1000 + +ash (0.3.4-3) frozen unstable; urgency=low + + * Applied sparc patch (fixes #21562). + + -- Herbert Xu Fri, 1 May 1998 19:48:13 +1000 + +ash (0.3.4-2) frozen unstable; urgency=low + + * Fixed the incorrect trap fixes (fixes #20363). + + -- Herbert Xu Thu, 16 Apr 1998 21:07:10 +1000 + +ash (0.3.4-1) unstable; urgency=low + + * New upstream release. + * Reverted word splitting change in 0.3.2-1 since the fix was broken and + major work (the quote removal is done too quickly at the moment) is needed + to fix it properly. + * Fixed more trap noncompliance. + + -- Herbert Xu Thu, 19 Mar 1998 22:59:12 +1100 + +ash (0.3.2-5) unstable; urgency=low + + * Fixed a bug when doing pattern matching in parameter expansions. + + -- Herbert Xu Tue, 10 Mar 1998 21:25:40 +1100 + +ash (0.3.2-4) unstable; urgency=low + + * Allow ] to be quoted in bracket expressions (fixes #17533). + * Move dh_fixperms to second last spot (fixes #18267). + * Don't do field splitting in evalfor. + + -- Herbert Xu Tue, 17 Feb 1998 13:32:09 +1100 + +ash (0.3.2-3) unstable; urgency=low + + * Fixed stupid core dump. + + -- Herbert Xu Wed, 11 Feb 1998 21:33:55 +1100 + +ash (0.3.2-2) unstable; urgency=low + + * Hack for special builtins (fixes #18055). + * Hack for command. + + -- Herbert Xu Wed, 11 Feb 1998 21:19:46 +1100 + +ash (0.3.2-1) unstable; urgency=low + + * NetBSD-current version as of 19980209. + * Fixed a word splitting problem after parameter expansion thanks to Alexey + Marinichev. + * Converted to debhelper (fixes #14612, #15005). + + -- Herbert Xu Mon, 9 Feb 1998 16:53:48 +1100 + +ash (0.3.1-20) unstable; urgency=low + + * Fixed -e problem with eval. + + -- Herbert Xu Sun, 7 Dec 1997 20:19:00 +1100 + +ash (0.3.1-19) unstable; urgency=low + + * Fixed -e problem with command substitution. + + -- Herbert Xu Sun, 7 Dec 1997 19:44:49 +1100 + +ash (0.3.1-18) unstable; urgency=low + + * Do not link with ncurses (#15485). + + -- Herbert Xu Sun, 30 Nov 1997 12:00:11 +1100 + +ash (0.3.1-17) unstable; urgency=low + + * Set PATH like bash (#15238). + + -- Herbert Xu Wed, 26 Nov 1997 16:17:27 +1100 + +ash (0.3.1-16) unstable; urgency=low + + * Fixed incorrect assignment builtin code. + + -- Herbert Xu Mon, 24 Nov 1997 16:19:10 +1100 + +ash (0.3.1-15) unstable; urgency=low + + * hash now returns error codes (needed by the Linux kernel). + + -- Herbert Xu Sun, 23 Nov 1997 21:37:08 +1100 + +ash (0.3.1-14) unstable; urgency=low + + * Disabled word-splitting for assignment builtins. + + -- Herbert Xu Sun, 23 Nov 1997 12:45:15 +1100 + +ash (0.3.1-13) unstable; urgency=low + + * ! is now recognised even after &&/||. + + -- Herbert Xu Fri, 21 Nov 1997 22:09:05 +1100 + +ash (0.3.1-12) unstable; urgency=low + + * More fixes to the handling of SIGINT when forking. + + -- Herbert Xu Fri, 14 Nov 1997 15:14:32 +1100 + +ash (0.3.1-11) unstable; urgency=low + + * Ignore SIGINT when forking non-interactively. + + -- Herbert Xu Mon, 3 Nov 1997 12:00:02 +1100 + +ash (0.3.1-10) unstable; urgency=low + + * echo now handles options correctly. + * echo nolonger returns 0 if erorrs occured while writing to stdout. + * New code from GNU echo merged. + * Error messages from test now work. + + -- Herbert Xu Wed, 8 Oct 1997 21:47:13 +1000 + +ash (0.3.1-9) unstable; urgency=low + + * ! is recognised at pipeline level like bash. + + -- Herbert Xu Mon, 15 Sep 1997 23:13:45 +1000 + +ash (0.3.1-8) unstable; urgency=medium + + * Old patch regarding SIGCHLD in again. + + -- Herbert Xu Sun, 31 Aug 1997 11:20:27 +1000 + +ash (0.3.1-7) unstable; urgency=low + + * /bin/sh -e is behaving even better now (for loops within conditionals). + + -- Herbert Xu Sat, 23 Aug 1997 22:08:19 +1000 + +ash (0.3.1-6) unstable; urgency=low + + * /bin/sh -e is behaving better now. + + -- Herbert Xu Sat, 23 Aug 1997 13:16:26 +1000 + +ash (0.3.1-5) unstable; urgency=low + + * hash -v /dir/command doesn't coredump anymore. + * type /dir/command now works correctly. + + -- Herbert Xu Fri, 1 Aug 1997 20:48:19 +1000 + +ash (0.3.1-4) unstable; urgency=low + + * trap now understands symbolic signal names. + + -- Herbert Xu Sat, 26 Jul 1997 14:04:46 +1000 + +ash (0.3.1-3) unstable; urgency=low + + * Added the builtin test command. + + -- Herbert Xu Sun, 20 Jul 1997 15:00:14 +1000 + +ash (0.3.1-2) unstable; urgency=medium + + * Fixed a coredump involving $*. + + -- Herbert Xu Sat, 19 Jul 1997 12:03:02 +1000 + +ash (0.3.1-1) unstable; urgency=medium + + * NetBSD-current version as of 19970715. + * Fixed a "use after free" bug (#11294). + + -- Herbert Xu Fri, 18 Jul 1997 13:48:09 +1000 + +ash (0.3-1) unstable; urgency=low + + * Initial Release. + + -- Herbert Xu Thu, 19 Jun 1997 19:29:16 +1000 + --- dash-0.5.6.1.orig/debian/control +++ dash-0.5.6.1/debian/control @@ -0,0 +1,30 @@ +Source: dash +Section: shells +Priority: optional +Maintainer: Gerrit Pape +Build-Depends: po-debconf +Standards-Version: 3.8.4.0 +Homepage: http://gondor.apana.org.au/~herbert/dash/ +Vcs-Git: http://smarden.org/git/dash.git/ + +Package: dash +Architecture: any +Essential: yes +Priority: required +Pre-Depends: ${shlibs:Depends} +Depends: debianutils (>= 2.15), dpkg (>= 1.15.0) +Description: POSIX-compliant shell + The Debian Almquist Shell (dash) is a POSIX-compliant shell derived + from ash. + . + Since it executes scripts faster than bash, and has fewer library + dependencies (making it more robust against software or hardware + failures), it is used as the default system shell on Debian systems. + +Package: ash +Architecture: all +Pre-Depends: dash +Description: compatibility package for dash + This package allows upgrading ash to its replacement, + dash. It includes the /bin/ash symlink. + It can be removed as soon as /bin/ash is no longer used. --- dash-0.5.6.1.orig/debian/copyright +++ dash-0.5.6.1/debian/copyright @@ -0,0 +1,70 @@ +This package was debianized by Mark W. Eichin eichin@kitten.gen.ma.us on +Mon, 24 Feb 1997 16:00:16 -0500. + +This package was re-ported from NetBSD and debianized by +Herbert Xu herbert@debian.org on Thu, 19 Jun 1997 19:29:16 +1000. + +This package was adopted by Gerrit Pape on +Fri, 28 May 2004 18:38:18 +0000. + +It was downloaded from http://gondor.apana.org.au/~herbert/dash/files/ + +Copyright: + +Copyright (c) 1989-1994 + The Regents of the University of California. All rights reserved. +Copyright (c) 1997 Christos Zoulas. All rights reserved. +Copyright (c) 1997-2005 + Herbert Xu . All rights reserved. + +This code is derived from software contributed to Berkeley by Kenneth Almquist. + + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. Neither the name of the University nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +mksignames.c: + +This file is not directly linked with dash. However, its output is. + +Copyright (C) 1992 Free Software Foundation, Inc. + +This file is part of GNU Bash, the Bourne Again SHell. + +Bash is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +Bash is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License with +your Debian GNU/Linux system, in /usr/share/common-licenses/GPL, or with the +Debian GNU/Linux hello source package as the file COPYING. If not, +write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, +Boston, MA 02111 USA. + --- dash-0.5.6.1.orig/debian/dash.NEWS.Debian +++ dash-0.5.6.1/debian/dash.NEWS.Debian @@ -0,0 +1,10 @@ +dash (0.5.5.1-2.1) unstable; urgency=low + + * The default system shell (/bin/sh) has been changed to dash for + new installations. When upgrading existing installations, the + system shell will not be changed automatically. + * One can see what the current default system shell on this machine + is by running 'readlink /bin/sh'. + * Change it by running 'dpkg-reconfigure dash'. + + -- Luk Claes Wed, 22 Jul 2009 17:23:20 +0200 --- dash-0.5.6.1.orig/debian/dash.README.source +++ dash-0.5.6.1/debian/dash.README.source @@ -0,0 +1,84 @@ +Dash sources for Debian +----------------------- + +The dash Debian package sources are available through git, and +through 'apt-get source dash'. Getting the sources through git +should be preferred: + + # apt-get install git # if not yet done + + $ git clone http://smarden.org/git/dash.git/ + $ cd dash + +After cloning the repository, you have checked out the debian-sid +branch, ready to be used by dpkg-buildpackage, e.g. + + $ dpkg-buildpackage -i -rfakeroot -uc -us + +If you want to make changes in the ./debian/ subdirectory, this is the +correct branch to work on. After making changes, document them in +debian/changelog, and commit through 'git add' and 'git commit', or 'git +commit -a', or similar. If you think the changes should be incorporated +into the standard Debian package, create the patch[es] through 'git +format-patch', and send them to the Debian Bug Tracking System, e.g. + + $ vi debian/rules + $ debchange -pi + $ git commit -a + $ git format-patch HEAD^ + + +If you want to make changes to the upstream dash sources, first checkout +the release+patches branch + + $ git checkout -b release+patches origin/release+patches + +The release+patches branch holds patches on top of the current release +version that is packaged for Debian/unstable. The current release +version is available in the release branch. If you are interested, you +can checkout this branch too + + $ git checkout -b release origin/release + +When releasing a new Debian package based on a new upstream release, the +release branch will be fastforwarded, and the release+patches branch is +rewound and rebased onto the new HEAD of the release branch. This is +done by, e.g. + + $ git checkout release + $ git merge v0.5.5 + $ git checkout release+patches + $ git rebase release + +You generally don't need to do that, but beware that the release+patches +branch is rewound occasionally. + +After checking out the release+patches branch, make the desired changes +to the upstream sources, and commit them. To integrate the changes into +the Debian package, extract these changes, and change to the debian-sid +branch (Note: the file extension for the patches is '.diff', use 'git +config --add format.suffix .diff' to make that the default) + + $ git format-patch release..release+patches + $ git checkout debian-sid + +Now move the extracted patches into the debian/diff/ directory, add a +meaningful message to debian/changelog, and commit the changes to the +debian-sid branch + + $ mv ????-*.diff debian/diff/ + $ git add debian/diff + $ debchange -pi + $ git add debian/changelog + $ git commit + +Again, if you think the changes should be incorporated into the standard +Debian package, create the patch[es] from the debian-sid branch through +'git format-patch', send them to the Debian Bug Tracking System. + +There's a mailing list to coordinate work on the dash packages, if +you're interested in helping please subscribe to the + mailing list by sending an email to +. + + -- Gerrit Pape Fri, 04 Jun 2010 00:22:12 +0000 --- dash-0.5.6.1.orig/debian/dash.config +++ dash-0.5.6.1/debian/dash.config @@ -0,0 +1,45 @@ +#!/bin/sh +# +# debconf script for the Debian GNU/Linux ash package +# +# $Id: dash.config,v 1.1 2002/09/14 06:17:50 herbert Exp $ + +set -e + +. /usr/share/debconf/confmodule + +db_version 2.0 + +if [ "$1" = configure ] && [ -z "$2" ]; then + set +e + db_fget ash/sh seen + err=$? + set -e + + case $err in + 0) + if [ "$RET" = true ]; then + db_fset dash/sh seen true + db_get ash/sh + db_set dash/sh "$RET" + exit + fi + ;; + 10) + # ash/sh does not exist + ;; + *) + echo "db_fget exited with $err" >&2 + exit $err + ;; + esac +fi + +# if "configuring and for the first time and bash is already installed" +if [ "$1" = configure ] && [ -z "$2" ] && dpkg-query -W bash >/dev/null; then + # bash is pulling in dash + db_input high dash/sh || true +else + db_input low dash/sh || true +fi +db_go --- dash-0.5.6.1.orig/debian/dash.docs +++ dash-0.5.6.1/debian/dash.docs @@ -0,0 +1 @@ +debian/README.Debian.diet --- dash-0.5.6.1.orig/debian/dash.menu +++ dash-0.5.6.1/debian/dash.menu @@ -0,0 +1,5 @@ +?package(dash): \ + title="Dash"\ + needs="text"\ + section="Applications/Shells"\ + command="/bin/dash -i" --- dash-0.5.6.1.orig/debian/dash.postinst +++ dash-0.5.6.1/debian/dash.postinst @@ -0,0 +1,143 @@ +#!/bin/sh +set -e + +# $1: dfile, $2: link target, $3: distrib +replace_with_link() { + dfile=$1; ltarget=$2; distrib=$3 + temp=$dfile.tmp + # Safely create a symlink to $ltarget at $dfile, first + # making a backup of $dfile (the file being diverted) + # in $distrib. + # + # The cp / ln -s / mv dance avoids having to live without + # $dfile (think: /bin/sh) for even a moment, so applications + # running in parallel can continue without trouble. + # See dash.preinst for details. + if [ -e "$dfile" ]; then + cp -dp "$dfile" "$distrib" + fi + ln -sf "$ltarget" "$temp" + mv -f "$temp" "$dfile" +} + +# $1: case, $2: dfile, $3: ltarget [, $4: distrib] +check_divert() { + dfile=$2; ltarget=$3 + distrib=${4:-$dfile.distrib} + diverter=$(dpkg-divert --listpackage $dfile) + truename=$(dpkg-divert --truename $dfile) + case "$1" in + true) + if [ "$diverter" != dash ]; then + # Let dpkg-divert error out; we are not taking + # over the diversion, unless we added it + # ourselves on behalf of bash. + if [ "$diverter" = bash ]; then + dpkg-divert --package bash --remove $dfile + else + dpkg-divert --package dash --remove $dfile + # Make sure we die: + echo "This should never be reached" + exit 1 + fi + + dpkg-divert --package dash --divert $distrib --add $dfile + # remove the old equivalent of $distrib, if it existed: + # or $dfile if there was no previous diversion! -- should never happen, unless preinst failed + if [ -n "$truename" ]; then + rm -f "$truename" + fi + replace_with_link $dfile $ltarget $distrib + fi + ;; + false) + if [ "$diverter" = dash ]; then + # Simple hack. We also divert sh(1), remember? + bash=$(echo "$ltarget"|sed 's/dash/bash/') + dpkg-divert --package dash --remove $dfile + # The diversion is added as if we were bash, leaving + # no diversion would lead to a file conflict later + # when re-checked by dpkg + dpkg-divert --package bash --divert $distrib --add $dfile + # ugh? $truename should always be set (to $distrib) + if [ -n "$truename" ]; then + rm -f "$truename" + fi + # Point everything back to bash + replace_with_link $dfile $bash $distrib + fi + ;; + ash) + # Code not modified by the NMU: + div=$(dpkg-divert --list $2) + case $div in + '') + ;; + *by\ ash) + dst=${div% by ash} + dst=${dst##* to } + + # Work around dpkg-divert bug. + if [ -e "$dst" ]; then + mv "$dst" "$dst.dash-tmp" + fi + dpkg-divert --package ash --remove $2 + if [ -e "$dst.dash-tmp" ]; then + mv "$dst.dash-tmp" "$dst" + fi + + dpkg-divert --package dash --divert $distrib --add $2 + if [ "$dst" != $distrib ] && [ -e "$dst" ]; then + mv "$dst" $distrib + fi + ln -sf $3 $2.tmp + mv -f $2.tmp $2 + ;; + *) + d=${2%/*} + if + [ -h $2 ] && [ -f $2 ] && [ -f $d/$5 ] && + cmp $2 $d/$5 + then + ln -sf $3 $2.tmp + mv -f $2.tmp $2 + fi + ;; + esac + esac +} + +add_shell() { + if ! type add-shell > /dev/null 2>&1; then + return + fi + + add-shell /bin/dash +} + +debconf= +if [ -f /usr/share/debconf/confmodule ]; then + . /usr/share/debconf/confmodule + debconf=yes +fi + +if [ "$1" = configure ] && [ -z "$2" ]; then + check_divert ash /bin/sh dash '' ash + check_divert ash /usr/share/man/man1/sh.1.gz dash.1.gz \ + /usr/share/man/man1/sh.distrib.1.gz ash.1.gz + add_shell +elif [ "$1" = configure ] && dpkg --compare-versions "$2" lt 0.4.18; then + add_shell +fi + +if [ $debconf ]; then + db_get dash/sh + check_divert "$RET" /bin/sh dash + check_divert "$RET" /usr/share/man/man1/sh.1.gz dash.1.gz \ + /usr/share/man/man1/sh.distrib.1.gz +fi + +test "$1" = 'configure' || exit 0 +test -x /usr/bin/update-menus || exit 0 +test -z "$2" || dpkg --compare-versions "$2" lt 0.5.2-3 || exit 0 +exec update-menus --- dash-0.5.6.1.orig/debian/dash.postrm +++ dash-0.5.6.1/debian/dash.postrm @@ -0,0 +1,10 @@ +#!/bin/sh +set -e + +test "$1" != 'upgrade' || dpkg --compare-versions "$2" ge 0.5.2-3 || \ + test ! -x /usr/bin/update-menus || exec update-menus +test "$1" != 'remove' || test ! -x /usr/bin/update-menus || exec update-menus +test "$1" = 'purge' || exit 0 +test -e /usr/share/debconf/confmodule || exit 0 +. /usr/share/debconf/confmodule +db_purge --- dash-0.5.6.1.orig/debian/dash.preinst +++ dash-0.5.6.1/debian/dash.preinst @@ -0,0 +1,32 @@ +#!/bin/bash +set -e + +divert() { + dfile=$1 + ltarget=$2 + div=$(dpkg-divert --list $dfile) + distrib=${3:-$dfile.distrib} + temp=$dfile.tmp + if [ -z "$div" ]; then + # This differs from dpkg-divert's --rename because we + # first make a copy of $dfile (the file being diverted) + # in $distrib. Then, a symlink to $ltarget is forcibly created + # from $dfile; this is performed in two stages with an + # intermediate temporary file as ln -sf is not atomic. + # dpkg-divert's --rename direct equivalent would be: + # mv $dfile $distrib -- but we could end up without a symlink + if [ -e $dfile ]; then + cp -dp $dfile $distrib + fi + ln -sf $ltarget $temp + mv -f $temp $dfile + dpkg-divert --package dash --divert $distrib --add $dfile + fi +} + +# Divert the following files if no diversion exists already +# It is currently used to prevent the files collision between bash and +# dash: they both provide the files in the package. +divert /bin/sh dash +divert /usr/share/man/man1/sh.1.gz dash.1.gz \ + /usr/share/man/man1/sh.distrib.1.gz --- dash-0.5.6.1.orig/debian/dash.prerm +++ dash-0.5.6.1/debian/dash.prerm @@ -0,0 +1,31 @@ +#!/bin/sh +# +# pre-removal script for the Debian GNU/Linux ash package +# +# $Id: dash.prerm,v 1.2 2003/09/03 10:42:08 herbert Exp $ + +set -e + +remove_divert() { + diverter=$(dpkg-divert --listpackage $1) + if [ "$diverter" = "dash" ]; then + dpkg-divert --package dash --rename --remove $1 + fi +} + +remove_shell() { + if ! type remove-shell > /dev/null 2>&1; then + return + fi + + remove-shell /bin/dash +} + +if [ "$1" = remove ] || [ "$1" = deconfigure ]; then + remove_divert /bin/sh + remove_divert /usr/share/man/man1/sh.1.gz +fi + +if [ "$1" = remove ]; then + remove_shell +fi --- dash-0.5.6.1.orig/debian/dash.templates.in +++ dash-0.5.6.1/debian/dash.templates.in @@ -0,0 +1,23 @@ +# These templates have been reviewed by the debian-l10n-english +# team +# +# If modifications/additions/rewording are needed, please ask +# debian-l10n-english@lists.debian.org for advice. +# +# Even minor modifications require translation updates and such +# changes should be coordinated with translators and reviewers. +Template: dash/sh +Type: boolean +Default: true +_Description: Use dash as the default system shell (/bin/sh)? + The system shell is the default command interpreter for shell scripts. + . + Using dash as the system shell will improve the system's overall + performance. It does not alter the shell presented to interactive + users. +# _Description: Install dash as /bin/sh? +# The default /bin/sh shell on Debian and Debian-based systems is bash. +# . +# However, since the default shell is required to be POSIX-compliant, +# any shell that conforms to POSIX, such as dash, can serve as /bin/sh. +# You may wish to do this because dash is faster and smaller than bash. --- dash-0.5.6.1.orig/debian/implicit +++ dash-0.5.6.1/debian/implicit @@ -0,0 +1,96 @@ +# $Id: 60d9070435b8d5608f20f60bc44e081960b6e39d $ + +.PHONY: deb-checkdir deb-checkuid + +deb-checkdir: + @test -e debian/control || sh -cx '! : wrong directory' +deb-checkuid: + @test "`id -u`" -eq 0 || sh -cx '! : need root privileges' + +%.deb: %.deb-docs %.deb-DEBIAN + @rm -f $*.deb $*.deb-checkdir $*.deb-docs $*.deb-docs-base \ + $*.deb-docs-docs $*.deb-docs-examples $*.deb-DEBIAN \ + $*.deb-DEBIAN-dir $*.deb-DEBIAN-scripts $*.deb-DEBIAN-md5sums + +%.udeb: %.deb-DEBIAN + @rm -f $*.deb $*.deb-checkdir $*.deb-DEBIAN $*.deb-DEBIAN-dir \ + $*.deb-DEBIAN-scripts $*.deb-DEBIAN-md5sums + +%.deb-checkdir: install + @test -d debian/$* || sh -cx '! : directory debian/$* missing' + @test "`id -u`" -eq 0 || sh -cx '! : need root privileges' + +%.deb-docs-base: install + : implicit + @rm -f debian/$*/usr/share/doc/$*/* || : + @install -d -m0755 debian/$*/usr/share/doc/$* + : debian/$*/usr/share/doc/$*/ + @sh -cx 'install -m0644 debian/copyright debian/$*/usr/share/doc/$*/' + @sh -cx 'install -m0644 debian/changelog \ + debian/$*/usr/share/doc/$*/changelog.Debian' + @test ! -r changelog || \ + sh -cx 'install -m0644 changelog debian/$*/usr/share/doc/$*/' + @test -r debian/$*/usr/share/doc/$*/changelog || \ + sh -cx 'mv debian/$*/usr/share/doc/$*/changelog.Debian \ + debian/$*/usr/share/doc/$*/changelog' + @test -s debian/$*/usr/share/doc/$*/changelog || \ + sh -cx 'rm -f debian/$*/usr/share/doc/$*/changelog' + @gzip -9 debian/$*/usr/share/doc/$*/changelog* +%.deb-docs-docs: %.deb-docs-base + @for i in `cat debian/$*.docs 2>/dev/null || :`; do \ + if test -d $$i; then \ + sh -cx "install -d -m0755 debian/$*/usr/share/doc/$*/$${i##*/}" && \ + for j in $$i/*; do \ + sh -cx "install -m0644 $$j \ + debian/$*/usr/share/doc/$*/$${i##*/}/" || exit 1; \ + done || exit 1; \ + continue; \ + fi; \ + sh -cx "install -m0644 $$i debian/$*/usr/share/doc/$*/" || exit 1; \ + done + @test ! -r debian/$*.README.Debian || \ + sh -cx 'install -m0644 debian/$*.README.Debian \ + debian/$*/usr/share/doc/$*/README.Debian' + @test ! -r debian/$*.README.source || \ + sh -cx 'install -m0644 debian/$*.README.source \ + debian/$*/usr/share/doc/$*/README.source' + @if test -r debian/$*.NEWS.Debian; then \ + sh -cx 'install -m0644 debian/$*.NEWS.Debian \ + debian/$*/usr/share/doc/$*/NEWS.Debian && \ + gzip -9 debian/$*/usr/share/doc/$*/NEWS.Debian'; \ + fi +%.deb-docs-examples: %.deb-docs-docs + @rm -rf debian/$*/usr/share/doc/$*/examples + : debian/$*/usr/share/doc/$*/examples/ + @test ! -r debian/$*.examples || \ + install -d -m0755 debian/$*/usr/share/doc/$*/examples + @for i in `cat debian/$*.examples 2>/dev/null || :`; do \ + sh -cx "install -m0644 $$i debian/$*/usr/share/doc/$*/examples/" \ + || exit 1; \ + done +%.deb-docs: %.deb-checkdir %.deb-docs-base %.deb-docs-docs %.deb-docs-examples + : debian/$*/usr/share/doc/$*/ ok + +%.deb-DEBIAN-base: install + @rm -rf debian/$*/DEBIAN + : debian/$*/DEBIAN/ + @install -d -m0755 debian/$*/DEBIAN + @for i in conffiles shlibs templates; do \ + test ! -r debian/$*.$$i || \ + sh -cx "install -m0644 debian/$*.$$i debian/$*/DEBIAN/$$i" \ + || exit 1; \ + done +%.deb-DEBIAN-scripts: %.deb-DEBIAN-base + @for i in preinst prerm postinst postrm config; do \ + test ! -r debian/$*.$$i || \ + sh -cx "install -m0755 debian/$*.$$i debian/$*/DEBIAN/$$i" \ + || exit 1; \ + done +%.deb-DEBIAN-md5sums: %.deb-DEBIAN-base %.deb-docs + : debian/$*/DEBIAN/md5sums + @rm -f debian/$*/DEBIAN/md5sums + @cd debian/$* && find * -path 'DEBIAN' -prune -o \ + -type f -exec md5sum {} >>DEBIAN/md5sums \; +%.deb-DEBIAN: %.deb-checkdir %.deb-DEBIAN-base %.deb-DEBIAN-scripts \ + %.deb-DEBIAN-md5sums + : debian/$*/DEBIAN/ ok --- dash-0.5.6.1.orig/debian/rules +++ dash-0.5.6.1/debian/rules @@ -0,0 +1,98 @@ +#!/usr/bin/make -f + +CC =gcc +CFLAGS =-g -O2 -Wall +STRIP =strip + +DEB_HOST_GNU_TYPE =$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE =$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) + CC =$(DEB_HOST_GNU_TYPE)-gcc +endif + +ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS))) + CC =diet -v -Os gcc + CFLAGS =-nostdinc -Wall +endif +ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) + STRIP =: strip +endif + +DIR =$(shell pwd)/debian/dash +DIRA =$(shell pwd)/debian/ash + +patch: deb-checkdir patch-stamp +patch-stamp: + for i in `ls -1 debian/diff/*.diff || :`; do \ + patch -p1 <$$i || exit 1; \ + done + touch patch-stamp + +configure: deb-checkdir configure-stamp +configure-stamp: patch-stamp + mkdir -p build-tmp + touch configure + (cd build-tmp && CC='$(CC)' CFLAGS='$(CFLAGS)' \ + exec ../configure --host='$(DEB_HOST_GNU_TYPE)') + touch configure-stamp + +build: deb-checkdir build-stamp +build-stamp: configure-stamp + -$(CC) -v + (cd build-tmp && exec $(MAKE) CFLAGS='$(CFLAGS)') || \ + (cat build-tmp/config.log; exit 1) || exit 1 + touch build-stamp + +po-templates: po-templates-stamp +po-templates-stamp: deb-checkdir + po2debconf debian/dash.templates.in >debian/dash.templates + touch po-templates-stamp + +clean: deb-checkdir deb-checkuid + rm -rf build-tmp + test ! -e patch-stamp || \ + for i in `ls -1r debian/diff/*.diff || :`; do patch -p1 -R <$$i; done + rm -f configure-stamp patch-stamp build-stamp po-templates-stamp + rm -rf '$(DIR)' '$(DIRA)' + rm -f debian/files debian/substvars debian/dash.templates changelog + +install: install-indep install-arch +install-indep: deb-checkdir deb-checkuid + rm -rf '$(DIRA)' + install -d -m0755 '$(DIRA)'/bin + ln -s dash '$(DIRA)'/bin/ash + install -d -m0755 '$(DIRA)'/usr/share/man/man1/ + ln -s dash.1.gz '$(DIRA)'/usr/share/man/man1/ash.1.gz + # changelog + test -r changelog || ln -s ChangeLog changelog +install-arch: deb-checkdir deb-checkuid build-stamp + # dash + rm -rf '$(DIR)' + install -d -m0755 '$(DIR)'/bin + install -m0755 build-tmp/src/dash '$(DIR)'/bin/dash + $(STRIP) -R .comment -R .note '$(DIR)'/bin/dash + ln -s dash '$(DIR)'/bin/sh + install -d -m0755 '$(DIR)'/usr/share/man/man1/ + install -m0644 src/dash.1 '$(DIR)'/usr/share/man/man1/dash.1 + gzip -9 '$(DIR)'/usr/share/man/man1/dash.1 + ln -s dash.1.gz '$(DIR)'/usr/share/man/man1/sh.1.gz + install -d -m0755 '$(DIR)'/usr/share/menu + install -m0644 debian/dash.menu '$(DIR)'/usr/share/menu/dash + # changelog + test -r changelog || ln -s ChangeLog changelog + +binary: binary-indep binary-arch +binary-indep: install-indep ash.deb + dpkg-gencontrol -isp -pash -P'$(DIRA)' + dpkg -b '$(DIRA)' .. +binary-arch: install-arch po-templates dash.deb + # dash + rm -f debian/substvars + test '$(CC)' != 'gcc' || dpkg-shlibdeps '$(DIR)'/bin/dash + dpkg-gencontrol -isp -pdash -P'$(DIR)' + dpkg -b '$(DIR)' .. + +.PHONY: configure build po-templates clean patch install install-indep \ + install-arch binary binary-indep binary-arch + +include debian/implicit --- dash-0.5.6.1.orig/debian/watch +++ dash-0.5.6.1/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://gondor.apana.org.au/~herbert/dash/files/dash-([\d.]+)\.tar\.gz --- dash-0.5.6.1.orig/debian/diff/0001-BUILTIN-Use-faccessat-if-available.diff +++ dash-0.5.6.1/debian/diff/0001-BUILTIN-Use-faccessat-if-available.diff @@ -0,0 +1,125 @@ +From f7773da6809b99dd6c7da41866252c17e0dd2c89 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Fri, 2 Apr 2010 22:02:22 +0800 +Subject: [BUILTIN] Use faccessat if available + +Eric Blake suggested that we should use faccessat so that ACLs +and other corner cases are handled correctly. This patch does +exactly that. + +Note that faccessat doesn't handle ACLs when euid != uid, as +this case is currently implemented by glibc instead of the kernel, +using code similar to the existing dash test. + +Signed-off-by: Herbert Xu +(cherry picked from commit 1d68712ba2e439f36874c4ed1e3d9ffec177a06c) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + configure.ac | 3 ++- + src/bltin/test.c | 22 ++++++++++++++++++++++ + 3 files changed, 28 insertions(+), 1 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 21218b9..a3c1242 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-04-02 Herbert Xu ++ ++ * Use faccessat if available. ++ + 2010-06-05 Herbert Xu + + * Release 0.5.6.1. +diff --git a/configure.ac b/configure.ac +index 05cd2e1..c53c27e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -46,7 +46,8 @@ dnl Checks for header files. + AC_CHECK_HEADERS(alloca.h) + + dnl Checks for library functions. +-AC_CHECK_FUNCS(bsearch getpwnam getrlimit imaxdiv isalpha killpg mempcpy \ ++AC_CHECK_FUNCS(bsearch faccessat getpwnam getrlimit imaxdiv isalpha killpg \ ++ mempcpy \ + sigsetmask stpcpy strchrnul strsignal strtod strtoimax \ + strtoumax sysconf) + +diff --git a/src/bltin/test.c b/src/bltin/test.c +index 8e7077a..7888f38 100644 +--- a/src/bltin/test.c ++++ b/src/bltin/test.c +@@ -11,6 +11,7 @@ + #include + #include + ++#include + #include + #include + #include +@@ -147,8 +148,12 @@ static int isoperand(char **); + static int newerf(const char *, const char *); + static int olderf(const char *, const char *); + static int equalf(const char *, const char *); ++#ifdef HAVE_FACCESSAT ++static int test_file_access(const char *, int); ++#else + static int test_st_mode(const struct stat64 *, int); + static int bash_group_member(gid_t); ++#endif + + static inline intmax_t getn(const char *s) + { +@@ -295,6 +300,14 @@ primary(enum token n) + return strlen(*t_wp) != 0; + case FILTT: + return isatty(getn(*t_wp)); ++#ifdef HAVE_FACCESSAT ++ case FILRD: ++ return test_file_access(*t_wp, R_OK); ++ case FILWR: ++ return test_file_access(*t_wp, W_OK); ++ case FILEX: ++ return test_file_access(*t_wp, X_OK); ++#endif + default: + return filstat(*t_wp, n); + } +@@ -364,12 +377,14 @@ filstat(char *nm, enum token mode) + return 0; + + switch (mode) { ++#ifndef HAVE_FACCESSAT + case FILRD: + return test_st_mode(&s, R_OK); + case FILWR: + return test_st_mode(&s, W_OK); + case FILEX: + return test_st_mode(&s, X_OK); ++#endif + case FILEXIST: + return 1; + case FILREG: +@@ -469,6 +484,12 @@ equalf (const char *f1, const char *f2) + b1.st_ino == b2.st_ino); + } + ++#ifdef HAVE_FACCESSAT ++static int test_file_access(const char *path, int mode) ++{ ++ return !faccessat(AT_FDCWD, path, mode, AT_EACCESS); ++} ++#else /* HAVE_FACCESSAT */ + /* + * Similar to what access(2) does, but uses the effective uid and gid. + * Doesn't make the mistake of telling root that any file is executable. +@@ -519,3 +540,4 @@ bash_group_member(gid_t gid) + + return (0); + } ++#endif /* HAVE_FACCESSAT */ +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0002-JOBS-Fix-for-job-control-off-warning.diff +++ dash-0.5.6.1/debian/diff/0002-JOBS-Fix-for-job-control-off-warning.diff @@ -0,0 +1,47 @@ +From 8bd7e076bc3ad047cdf814d1f003e41fc78fef78 Mon Sep 17 00:00:00 2001 +From: H. Peter Anvin +Date: Thu, 15 Apr 2010 13:50:27 +0800 +Subject: [JOBS] Fix for job control off warning + +There seems to be a problem with the new version of dash +with job control off. I can't tell if it is just a warning or is a +manifest bug. + +usr/dash/trap.c: In function `exitshell': +usr/dash/trap.c:376: warning: suggest braces around empty body in an `if' statement + +Signed-off-by: Herbert Xu +(cherry picked from commit dc2bc17c7bbe3188cfb0c695dc472b39bcf0b27a) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/jobs.h | 2 +- + 2 files changed, 5 insertions(+), 1 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index a3c1242..cc47e28 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-04-15 H. Peter Anvin ++ ++ * Fix for job control off warning. ++ + 2010-04-02 Herbert Xu + + * Use faccessat if available. +diff --git a/src/jobs.h b/src/jobs.h +index 26e421d..9c095ea 100644 +--- a/src/jobs.h ++++ b/src/jobs.h +@@ -105,5 +105,5 @@ int waitforjob(struct job *); + int stoppedjobs(void); + + #if ! JOBS +-#define setjobctl(on) /* do nothing */ ++#define setjobctl(on) ((void)(on)) /* do nothing */ + #endif +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0003-EVAL-Fix-command-crash.diff +++ dash-0.5.6.1/debian/diff/0003-EVAL-Fix-command-crash.diff @@ -0,0 +1,39 @@ +From 8c7b96f0d196259ac73614ec2483921a224d4229 Mon Sep 17 00:00:00 2001 +From: Gerrit Pape +Date: Mon, 3 May 2010 11:14:47 +0800 +Subject: [EVAL] Fix command -- crash + +parse_command_args() returning a **argv pointer with *argv == 0 makes +dash segfault in find_command(). To reproduce run + + dash -c 'command --' + +With this commit, parse_command_args() returns 0 if *argv is null after +parsing --, and so fixes the subsequent segfault. + +Reported by Jonny through http://bugs.debian.org/579543 + +Signed-off-by: Gerrit Pape +Signed-off-by: Herbert Xu +(cherry picked from commit 18071c7b6a847a7d8703c261eea522d5398fee90) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index cc47e28..57f2661 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-05-03 Gerrit Pape ++ ++ * Fix command -- crash. ++ + 2010-04-15 H. Peter Anvin + + * Fix for job control off warning. +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0004-VAR-Add-localvars-nesting.diff +++ dash-0.5.6.1/debian/diff/0004-VAR-Add-localvars-nesting.diff @@ -0,0 +1,185 @@ +From d27d1bb161f5c21fff2f065c47d967b60cf1753e Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Mon, 24 May 2010 15:31:27 +0800 +Subject: [VAR] Add localvars nesting + +This patch adds localvars nesting infrastructure so we can reuse +the localvars mechanism for command evaluation. + +Signed-off-by: Herbert Xu +(cherry picked from commit 0f1ffe0925ef6aff9c56a3a4ca7b84b7411fc2b4) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/eval.c | 7 ++----- + src/var.c | 50 ++++++++++++++++++++++++++++++++++++++++++++------ + src/var.h | 1 + + 4 files changed, 51 insertions(+), 11 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 57f2661..b15cb92 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-05-24 Herbert Xu ++ ++ * Add localvars nesting. ++ + 2010-05-03 Gerrit Pape + + * Fix command -- crash. +diff --git a/src/eval.c b/src/eval.c +index 62d9d5d..8d2767c 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -928,20 +928,17 @@ STATIC int + evalfun(struct funcnode *func, int argc, char **argv, int flags) + { + volatile struct shparam saveparam; +- struct localvar *volatile savelocalvars; + struct jmploc *volatile savehandler; + struct jmploc jmploc; + int e; + + saveparam = shellparam; +- savelocalvars = localvars; + if ((e = setjmp(jmploc.loc))) { + goto funcdone; + } + INTOFF; + savehandler = handler; + handler = &jmploc; +- localvars = NULL; + shellparam.malloc = 0; + func->count++; + funcnest++; +@@ -950,13 +947,13 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags) + shellparam.p = argv + 1; + shellparam.optind = 1; + shellparam.optoff = -1; ++ pushlocalvars(); + evaltree(&func->n, flags & EV_TESTED); ++ poplocalvars(); + funcdone: + INTOFF; + funcnest--; + freefunc(func); +- poplocalvars(); +- localvars = savelocalvars; + freeparam(&shellparam); + shellparam = saveparam; + handler = savehandler; +diff --git a/src/var.c b/src/var.c +index 2737fb1..de1a5f5 100644 +--- a/src/var.c ++++ b/src/var.c +@@ -64,7 +64,12 @@ + #define VTABSIZE 39 + + +-struct localvar *localvars; ++struct localvar_list { ++ struct localvar_list *next; ++ struct localvar *lv; ++}; ++ ++MKINIT struct localvar_list *localvar_stack; + + const char defpathvar[] = + "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"; +@@ -139,6 +144,11 @@ INIT { + p = 0; + setpwd(p, 0); + } ++ ++RESET { ++ while (localvar_stack) ++ poplocalvars(); ++} + #endif + + +@@ -446,6 +456,9 @@ localcmd(int argc, char **argv) + { + char *name; + ++ if (!localvar_stack) ++ sh_error("not in a function"); ++ + argv = argptr; + while ((name = *argv++) != NULL) { + mklocal(name); +@@ -497,8 +510,8 @@ mklocal(char *name) + } + } + lvp->vp = vp; +- lvp->next = localvars; +- localvars = lvp; ++ lvp->next = localvar_stack->lv; ++ localvar_stack->lv = lvp; + INTON; + } + +@@ -511,11 +524,19 @@ mklocal(char *name) + void + poplocalvars(void) + { +- struct localvar *lvp; ++ struct localvar_list *ll; ++ struct localvar *lvp, *next; + struct var *vp; + +- while ((lvp = localvars) != NULL) { +- localvars = lvp->next; ++ INTOFF; ++ ll = localvar_stack; ++ localvar_stack = ll->next; ++ ++ next = ll->lv; ++ ckfree(ll); ++ ++ while ((lvp = next) != NULL) { ++ next = lvp->next; + vp = lvp->vp; + TRACE(("poplocalvar %s", vp ? vp->text : "-")); + if (vp == NULL) { /* $- saved */ +@@ -534,6 +555,23 @@ poplocalvars(void) + } + ckfree(lvp); + } ++ INTON; ++} ++ ++ ++/* ++ * Create a new localvar environment. ++ */ ++void pushlocalvars(void) ++{ ++ struct localvar_list *ll; ++ ++ INTOFF; ++ ll = ckmalloc(sizeof(*ll)); ++ ll->lv = NULL; ++ ll->next = localvar_stack; ++ localvar_stack = ll; ++ INTON; + } + + +diff --git a/src/var.h b/src/var.h +index e4e2cff..32b0dde 100644 +--- a/src/var.h ++++ b/src/var.h +@@ -139,6 +139,7 @@ char **listvars(int, int, char ***); + int showvars(const char *, int, int); + int exportcmd(int, char **); + int localcmd(int, char **); ++void pushlocalvars(void); + void poplocalvars(void); + int unsetcmd(int, char **); + int unsetvar(const char *); +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0005-VAR-Fix-poplocalvar-leak.diff +++ dash-0.5.6.1/debian/diff/0005-VAR-Fix-poplocalvar-leak.diff @@ -0,0 +1,71 @@ +From 20191acada96847ff26fe6edb70ab278f446486e Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Tue, 25 May 2010 18:14:32 +0800 +Subject: [VAR] Fix poplocalvar leak + +When a variable is marked as local, we set VSTRFIXED on its vp +recored. However, poplocalvar never clears this flag for variables +that were unset to begin with. Thus if you ever made an unset +variable local, it would get the VSTRFIXED bit and stick around +forever. + +Signed-off-by: Herbert Xu +(cherry picked from commit 55ffc36246d6536cd81e44f3c8c32bd3cd04afb8) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/var.c | 8 +++----- + 2 files changed, 7 insertions(+), 5 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index b15cb92..2bfa42a 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-05-25 Herbert Xu ++ ++ * Fix poplocalvar leak. ++ + 2010-05-24 Herbert Xu + + * Add localvars nesting. +diff --git a/src/var.c b/src/var.c +index de1a5f5..fc6d367 100644 +--- a/src/var.c ++++ b/src/var.c +@@ -543,7 +543,8 @@ poplocalvars(void) + memcpy(optlist, lvp->text, sizeof(optlist)); + ckfree(lvp->text); + optschanged(); +- } else if ((lvp->flags & (VUNSET|VSTRFIXED)) == VUNSET) { ++ } else if (lvp->flags == VUNSET) { ++ vp->flags &= ~(VSTRFIXED|VREADONLY); + unsetvar(vp->text); + } else { + if (vp->func) +@@ -627,8 +628,6 @@ unsetvar(const char *s) + retval = 1; + if (flags & VREADONLY) + goto out; +- if (flags & VUNSET) +- goto ok; + if ((flags & VSTRFIXED) == 0) { + INTOFF; + if ((flags & (VTEXTFIXED|VSTACK)) == 0) +@@ -636,11 +635,10 @@ unsetvar(const char *s) + *vpp = vp->next; + ckfree(vp); + INTON; +- } else { ++ } else if (!(flags & VUNSET)) { + setvar(s, 0, 0); + vp->flags &= ~VEXPORT; + } +-ok: + retval = 0; + } + +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0006-VAR-Move-unsetvar-functionality-into-setvareq.diff +++ dash-0.5.6.1/debian/diff/0006-VAR-Move-unsetvar-functionality-into-setvareq.diff @@ -0,0 +1,142 @@ +From 9250bfa1f9a7a14231d94f99612c39215c30f4b8 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Tue, 25 May 2010 20:55:05 +0800 +Subject: [VAR] Move unsetvar functionality into setvareq + +This patch moves the unsetvar code into setvareq so that we can +no have a pathological case of an unset variable hanging around +unless it has a bit pinning it like VEXPORT. + +Signed-off-by: Herbert Xu +(cherry picked from commit e3c9a7dd70976157cd7141ac8b25aa71f1eb6842) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 1 + + src/var.c | 54 +++++++++++++++++------------------------------------- + src/var.h | 2 +- + 3 files changed, 19 insertions(+), 38 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 2bfa42a..f5ce30c 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,6 +1,7 @@ + 2010-05-25 Herbert Xu + + * Fix poplocalvar leak. ++ * Move unsetvar functionality into setvareq. + + 2010-05-24 Herbert Xu + +diff --git a/src/var.c b/src/var.c +index fc6d367..12f2f6c 100644 +--- a/src/var.c ++++ b/src/var.c +@@ -266,10 +266,22 @@ setvareq(char *s, int flags) + if ((vp->flags & (VTEXTFIXED|VSTACK)) == 0) + ckfree(vp->text); + ++ if (((flags & (VEXPORT|VREADONLY|VSTRFIXED|VUNSET)) | ++ (vp->flags & VSTRFIXED)) == VUNSET) { ++ *vpp = vp->next; ++ ckfree(vp); ++out_free: ++ if ((flags & (VTEXTFIXED|VSTACK|VNOSAVE)) == VNOSAVE) ++ ckfree(s); ++ return; ++ } ++ + flags |= vp->flags & ~(VTEXTFIXED|VSTACK|VNOSAVE|VUNSET); + } else { + if (flags & VNOSET) + return; ++ if ((flags & (VEXPORT|VREADONLY|VSTRFIXED|VUNSET)) == VUNSET) ++ goto out_free; + /* not found */ + vp = ckmalloc(sizeof (*vp)); + vp->next = *vpp; +@@ -588,7 +600,6 @@ unsetcmd(int argc, char **argv) + char **ap; + int i; + int flag = 0; +- int ret = 0; + + while ((i = nextopt("vf")) != '\0') { + flag = i; +@@ -596,15 +607,13 @@ unsetcmd(int argc, char **argv) + + for (ap = argptr; *ap ; ap++) { + if (flag != 'f') { +- i = unsetvar(*ap); +- ret |= i; +- if (!(i & 2)) +- continue; ++ unsetvar(*ap); ++ continue; + } + if (flag != 'v') + unsetfunc(*ap); + } +- return ret & 1; ++ return 0; + } + + +@@ -612,38 +621,9 @@ unsetcmd(int argc, char **argv) + * Unset the specified variable. + */ + +-int +-unsetvar(const char *s) ++void unsetvar(const char *s) + { +- struct var **vpp; +- struct var *vp; +- int retval; +- +- vpp = findvar(hashvar(s), s); +- vp = *vpp; +- retval = 2; +- if (vp) { +- int flags = vp->flags; +- +- retval = 1; +- if (flags & VREADONLY) +- goto out; +- if ((flags & VSTRFIXED) == 0) { +- INTOFF; +- if ((flags & (VTEXTFIXED|VSTACK)) == 0) +- ckfree(vp->text); +- *vpp = vp->next; +- ckfree(vp); +- INTON; +- } else if (!(flags & VUNSET)) { +- setvar(s, 0, 0); +- vp->flags &= ~VEXPORT; +- } +- retval = 0; +- } +- +-out: +- return retval; ++ setvar(s, 0, 0); + } + + +diff --git a/src/var.h b/src/var.h +index 32b0dde..2bb82b1 100644 +--- a/src/var.h ++++ b/src/var.h +@@ -142,7 +142,7 @@ int localcmd(int, char **); + void pushlocalvars(void); + void poplocalvars(void); + int unsetcmd(int, char **); +-int unsetvar(const char *); ++void unsetvar(const char *); + int varcmp(const char *, const char *); + + static inline int varequal(const char *a, const char *b) { +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0007-VAR-Replace-cmdenviron-with-localvars.diff +++ dash-0.5.6.1/debian/diff/0007-VAR-Replace-cmdenviron-with-localvars.diff @@ -0,0 +1,260 @@ +From d77b7911f0996ed00ec043b86e0ef92e69366f45 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Wed, 26 May 2010 18:54:19 +0800 +Subject: [VAR] Replace cmdenviron with localvars + +This patch replaces the cmdenviron mechanism for temporary command +variables with the localvars mechanism used by functions. + +This reduces code size, and more importantly, makes the variable +assignment take effect immediately as required by POSIX. + +Signed-off-by: Herbert Xu +(cherry picked from commit 95a60b2936e8835963bfb08eadc0edf9dddf0498) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/eval.c | 23 +++++++++-------------- + src/eval.h | 1 - + src/var.c | 45 ++++++++++++++++++++------------------------- + src/var.h | 15 +++++++++++++-- + 5 files changed, 46 insertions(+), 42 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index f5ce30c..c53a5f3 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-05-26 Herbert Xu ++ ++ * Replace cmdenviron with localvars. ++ + 2010-05-25 Herbert Xu + + * Fix poplocalvar leak. +diff --git a/src/eval.c b/src/eval.c +index 8d2767c..a6981a9 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -77,7 +77,6 @@ static int funcnest; /* depth of function calls */ + + + char *commandname; +-struct strlist *cmdenviron; + int exitstatus; /* exit status of last command */ + int back_exitstatus; /* exit status of backquoted command */ + +@@ -704,6 +703,7 @@ evalcommand(union node *cmd, int flags) + /* First expand the arguments. */ + TRACE(("evalcommand(0x%lx, %d) called\n", (long)cmd, flags)); + setstackmark(&smark); ++ pushlocalvars(); + back_exitstatus = 0; + + cmdentry.cmdtype = CMDBUILTIN; +@@ -748,6 +748,8 @@ evalcommand(union node *cmd, int flags) + spp = varlist.lastp; + expandarg(argp, &varlist, EXP_VARTILDE); + ++ mklocal((*spp)->text); ++ + /* + * Modify the command lookup path, if a PATH= assignment + * is present +@@ -835,6 +837,7 @@ bail: + if (forkshell(jp, cmd, FORK_FG) != 0) { + exitstatus = waitforjob(jp); + INTON; ++ poplocalvars(0); + break; + } + FORCEINTON; +@@ -844,17 +847,9 @@ bail: + /* NOTREACHED */ + + case CMDBUILTIN: +- cmdenviron = varlist.list; +- if (cmdenviron) { +- struct strlist *list = cmdenviron; +- int i = VNOSET; +- if (spclbltin > 0 || argc == 0) { +- i = 0; +- if (execcmd && argc > 1) +- i = VEXPORT; +- } +- listsetvar(list, i); +- } ++ poplocalvars(spclbltin > 0 || argc == 0); ++ if (execcmd && argc > 1) ++ listsetvar(varlist.list, VEXPORT); + if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) { + int status; + int i; +@@ -875,7 +870,7 @@ raise: + break; + + case CMDFUNCTION: +- listsetvar(varlist.list, 0); ++ poplocalvars(1); + if (evalfun(cmdentry.u.func, argc, argv, flags)) + goto raise; + break; +@@ -949,7 +944,7 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags) + shellparam.optoff = -1; + pushlocalvars(); + evaltree(&func->n, flags & EV_TESTED); +- poplocalvars(); ++ poplocalvars(0); + funcdone: + INTOFF; + funcnest--; +diff --git a/src/eval.h b/src/eval.h +index e190b28..ac394e8 100644 +--- a/src/eval.h ++++ b/src/eval.h +@@ -37,7 +37,6 @@ + extern char *commandname; /* currently executing command */ + extern int exitstatus; /* exit status of last command */ + extern int back_exitstatus; /* exit status of backquoted command */ +-extern struct strlist *cmdenviron; /* environment for builtin command */ + + + struct backcmd { /* result of evalbackcmd */ +diff --git a/src/var.c b/src/var.c +index 12f2f6c..40bd3fd 100644 +--- a/src/var.c ++++ b/src/var.c +@@ -44,7 +44,6 @@ + #include "output.h" + #include "expand.h" + #include "nodes.h" /* for other headers */ +-#include "eval.h" /* defines cmdenviron */ + #include "exec.h" + #include "syntax.h" + #include "options.h" +@@ -104,7 +103,6 @@ struct var varinit[] = { + + STATIC struct var *vartab[VTABSIZE]; + +-STATIC void mklocal(char *); + STATIC struct var **hashvar(const char *); + STATIC int vpcmp(const void *, const void *); + STATIC struct var **findvar(struct var **, const char *); +@@ -147,7 +145,7 @@ INIT { + + RESET { + while (localvar_stack) +- poplocalvars(); ++ poplocalvars(0); + } + #endif + +@@ -339,24 +337,6 @@ intmax_t lookupvarint(const char *name) + + + /* +- * Search the environment of a builtin command. +- */ +- +-char * +-bltinlookup(const char *name) +-{ +- struct strlist *sp; +- +- for (sp = cmdenviron ; sp ; sp = sp->next) { +- if (varequal(sp->text, name)) +- return strchrnul(sp->text, '=') + 1; +- } +- return lookupvar(name); +-} +- +- +- +-/* + * Generate a list of variables satisfying the given conditions. + */ + +@@ -486,8 +466,7 @@ localcmd(int argc, char **argv) + * "-" as a special case. + */ + +-STATIC void +-mklocal(char *name) ++void mklocal(char *name) + { + struct localvar *lvp; + struct var **vpp; +@@ -534,7 +513,7 @@ mklocal(char *name) + */ + + void +-poplocalvars(void) ++poplocalvars(int keep) + { + struct localvar_list *ll; + struct localvar *lvp, *next; +@@ -551,7 +530,23 @@ poplocalvars(void) + next = lvp->next; + vp = lvp->vp; + TRACE(("poplocalvar %s", vp ? vp->text : "-")); +- if (vp == NULL) { /* $- saved */ ++ if (keep) { ++ int bits = VSTRFIXED; ++ ++ if (lvp->flags != VUNSET) { ++ if (vp->text == lvp->text) ++ bits |= VTEXTFIXED; ++ else if (!(lvp->flags & (VTEXTFIXED|VSTACK))) ++ ckfree(lvp->text); ++ } ++ ++ vp->flags &= ~bits; ++ vp->flags |= (lvp->flags & bits); ++ ++ if ((vp->flags & ++ (VEXPORT|VREADONLY|VSTRFIXED|VUNSET)) == VUNSET) ++ unsetvar(vp->text); ++ } else if (vp == NULL) { /* $- saved */ + memcpy(optlist, lvp->text, sizeof(optlist)); + ckfree(lvp->text); + optschanged(); +diff --git a/src/var.h b/src/var.h +index 2bb82b1..ef6d583 100644 +--- a/src/var.h ++++ b/src/var.h +@@ -133,14 +133,14 @@ struct strlist; + void listsetvar(struct strlist *, int); + char *lookupvar(const char *); + intmax_t lookupvarint(const char *); +-char *bltinlookup(const char *); + char **listvars(int, int, char ***); + #define environment() listvars(VEXPORT, VUNSET, 0) + int showvars(const char *, int, int); + int exportcmd(int, char **); + int localcmd(int, char **); ++void mklocal(char *); + void pushlocalvars(void); +-void poplocalvars(void); ++void poplocalvars(int); + int unsetcmd(int, char **); + void unsetvar(const char *); + int varcmp(const char *, const char *); +@@ -148,3 +148,14 @@ int varcmp(const char *, const char *); + static inline int varequal(const char *a, const char *b) { + return !varcmp(a, b); + } ++ ++/* ++ * Search the environment of a builtin command. ++ */ ++ ++static inline char *bltinlookup(const char *name) ++{ ++ return lookupvar(name); ++} ++ ++ +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0008-VAR-Fix-poplocalvar-on-abnormal-exit-from-function.diff +++ dash-0.5.6.1/debian/diff/0008-VAR-Fix-poplocalvar-on-abnormal-exit-from-function.diff @@ -0,0 +1,137 @@ +From c07ad12d6739fb8922484ffd84b729d2bfaee1aa Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Thu, 27 May 2010 11:32:55 +0800 +Subject: [VAR] Fix poplocalvar on abnormal exit from function + +The new localvar code broke the abnormal exit from functions +and built-ins by not restoring the original localvar state. + +This patch fixes this by storing the previous localvar state so +that we always unwind correctly in case of an abnormal exit. + +Signed-off-by: Herbert Xu +(cherry picked from commit 127788364951212c356aadc39deb21e01b0161c8) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/eval.c | 5 +++-- + src/var.c | 14 +++++++++++--- + src/var.h | 5 ++++- + 4 files changed, 22 insertions(+), 6 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index c53a5f3..24b7dc6 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-05-27 Herbert Xu ++ ++ * Fix poplocalvar on abnormal exit from function. ++ + 2010-05-26 Herbert Xu + + * Replace cmdenviron with localvars. +diff --git a/src/eval.c b/src/eval.c +index a6981a9..2cd931b 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -681,6 +681,7 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd) + evalcommand(union node *cmd, int flags) + #endif + { ++ struct localvar_list *localvar_stop; + struct stackmark smark; + union node *argp; + struct arglist arglist; +@@ -703,7 +704,7 @@ evalcommand(union node *cmd, int flags) + /* First expand the arguments. */ + TRACE(("evalcommand(0x%lx, %d) called\n", (long)cmd, flags)); + setstackmark(&smark); +- pushlocalvars(); ++ localvar_stop = pushlocalvars(); + back_exitstatus = 0; + + cmdentry.cmdtype = CMDBUILTIN; +@@ -837,7 +838,6 @@ bail: + if (forkshell(jp, cmd, FORK_FG) != 0) { + exitstatus = waitforjob(jp); + INTON; +- poplocalvars(0); + break; + } + FORCEINTON; +@@ -878,6 +878,7 @@ raise: + + out: + popredir(execcmd); ++ unwindlocalvars(localvar_stop); + if (lastarg) + /* dsl: I think this is intended to be used to support + * '_' in 'vi' command mode during line editing... +diff --git a/src/var.c b/src/var.c +index 40bd3fd..f456fbd 100644 +--- a/src/var.c ++++ b/src/var.c +@@ -144,8 +144,7 @@ INIT { + } + + RESET { +- while (localvar_stack) +- poplocalvars(0); ++ unwindlocalvars(0); + } + #endif + +@@ -570,7 +569,7 @@ poplocalvars(int keep) + /* + * Create a new localvar environment. + */ +-void pushlocalvars(void) ++struct localvar_list *pushlocalvars(void) + { + struct localvar_list *ll; + +@@ -580,6 +579,15 @@ void pushlocalvars(void) + ll->next = localvar_stack; + localvar_stack = ll; + INTON; ++ ++ return ll->next; ++} ++ ++ ++void unwindlocalvars(struct localvar_list *stop) ++{ ++ while (localvar_stack != stop) ++ poplocalvars(0); + } + + +diff --git a/src/var.h b/src/var.h +index ef6d583..7e7e505 100644 +--- a/src/var.h ++++ b/src/var.h +@@ -69,6 +69,8 @@ struct localvar { + const char *text; /* saved text */ + }; + ++struct localvar_list; ++ + + extern struct localvar *localvars; + extern struct var varinit[]; +@@ -139,8 +141,9 @@ int showvars(const char *, int, int); + int exportcmd(int, char **); + int localcmd(int, char **); + void mklocal(char *); +-void pushlocalvars(void); ++struct localvar_list *pushlocalvars(void); + void poplocalvars(int); ++void unwindlocalvars(struct localvar_list *stop); + int unsetcmd(int, char **); + void unsetvar(const char *); + int varcmp(const char *, const char *); +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0009-VAR-Document-local-command-behaviour-change.diff +++ dash-0.5.6.1/debian/diff/0009-VAR-Document-local-command-behaviour-change.diff @@ -0,0 +1,33 @@ +From df02d10031b375b53360da7baafcbecb9ddee369 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Thu, 27 May 2010 11:36:59 +0800 +Subject: [VAR] Document local command behaviour change + +The localvar nesting changeset causes local to fail when used +outside functions. While this behaviour is consistent with other +shells, it is a change in dash's beavhiour. + +Signed-off-by: Herbert Xu +(cherry picked from commit 85d5473923c546779213a6c1c0663fdfb1dbcfba) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 24b7dc6..d29f0e4 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -13,7 +13,7 @@ + + 2010-05-24 Herbert Xu + +- * Add localvars nesting. ++ * Add localvars nesting, local now fails outside functions. + + 2010-05-03 Gerrit Pape + +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0010-VAR-Do-not-poplocalvars-prematurely-on-regular-utilit.diff +++ dash-0.5.6.1/debian/diff/0010-VAR-Do-not-poplocalvars-prematurely-on-regular-utilit.diff @@ -0,0 +1,69 @@ +From 8c3286e71ac83c66c4db1497f6006a05ed5eb950 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Thu, 27 May 2010 11:50:19 +0800 +Subject: [VAR] Do not poplocalvars prematurely on regular utilities + +The recent cmdenviron removal broke regular utilities by calling +poplocalvars too early. This patch fixes that by postponing the +poplocalvars for regular utilities until they have completed. + +In order to ensure that local still works, it is now a special +built-in. + +Signed-off-by: Herbert Xu +(cherry picked from commit 1d806ac1fbafb867f6252e184e1be05c0829ab71) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 1 + + src/builtins.def.in | 2 +- + src/eval.c | 8 +++++--- + 3 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index d29f0e4..d42b7d7 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,6 +1,7 @@ + 2010-05-27 Herbert Xu + + * Fix poplocalvar on abnormal exit from function. ++ * Do not poplocalvars prematurely on regular utilities. + + 2010-05-26 Herbert Xu + +diff --git a/src/builtins.def.in b/src/builtins.def.in +index 266d0ec..4441fe4 100644 +--- a/src/builtins.def.in ++++ b/src/builtins.def.in +@@ -71,7 +71,7 @@ falsecmd -u false + getoptscmd -u getopts + hashcmd hash + jobscmd -u jobs +-localcmd -a local ++localcmd -as local + printfcmd printf + pwdcmd pwd + readcmd -u read +diff --git a/src/eval.c b/src/eval.c +index 2cd931b..337667f 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -847,9 +847,11 @@ bail: + /* NOTREACHED */ + + case CMDBUILTIN: +- poplocalvars(spclbltin > 0 || argc == 0); +- if (execcmd && argc > 1) +- listsetvar(varlist.list, VEXPORT); ++ if (spclbltin > 0 || argc == 0) { ++ poplocalvars(1); ++ if (execcmd && argc > 1) ++ listsetvar(varlist.list, VEXPORT); ++ } + if (evalbltin(cmdentry.u.cmd, argc, argv, flags)) { + int status; + int i; +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0011-REDIR-Move-null-redirect-checks-into-caller.diff +++ dash-0.5.6.1/debian/diff/0011-REDIR-Move-null-redirect-checks-into-caller.diff @@ -0,0 +1,126 @@ +From d7fae06fd668d2983fb687d500a014e797bc44aa Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Thu, 27 May 2010 14:21:17 +0800 +Subject: [REDIR] Move null redirect checks into caller + +The null redirect checks were added as an optimisation to avoid +unnecessary memory allocations. However, we could avoid this +completely by simply making the caller avoid making a redirection +unless it is not null. + +Signed-off-by: Herbert Xu +(cherry picked from commit f74ae6869a7a9124c8a5cb5f3f64491d28200cc3) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 1 + + src/eval.c | 6 ++++-- + src/redir.c | 14 +------------- + 3 files changed, 6 insertions(+), 15 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index d42b7d7..1c21a62 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -2,6 +2,7 @@ + + * Fix poplocalvar on abnormal exit from function. + * Do not poplocalvars prematurely on regular utilities. ++ * Move null redirect checks into caller. + + 2010-05-26 Herbert Xu + +diff --git a/src/eval.c b/src/eval.c +index 337667f..59bded9 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -224,7 +224,8 @@ evaltree(union node *n, int flags) + evaltree(n->nredir.n, flags & EV_TESTED); + status = exitstatus; + } +- popredir(0); ++ if (n->nredir.redirect) ++ popredir(0); + goto setstatus; + case NCMD: + #ifdef notyet +@@ -879,7 +880,8 @@ raise: + } + + out: +- popredir(execcmd); ++ if (cmd->ncmd.redirect) ++ popredir(execcmd); + unwindlocalvars(localvar_stop); + if (lastarg) + /* dsl: I think this is intended to be used to support +diff --git a/src/redir.c b/src/redir.c +index 54af96b..16decfc 100644 +--- a/src/redir.c ++++ b/src/redir.c +@@ -72,12 +72,10 @@ MKINIT + struct redirtab { + struct redirtab *next; + int renamed[10]; +- int nullredirs; + }; + + + MKINIT struct redirtab *redirlist; +-MKINIT int nullredirs; + + STATIC int openredirect(union node *); + #ifdef notyet +@@ -113,7 +111,6 @@ redirect(union node *redir, int flags) + memory[i] = 0; + memory[1] = flags & REDIR_BACKQ; + #endif +- nullredirs++; + if (!redir) { + return; + } +@@ -124,10 +121,8 @@ redirect(union node *redir, int flags) + q = ckmalloc(sizeof (struct redirtab)); + q->next = redirlist; + redirlist = q; +- q->nullredirs = nullredirs - 1; + for (i = 0 ; i < 10 ; i++) + q->renamed[i] = EMPTY; +- nullredirs = 0; + sv = q; + } + n = redir; +@@ -343,8 +338,6 @@ popredir(int drop) + struct redirtab *rp; + int i; + +- if (--nullredirs >= 0) +- return; + INTOFF; + rp = redirlist; + for (i = 0 ; i < 10 ; i++) { +@@ -364,7 +357,6 @@ popredir(int drop) + } + } + redirlist = rp->next; +- nullredirs = rp->nullredirs; + ckfree(rp); + INTON; + } +@@ -381,12 +373,8 @@ RESET { + /* + * Discard all saved file descriptors. + */ +- for (;;) { +- nullredirs = 0; +- if (!redirlist) +- break; ++ while (redirlist) + popredir(0); +- } + } + + #endif +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0012-REDIR-Fix-popredir-on-abnormal-exit-from-built-in.diff +++ dash-0.5.6.1/debian/diff/0012-REDIR-Fix-popredir-on-abnormal-exit-from-built-in.diff @@ -0,0 +1,160 @@ +From 0c3e5ecbe46052e09b0f5d063216aad1dead386b Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Thu, 27 May 2010 15:03:46 +0800 +Subject: [REDIR] Fix popredir on abnormal exit from built-in + +Just like the poplocalvar problem recently fixed, redirections +can also be leaked in case of an abnormal exit. This patch fixes +it using the same method as poplocalvar, by storing the previous +redirection state and restoring to that point. + +Signed-off-by: Herbert Xu +(cherry picked from commit b112dc08c6c86b8b82d60b1169ccab51921241ca) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 1 + + src/eval.c | 4 ++++ + src/redir.c | 45 ++++++++++++++++++++++++++++++++------------- + src/redir.h | 3 +++ + 4 files changed, 40 insertions(+), 13 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 1c21a62..733034e 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -3,6 +3,7 @@ + * Fix poplocalvar on abnormal exit from function. + * Do not poplocalvars prematurely on regular utilities. + * Move null redirect checks into caller. ++ * Fix popredir on abnormal exit from built-in. + + 2010-05-26 Herbert Xu + +diff --git a/src/eval.c b/src/eval.c +index 59bded9..d5c1e6c 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -219,6 +219,7 @@ evaltree(union node *n, int flags) + goto setstatus; + case NREDIR: + expredir(n->nredir.redirect); ++ pushredir(n->nredir.redirect); + status = redirectsafe(n->nredir.redirect, REDIR_PUSH); + if (!status) { + evaltree(n->nredir.n, flags & EV_TESTED); +@@ -683,6 +684,7 @@ evalcommand(union node *cmd, int flags) + #endif + { + struct localvar_list *localvar_stop; ++ struct redirtab *redir_stop; + struct stackmark smark; + union node *argp; + struct arglist arglist; +@@ -740,6 +742,7 @@ evalcommand(union node *cmd, int flags) + + preverrout.fd = 2; + expredir(cmd->ncmd.redirect); ++ redir_stop = pushredir(cmd->ncmd.redirect); + status = redirectsafe(cmd->ncmd.redirect, REDIR_PUSH|REDIR_SAVEFD2); + + path = vpath.text; +@@ -882,6 +885,7 @@ raise: + out: + if (cmd->ncmd.redirect) + popredir(execcmd); ++ unwindredir(redir_stop); + unwindlocalvars(localvar_stop); + if (lastarg) + /* dsl: I think this is intended to be used to support +diff --git a/src/redir.c b/src/redir.c +index 16decfc..b4e49c0 100644 +--- a/src/redir.c ++++ b/src/redir.c +@@ -111,20 +111,12 @@ redirect(union node *redir, int flags) + memory[i] = 0; + memory[1] = flags & REDIR_BACKQ; + #endif +- if (!redir) { ++ if (!redir) + return; +- } + sv = NULL; + INTOFF; +- if (likely(flags & REDIR_PUSH)) { +- struct redirtab *q; +- q = ckmalloc(sizeof (struct redirtab)); +- q->next = redirlist; +- redirlist = q; +- for (i = 0 ; i < 10 ; i++) +- q->renamed[i] = EMPTY; +- sv = q; +- } ++ if (likely(flags & REDIR_PUSH)) ++ sv = redirlist; + n = redir; + do { + newfd = openredirect(n); +@@ -373,8 +365,7 @@ RESET { + /* + * Discard all saved file descriptors. + */ +- while (redirlist) +- popredir(0); ++ unwindredir(0); + } + + #endif +@@ -485,3 +476,31 @@ redirectsafe(union node *redir, int flags) + RESTOREINT(saveint); + return err; + } ++ ++ ++void unwindredir(struct redirtab *stop) ++{ ++ while (redirlist != stop) ++ popredir(0); ++} ++ ++ ++struct redirtab *pushredir(union node *redir) ++{ ++ struct redirtab *sv; ++ struct redirtab *q; ++ int i; ++ ++ q = redirlist; ++ if (!redir) ++ goto out; ++ ++ sv = ckmalloc(sizeof (struct redirtab)); ++ sv->next = q; ++ redirlist = sv; ++ for (i = 0; i < 10; i++) ++ sv->renamed[i] = EMPTY; ++ ++out: ++ return q; ++} +diff --git a/src/redir.h b/src/redir.h +index d1d160e..8e56995 100644 +--- a/src/redir.h ++++ b/src/redir.h +@@ -41,10 +41,13 @@ + #endif + #define REDIR_SAVEFD2 03 /* set preverrout */ + ++struct redirtab; + union node; + void redirect(union node *, int); + void popredir(int); + void clearredir(void); + int savefd(int, int); + int redirectsafe(union node *, int); ++void unwindredir(struct redirtab *stop); ++struct redirtab *pushredir(union node *redir); + +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0013-EVAL-Force-fork-if-any-trap-is-set-not-just-on-EXIT.diff +++ dash-0.5.6.1/debian/diff/0013-EVAL-Force-fork-if-any-trap-is-set-not-just-on-EXIT.diff @@ -0,0 +1,155 @@ +From d07df719bc1c2a63a673e05977ceb8b153609856 Mon Sep 17 00:00:00 2001 +From: Jilles Tjoelker +Date: Thu, 27 May 2010 16:08:00 +0800 +Subject: [EVAL] Force fork if any trap is set, not just on EXIT + +In some cases the shell executes a subshell or an external command in +the current process. This is not done if a trap on EXIT has been set, so +that that trap can execute after the subshell or external command has +finished. Extend that check to all traps. (A trap is "set" if a +non-empty command string has been attached to it.) + +Improve encapsulation by exporting an accessor function for this and +making the trap array static again. + +This is much like FreeBSD SVN r194127, enhanced to apply to subshells +also (see FreeBSD SVN r194774). + +Example: + dash -c '{ trap "echo moo" TERM; sleep 3; }& sleep 1; kill $!;wait' +This should print "moo" after 3 seconds. + +Example: + dash -c '{ trap "echo moo" TERM; (sleep 3) }& sleep 1; kill $!;wait' +The same. + +Example: + dash -c '{ trap "echo moo" TERM; sleep 3; :; }& sleep 1; kill $!;wait' +This works correctly even without this patch. + +Signed-off-by: Jilles Tjoelker +Signed-off-by: Herbert Xu +(cherry picked from commit 699170f4c835d8ec8e310f58c34c6d158dd37d71) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/eval.c | 4 ++-- + src/trap.c | 19 ++++++++++++++----- + src/trap.h | 7 ++++++- + 4 files changed, 26 insertions(+), 8 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 733034e..2bf7d95 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-05-27 Jilles Tjoelker ++ ++ * Force fork if any trap is set, not just on EXIT. ++ + 2010-05-27 Herbert Xu + + * Fix poplocalvar on abnormal exit from function. +diff --git a/src/eval.c b/src/eval.c +index d5c1e6c..439f881 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -449,7 +449,7 @@ evalsubshell(union node *n, int flags) + int status; + + expredir(n->nredir.redirect); +- if (!backgnd && flags & EV_EXIT && !trap[0]) ++ if (!backgnd && flags & EV_EXIT && !have_traps()) + goto nofork; + INTOFF; + jp = makejob(n, 1); +@@ -836,7 +836,7 @@ bail: + switch (cmdentry.cmdtype) { + default: + /* Fork off a child process if necessary. */ +- if (!(flags & EV_EXIT) || trap[0]) { ++ if (!(flags & EV_EXIT) || have_traps()) { + INTOFF; + jp = makejob(cmd, 1); + if (forkshell(jp, cmd, FORK_FG) != 0) { +diff --git a/src/trap.c b/src/trap.c +index 8d59abc..7bd60ab 100644 +--- a/src/trap.c ++++ b/src/trap.c +@@ -69,7 +69,9 @@ + + + /* trap handler commands */ +-char *trap[NSIG]; ++static char *trap[NSIG]; ++/* number of non-null traps */ ++int trapcnt; + /* current value of signal */ + char sigmode[NSIG - 1]; + /* indicates specified signal received */ +@@ -127,11 +129,17 @@ trapcmd(int argc, char **argv) + if (action) { + if (action[0] == '-' && action[1] == '\0') + action = NULL; +- else ++ else { ++ if (*action) ++ trapcnt++; + action = savestr(action); ++ } + } +- if (trap[signo]) ++ if (trap[signo]) { ++ if (*trap[signo]) ++ trapcnt--; + ckfree(trap[signo]); ++ } + trap[signo] = action; + if (signo != 0) + setsignal(signo); +@@ -152,16 +160,17 @@ clear_traps(void) + { + char **tp; + ++ INTOFF; + for (tp = trap ; tp < &trap[NSIG] ; tp++) { + if (*tp && **tp) { /* trap not NULL or SIG_IGN */ +- INTOFF; + ckfree(*tp); + *tp = NULL; + if (tp != &trap[0]) + setsignal(tp - trap); +- INTON; + } + } ++ trapcnt = 0; ++ INTON; + } + + +diff --git a/src/trap.h b/src/trap.h +index 105e57b..bdd7944 100644 +--- a/src/trap.h ++++ b/src/trap.h +@@ -36,7 +36,7 @@ + + #include + +-extern char *trap[]; ++extern int trapcnt; + extern char sigmode[]; + extern volatile sig_atomic_t pendingsigs; + extern int gotsigchld; +@@ -50,3 +50,8 @@ int dotrap(void); + void setinteractive(int); + void exitshell(void) __attribute__((__noreturn__)); + int decode_signal(const char *, int); ++ ++static inline int have_traps(void) ++{ ++ return trapcnt; ++} +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0014-EXPAND-Fix-corruption-of-redirections-with-byte-0x81.diff +++ dash-0.5.6.1/debian/diff/0014-EXPAND-Fix-corruption-of-redirections-with-byte-0x81.diff @@ -0,0 +1,42 @@ +From 87a64ea3d7259f3ac32a6f70a6c6bf0ab192fc33 Mon Sep 17 00:00:00 2001 +From: Jilles Tjoelker +Date: Thu, 27 May 2010 20:07:29 +1000 +Subject: [EXPAND] Fix corruption of redirections with byte 0x81 + +In other ash variants, a partial implementation of ksh-like cmd >file* +adds and removes CTLESC bytes ('\x81') in redirection filenames, +preserving 8-bit transparency. Long ago, dash removed the code to add +the CTLESC bytes, but not the code to remove them, causing corruption of +filenames containing CTLESC. This commit removes the code to remove the +CTLESC bytes. + +The CTLESC byte occurs frequently in UTF-8 encoded non-Latin text. + +This bug has been reported various times to Ubuntu and Debian (e.g. +Launchpad Ubuntu #422298). This patch is the same as the one submitted +by Alexander Korolkov in Ubuntu #422298. + +Signed-off-by: Jilles Tjoelker +Signed-off-by: Herbert Xu +(cherry picked from commit f8231aea37e921492fc7fbd972385ab5b90e8627) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 1 + + 1 files changed, 1 insertions(+), 0 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 2bf7d95..5b0bb5a 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,6 +1,7 @@ + 2010-05-27 Jilles Tjoelker + + * Force fork if any trap is set, not just on EXIT. ++ * Fix corruption of redirections with byte 0x81. + + 2010-05-27 Herbert Xu + +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0015-BUILTIN-Continue-after-EINTR-in-read-1-with-no-pendin.diff +++ dash-0.5.6.1/debian/diff/0015-BUILTIN-Continue-after-EINTR-in-read-1-with-no-pendin.diff @@ -0,0 +1,36 @@ +From 625db17095325b37dc64e5e95d6b72883d981d68 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Sat, 29 May 2010 09:44:53 +1000 +Subject: [BUILTIN] Continue after EINTR in read(1) with no pending signals + +The recent introduction of SIGCHLD trapping broke read(1) as +each SIGCHLD may cause read(1) to return prematurely. Now if +we did have a trap for SIGCHLD read(1) should actually do this. +However, returning when SIGCHLD isn't trapped is wrong. + +This patch fixes this by checking for EINTR and pendingsigs in +read(1). + +Signed-off-by: Herbert Xu +(cherry picked from commit 0cda2e1f8d8222fa497f808b54a2146d60e304f5) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + 1 files changed, 4 insertions(+), 0 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 5b0bb5a..4769054 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-05-29 Herbert Xu ++ ++ * Continue after EINTR in read(1) with no pending signals. ++ + 2010-05-27 Jilles Tjoelker + + * Force fork if any trap is set, not just on EXIT. +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0016-EVAL-Don-t-clear-eflag-in-evalbackcmd.diff +++ dash-0.5.6.1/debian/diff/0016-EVAL-Don-t-clear-eflag-in-evalbackcmd.diff @@ -0,0 +1,59 @@ +From 19b62c48a796acfbcf7a64739076b44225bbab0a Mon Sep 17 00:00:00 2001 +From: Gerrit Pape +Date: Mon, 28 Jun 2010 17:11:58 +1000 +Subject: [EVAL] Don't clear eflag in evalbackcmd + +According to + http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_12 +"A subshell environment shall be created as a duplicate of the shell +environment, except that signal traps set by that shell environment +shall be set to the default values." + +Currently the eflag is cleared when forking a subshell, e.g. + +$ dash -c 'set -e ; z=$(false;echo foo) ; echo $z' +foo + +With this commit the eflag is preserved for subshells, and dash exits 1 +before echo. + +The problem was reported by Vincent Lefevre through + http://bugs.debian.org/514863 + +Signed-off-by: Gerrit Pape +Signed-off-by: Herbert Xu +(cherry picked from commit cdfb42fd67558847b689c69b6fdd23016e7220eb) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/eval.c | 1 - + 2 files changed, 4 insertions(+), 1 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 4769054..d19dbbc 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-06-28 Gerrit Pape ++ ++ * Don't clear eflag in evalbackcmd. ++ + 2010-05-29 Herbert Xu + + * Continue after EINTR in read(1) with no pending signals. +diff --git a/src/eval.c b/src/eval.c +index 439f881..d142412 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -625,7 +625,6 @@ evalbackcmd(union node *n, struct backcmd *result) + dup2(pip[1], 1); + close(pip[1]); + } +- eflag = 0; + evaltreenr(n, EV_EXIT); + /* NOTREACHED */ + } +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0017-VAR-Fix-loss-of-variables-when-hash-collides.diff +++ dash-0.5.6.1/debian/diff/0017-VAR-Fix-loss-of-variables-when-hash-collides.diff @@ -0,0 +1,170 @@ +From 5175befe4fc630fbd099a4c766d3377f9bd29fa7 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Tue, 6 Jul 2010 17:40:53 +0800 +Subject: [VAR] Fix loss of variables when hash collides + +Brian Koropoff reported that the new var patches broke the following +script: + +#!/bin/dash +GDM_LANG="bar" +OPTION="foo" +unset GDM_LANG +# OPTION has mysteriously become unset +echo "$OPTION" + +He correctly diagnosed this as a result of removing all variables +in the hash chain preceding the one that should be removed in +setvareq. + +He also provided a patch to fix this. + +This patch is based on his but without keeping the original vpp. +As a result, we now store new variables at the end of the hash +chain instead of the beginning. + +To make this work, setvareq/setvar now returns the vp pointer +modified. In case they're used to unset a variable the pointer +returned is undefined. This is because mklocal needs it and +used to get it by assuming that the new variable always appear +at the beginning of the chain. + +Signed-off-by: Herbert Xu +(cherry picked from commit cb20b2cd727c892756ff3f144ebf92feb5590562) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/var.c | 28 ++++++++++++++++------------ + src/var.h | 4 ++-- + 3 files changed, 22 insertions(+), 14 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index d19dbbc..149cbc0 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-07-06 Herbert Xu ++ ++ * Fix loss of variables when hash collides. ++ + 2010-06-28 Gerrit Pape + + * Don't clear eflag in evalbackcmd. +diff --git a/src/var.c b/src/var.c +index f456fbd..3efc943 100644 +--- a/src/var.c ++++ b/src/var.c +@@ -180,13 +180,13 @@ initvar(void) + * flags of the variable. If val is NULL, the variable is unset. + */ + +-void +-setvar(const char *name, const char *val, int flags) ++struct var *setvar(const char *name, const char *val, int flags) + { + char *p, *q; + size_t namelen; + char *nameeq; + size_t vallen; ++ struct var *vp; + + q = endofname(name); + p = strchrnul(q, '='); +@@ -206,8 +206,10 @@ setvar(const char *name, const char *val, int flags) + p = mempcpy(p, val, vallen); + } + *p = '\0'; +- setvareq(nameeq, flags | VNOSAVE); ++ vp = setvareq(nameeq, flags | VNOSAVE); + INTON; ++ ++ return vp; + } + + /* +@@ -235,14 +237,14 @@ intmax_t setvarint(const char *name, intmax_t val, int flags) + * Called with interrupts off. + */ + +-void +-setvareq(char *s, int flags) ++struct var *setvareq(char *s, int flags) + { + struct var *vp, **vpp; + + vpp = hashvar(s); + flags |= (VEXPORT & (((unsigned) (1 - aflag)) - 1)); +- vp = *findvar(vpp, s); ++ vpp = findvar(vpp, s); ++ vp = *vpp; + if (vp) { + if (vp->flags & VREADONLY) { + const char *n; +@@ -255,7 +257,7 @@ setvareq(char *s, int flags) + } + + if (flags & VNOSET) +- return; ++ goto out; + + if (vp->func && (flags & VNOFUNC) == 0) + (*vp->func)(strchrnul(s, '=') + 1); +@@ -270,13 +272,13 @@ setvareq(char *s, int flags) + out_free: + if ((flags & (VTEXTFIXED|VSTACK|VNOSAVE)) == VNOSAVE) + ckfree(s); +- return; ++ goto out; + } + + flags |= vp->flags & ~(VTEXTFIXED|VSTACK|VNOSAVE|VUNSET); + } else { + if (flags & VNOSET) +- return; ++ goto out; + if ((flags & (VEXPORT|VREADONLY|VSTRFIXED|VUNSET)) == VUNSET) + goto out_free; + /* not found */ +@@ -289,6 +291,9 @@ out_free: + s = savestr(s); + vp->text = s; + vp->flags = flags; ++ ++out: ++ return vp; + } + + +@@ -486,10 +491,9 @@ void mklocal(char *name) + eq = strchr(name, '='); + if (vp == NULL) { + if (eq) +- setvareq(name, VSTRFIXED); ++ vp = setvareq(name, VSTRFIXED); + else +- setvar(name, NULL, VSTRFIXED); +- vp = *vpp; /* the new variable */ ++ vp = setvar(name, NULL, VSTRFIXED); + lvp->flags = VUNSET; + } else { + lvp->text = vp->text; +diff --git a/src/var.h b/src/var.h +index 7e7e505..7aa051f 100644 +--- a/src/var.h ++++ b/src/var.h +@@ -128,9 +128,9 @@ extern const char defpathvar[]; + #define mpathset() ((vmpath.flags & VUNSET) == 0) + + void initvar(void); +-void setvar(const char *, const char *, int); ++struct var *setvar(const char *name, const char *val, int flags); + intmax_t setvarint(const char *, intmax_t, int); +-void setvareq(char *, int); ++struct var *setvareq(char *s, int flags); + struct strlist; + void listsetvar(struct strlist *, int); + char *lookupvar(const char *); +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0018-EVAL-Removed-dead-code-for-eval-NPIPE.diff +++ dash-0.5.6.1/debian/diff/0018-EVAL-Removed-dead-code-for-eval-NPIPE.diff @@ -0,0 +1,49 @@ +From d240fe6a3f98d136b6ba2d315df49e37f7e33636 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Tue, 6 Jul 2010 17:46:06 +0800 +Subject: [EVAL] Removed dead code for eval NPIPE + +The notyet code is identical to the current code. + +Signed-off-by: Herbert Xu +(cherry picked from commit a0212c5dcdd8f2bb69834f2638cddb427dea78a6) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 1 + + src/eval.c | 6 ------ + 2 files changed, 1 insertions(+), 6 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 149cbc0..8430565 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,6 +1,7 @@ + 2010-07-06 Herbert Xu + + * Fix loss of variables when hash collides. ++ * Removed dead code for eval NPIPE. + + 2010-06-28 Gerrit Pape + +diff --git a/src/eval.c b/src/eval.c +index d142412..58739f5 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -254,13 +254,7 @@ checkexit: + goto calleval; + case NPIPE: + evalfn = evalpipe; +-#ifdef notyet +- if (eflag && !(flags & EV_TESTED)) +- checkexit = ~0; +- goto calleval; +-#else + goto checkexit; +-#endif + case NCASE: + evalfn = evalcase; + goto calleval; +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0019-EVAL-Check-exit-for-eval-NSUBSHELL.diff +++ dash-0.5.6.1/debian/diff/0019-EVAL-Check-exit-for-eval-NSUBSHELL.diff @@ -0,0 +1,53 @@ +From ba8068c70d5d7d97a01e0f4cb05dcd47a12be0bd Mon Sep 17 00:00:00 2001 +From: Gerrit Pape +Date: Tue, 6 Jul 2010 17:50:37 +0800 +Subject: [EVAL] Check exit for eval NSUBSHELL + +Example: + +$ dash -c 'set -e; (false); echo here' +here + +With this commit, dash exits 1 before echo. + +The bug was reported by Stefan Fritsch through + http://bugs.debian.org/514863 + +Signed-off-by: Gerrit Pape +Signed-off-by: Herbert Xu +(cherry picked from commit a92255d6fa8b8efb0f9fb093b77ac601fe3e9ede) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/eval.c | 2 +- + 2 files changed, 5 insertions(+), 1 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 8430565..f2bb9ad 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-07-06 Gerrit Pape ++ ++ * Check exit for eval NSUBSHELL. ++ + 2010-07-06 Herbert Xu + + * Fix loss of variables when hash collides. +diff --git a/src/eval.c b/src/eval.c +index 58739f5..5b8d36b 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -251,7 +251,7 @@ checkexit: + case NSUBSHELL: + case NBACKGND: + evalfn = evalsubshell; +- goto calleval; ++ goto checkexit; + case NPIPE: + evalfn = evalpipe; + goto checkexit; +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0020-VAR-Fix-varinit-ordering-that-broke-fc.diff +++ dash-0.5.6.1/debian/diff/0020-VAR-Fix-varinit-ordering-that-broke-fc.diff @@ -0,0 +1,65 @@ +From c9c0d7c10d89279037f8990ce5ad6569e85135af Mon Sep 17 00:00:00 2001 +From: Jilles Tjoelker +Date: Wed, 8 Sep 2010 16:17:28 +0800 +Subject: [VAR] Fix varinit ordering that broke fc + +Git commit 0df96793ef6aa103df228d7dfe56099b7d721a15 "[SHELL] Add +preliminary LINENO support" added the LINENO variable in the middle of +other initialized variables, causing some macros for TERM and HISTSIZE +to break (both of these are only used if libedit support is compiled in, +which is not the case by default). + +The breakage is the same as can be seen by setting HISTSIZE=0. + +Also add a comment warning about this. + +Reported-by: Wez Furlong +Signed-off-by: Herbert Xu +(cherry picked from commit 80bbe35591f67679c2132e97b0e016f33510830e) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/var.c | 3 ++- + 2 files changed, 6 insertions(+), 1 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index f2bb9ad..f6a25a3 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-09-08 Jilles Tjoelker ++ ++ * Fix varinit ordering that broke fc. ++ + 2010-07-06 Gerrit Pape + + * Check exit for eval NSUBSHELL. +diff --git a/src/var.c b/src/var.c +index 3efc943..25c2216 100644 +--- a/src/var.c ++++ b/src/var.c +@@ -78,6 +78,7 @@ const char defifsvar[] = "IFS= \t\n"; + const char defifs[] = " \t\n"; + #endif + ++/* Some macros in var.h depend on the order, add new variables to the end. */ + struct var varinit[] = { + #if ATTY + { 0, VSTRFIXED|VTEXTFIXED|VUNSET, "ATTY\0", 0 }, +@@ -94,11 +95,11 @@ struct var varinit[] = { + { 0, VSTRFIXED|VTEXTFIXED, "PS2=> ", 0 }, + { 0, VSTRFIXED|VTEXTFIXED, "PS4=+ ", 0 }, + { 0, VSTRFIXED|VTEXTFIXED, "OPTIND=1", getoptsreset }, +- { 0, VSTRFIXED|VTEXTFIXED, "LINENO=1", 0 }, + #ifndef SMALL + { 0, VSTRFIXED|VTEXTFIXED|VUNSET, "TERM\0", 0 }, + { 0, VSTRFIXED|VTEXTFIXED|VUNSET, "HISTSIZE\0", sethistsize }, + #endif ++ { 0, VSTRFIXED|VTEXTFIXED, "LINENO=1", 0 }, + }; + + STATIC struct var *vartab[VTABSIZE]; +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0021-JOBS-Debug-compile-fix.diff +++ dash-0.5.6.1/debian/diff/0021-JOBS-Debug-compile-fix.diff @@ -0,0 +1,50 @@ +From 4e2e7a78a2456635fc628848c7ca2a2d10679b9e Mon Sep 17 00:00:00 2001 +From: maximilian attems +Date: Wed, 8 Sep 2010 16:21:52 +0800 +Subject: [JOBS] Debug compile fix + +No point in tracing a no longer undeclared "ps->cmd", fixes: +jobs.c: In function \u2018commandtext\u2019: +jobs.c:1192: error: \u2018ps\u2019 undeclared (first use in this function) +jobs.c:1192: error: (Each undeclared identifier is reported only once +jobs.c:1192: error: for each function it appears in.) + +Signed-off-by: maximilian attems +Signed-off-by: Herbert Xu +(cherry picked from commit 61a4c1de836712fdd40e288ac52b22de466bb886) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/jobs.c | 3 +-- + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index f6a25a3..e02266f 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-09-08 maximilian attems ++ ++ * Debug compile fix. ++ + 2010-09-08 Jilles Tjoelker + + * Fix varinit ordering that broke fc. +diff --git a/src/jobs.c b/src/jobs.c +index 060187c..826a9af 100644 +--- a/src/jobs.c ++++ b/src/jobs.c +@@ -1189,8 +1189,7 @@ commandtext(union node *n) + STARTSTACKSTR(cmdnextc); + cmdtxt(n); + name = stackblock(); +- TRACE(("commandtext: name %p, end %p\n\t\"%s\"\n", +- name, cmdnextc, ps->cmd)); ++ TRACE(("commandtext: name %p, end %p\n", name, cmdnextc)); + return savestr(name); + } + +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0022-EXPAND-Fix-ifsfirst-ifslastp-leak.diff +++ dash-0.5.6.1/debian/diff/0022-EXPAND-Fix-ifsfirst-ifslastp-leak.diff @@ -0,0 +1,152 @@ +From a499baaccc03bf9b21d5772e0055f1ed61c43504 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Wed, 8 Sep 2010 20:07:26 +0800 +Subject: [EXPAND] Fix ifsfirst/ifslastp leak + +As it stands expandarg may return with a non-NULL ifslastp which +then confuses any subsequent ifsbreakup user that doesn't clear +it directly. + +What's worse, if we get interrupted before we hit ifsfree in +expandarg we will leak memory. + +This patch fixes this by always calling ifsfree in expandarg +thus ensuring that ifslastp is always NULL on the normal path. +It also adds an ifsfree call to the RESET path to ensure that +memory isn't leaked. + +Signed-off-by: Herbert Xu +(cherry picked from commit f42e443bb511ed3224f09b4fcf0772438ebdbbfa) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/expand.c | 30 +++++++++++++++++++----------- + src/expand.h | 1 + + src/miscbltin.c | 2 +- + 4 files changed, 25 insertions(+), 12 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index e02266f..6126c1a 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-09-08 Herbert Xu ++ ++ * Fix ifsfirst/ifslastp leak. ++ + 2010-09-08 maximilian attems + + * Debug compile fix. +diff --git a/src/expand.c b/src/expand.c +index f2f964c..d6c6416 100644 +--- a/src/expand.c ++++ b/src/expand.c +@@ -117,7 +117,6 @@ STATIC char *evalvar(char *, int); + STATIC size_t strtodest(const char *, const char *, int); + STATIC void memtodest(const char *, size_t, const char *, int); + STATIC ssize_t varvalue(char *, int, int); +-STATIC void ifsfree(void); + STATIC void expandmeta(struct strlist *, int); + #ifdef HAVE_GLOB + STATIC void addglob(const glob_t *); +@@ -191,8 +190,6 @@ expandarg(union node *arg, struct arglist *arglist, int flag) + + argbackq = arg->narg.backquote; + STARTSTACKSTR(expdest); +- ifsfirst.next = NULL; +- ifslastp = NULL; + argstr(arg->narg.text, flag); + p = _STPUTC('\0', expdest); + expdest = p - 1; +@@ -215,8 +212,7 @@ expandarg(union node *arg, struct arglist *arglist, int flag) + *exparg.lastp = sp; + exparg.lastp = &sp->next; + } +- if (ifsfirst.next) +- ifsfree(); ++ ifsfree(); + *exparg.lastp = NULL; + if (exparg.list) { + *arglist->lastp = exparg.list; +@@ -1108,22 +1104,25 @@ add: + arglist->lastp = &sp->next; + } + +-STATIC void +-ifsfree(void) ++void ifsfree(void) + { +- struct ifsregion *p; ++ struct ifsregion *p = ifsfirst.next; ++ ++ if (!p) ++ goto out; + + INTOFF; +- p = ifsfirst.next; + do { + struct ifsregion *ifsp; + ifsp = p->next; + ckfree(p); + p = ifsp; + } while (p); +- ifslastp = NULL; + ifsfirst.next = NULL; + INTON; ++ ++out: ++ ifslastp = NULL; + } + + +@@ -1678,7 +1677,6 @@ casematch(union node *pattern, char *val) + setstackmark(&smark); + argbackq = pattern->narg.backquote; + STARTSTACKSTR(expdest); +- ifslastp = NULL; + argstr(pattern->narg.text, EXP_TILDE | EXP_CASE); + STACKSTRNUL(expdest); + result = patmatch(stackblock(), val); +@@ -1718,3 +1716,13 @@ varunset(const char *end, const char *var, const char *umsg, int varflags) + } + sh_error("%.*s: %s%s", end - var - 1, var, msg, tail); + } ++ ++#ifdef mkinit ++ ++INCLUDE "expand.h" ++ ++RESET { ++ ifsfree(); ++} ++ ++#endif +diff --git a/src/expand.h b/src/expand.h +index 405af0b..4251a4a 100644 +--- a/src/expand.h ++++ b/src/expand.h +@@ -70,6 +70,7 @@ int casematch(union node *, char *); + void recordregion(int, int, int); + void removerecordregions(int); + void ifsbreakup(char *, struct arglist *); ++void ifsfree(void); + + /* From arith.y */ + intmax_t arith(const char *); +diff --git a/src/miscbltin.c b/src/miscbltin.c +index 5ab1648..c42a01c 100644 +--- a/src/miscbltin.c ++++ b/src/miscbltin.c +@@ -89,7 +89,7 @@ readcmd_handle_line(char *line, char **ap, size_t len) + + ifsbreakup(s, &arglist); + *arglist.lastp = NULL; +- removerecordregions(0); ++ ifsfree(); + + for (sl = arglist.list; sl; sl = sl->next) { + /* remaining fields present, but no variables left. */ +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0023-BUILTIN-Fix-trailing-field-bug-in-read-1.diff +++ dash-0.5.6.1/debian/diff/0023-BUILTIN-Fix-trailing-field-bug-in-read-1.diff @@ -0,0 +1,76 @@ +From a0995b2473f7e00479cb7d879fac62e82cbc95f7 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Wed, 8 Sep 2010 20:23:25 +0800 +Subject: [BUILTIN] Fix trailing field bug in read(1) + +The new read(1) code fails to handle the last variable correctly if +it happens to be terminated by IFS characters. Those characters +are included in the last variable but they should not be. + +This patch fixes this. + +Signed-off-by: Herbert Xu +(cherry picked from commit b61ab0b33b4f9ea5fb3663fe8fa0d5fd70e6c166) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 1 + + src/miscbltin.c | 22 ++++++++++++++-------- + 2 files changed, 15 insertions(+), 8 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 6126c1a..4a1f925 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,6 +1,7 @@ + 2010-09-08 Herbert Xu + + * Fix ifsfirst/ifslastp leak. ++ * Fix trailing field bug in read(1). + + 2010-09-08 maximilian attems + +diff --git a/src/miscbltin.c b/src/miscbltin.c +index c42a01c..653c92f 100644 +--- a/src/miscbltin.c ++++ b/src/miscbltin.c +@@ -91,9 +91,20 @@ readcmd_handle_line(char *line, char **ap, size_t len) + *arglist.lastp = NULL; + ifsfree(); + +- for (sl = arglist.list; sl; sl = sl->next) { ++ sl = arglist.list; ++ ++ do { ++ if (!sl) { ++ /* nullify remaining arguments */ ++ do { ++ setvar(*ap, nullstr, 0); ++ } while (*++ap); ++ ++ return; ++ } ++ + /* remaining fields present, but no variables left. */ +- if (!ap[1]) { ++ if (!ap[1] && sl->next) { + size_t offset; + char *remainder; + +@@ -110,12 +121,7 @@ readcmd_handle_line(char *line, char **ap, size_t len) + /* set variable to field */ + rmescapes(sl->text); + setvar(*ap, sl->text, 0); +- ap++; +- } +- +- /* nullify remaining arguments */ +- do { +- setvar(*ap, nullstr, 0); ++ sl = sl->next; + } while (*++ap); + } + +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0024-BUILTIN-Fix-EXEXEC-status-clobbering.diff +++ dash-0.5.6.1/debian/diff/0024-BUILTIN-Fix-EXEXEC-status-clobbering.diff @@ -0,0 +1,49 @@ +From 5df6131dc484e27fc6b3ee31950236da483e1834 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Thu, 7 Oct 2010 10:55:15 +0800 +Subject: [BUILTIN] Fix EXEXEC status clobbering + +evalcommand always clobbers the exit status in case of an EXEXEC +which means that exec always fails with exit status 2 regardless +of what it actually returns. + +This patch adds the missing check for EXEXEC so that the correct +exit status is preserved. + +Signed-off-by: Herbert Xu +(cherry picked from commit 7f684260a2426ac61c06d2e4822429b00437ae24) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/eval.c | 2 +- + 2 files changed, 5 insertions(+), 1 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 4a1f925..0c08e7d 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-10-07 Herbert Xu ++ ++ * Fix EXEXEC status clobbering. ++ + 2010-09-08 Herbert Xu + + * Fix ifsfirst/ifslastp leak. +diff --git a/src/eval.c b/src/eval.c +index 5b8d36b..b966749 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -854,7 +854,7 @@ bail: + int i; + + i = exception; +- if (i == EXEXIT) ++ if (i == EXEXIT || i == EXEXEC) + goto raise; + + status = (i == EXINT) ? SIGINT + 128 : 2; +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0025-EXPAND-Fix-ifsfirst-ifslastp-leak-in-casematch.diff +++ dash-0.5.6.1/debian/diff/0025-EXPAND-Fix-ifsfirst-ifslastp-leak-in-casematch.diff @@ -0,0 +1,50 @@ +From a7fa0fd13bafa80d2184a15e4e177b1df50031d3 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Mon, 18 Oct 2010 10:55:42 +0800 +Subject: [EXPAND] Fix ifsfirst/ifslastp leak in casematch + +The commit f42e443bb511ed3224f09b4fcf0772438ebdbbfa + + [EXPAND] Fix ifsfirst/ifslastp leak + +revealed yet another ifsfirst/ifslastp leak in casematch. +Previously it was hidden because ifsfirst/ifslastp was cleared +unconditionally on entry (which caused the leakage of those +entries). + +Signed-off-by: Herbert Xu +(cherry picked from commit 016b529d2b114efc6cd91fe4e3e4767ba615870a) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/expand.c | 1 + + 2 files changed, 5 insertions(+), 0 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 0c08e7d..c6c3d12 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-10-18 Herbert Xu ++ ++ * Fix ifsfirst/ifslastp leak in casematch. ++ + 2010-10-07 Herbert Xu + + * Fix EXEXEC status clobbering. +diff --git a/src/expand.c b/src/expand.c +index d6c6416..1b77b7c 100644 +--- a/src/expand.c ++++ b/src/expand.c +@@ -1679,6 +1679,7 @@ casematch(union node *pattern, char *val) + STARTSTACKSTR(expdest); + argstr(pattern->narg.text, EXP_TILDE | EXP_CASE); + STACKSTRNUL(expdest); ++ ifsfree(); + result = patmatch(stackblock(), val); + popstackmark(&smark); + return result; +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0026-EVAL-Fixed-trap-return-regression-due-to-SKIPEVAL-rem.diff +++ dash-0.5.6.1/debian/diff/0026-EVAL-Fixed-trap-return-regression-due-to-SKIPEVAL-rem.diff @@ -0,0 +1,129 @@ +From 4a628d1e700cb0e70f69b6bb266a337bc19966a2 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Sun, 28 Nov 2010 15:17:45 +0800 +Subject: [EVAL] Fixed trap/return regression due to SKIPEVAL removal + +On Wed, Aug 11, 2010 at 08:06:16AM +0000, Guido Berhoerster wrote: +> +> with the latest git version of dash trap actions are not +> evaluated in the context of a function. +> +> The following script demonstrates the bug: +> ----8<---- +> read_timeout () { +> saved_traps="$(trap)" +> trap 'printf "timed out\n"; eval "${saved_traps}"; return' TERM +> ( sleep $1; kill -TERM $$ ) >/dev/null 2>&1 & +> timer_pid=$! +> read $2 +> kill $timer_pid 2>/dev/null +> } +> +> read_timeout 5 value +> printf "read \"%s\"\n" "${value:=default}" +> +> ---->8---- +> The return statement in the trap inside the read_timeout function +> does not return from the function but rather exits the script. +> +> With dash 0.5.5.1 it works as expected. + +This bug was caused by the SKIPEVAL removal. When the SKIPEVAL +hack was added to improve set -e support in traps, dotrap was +changed to return whether set -e was detected. After the removal +of SKIPEVAL, set -e is now handled through exraise. + +However, dotrap still returned a value which is now incorrectly +used to trigger an exraise. + +This patch removes the vestigial link between dotrap and exraise. + +Signed-off-by: Herbert Xu +(cherry picked from commit faefce1ebe585366b1458031f2c1f723dc630def) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/eval.c | 12 +++++++++--- + src/trap.c | 7 ++----- + src/trap.h | 2 +- + 4 files changed, 16 insertions(+), 9 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index c6c3d12..d1d36ef 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-11-28 Herbert Xu ++ ++ * Fixed trap/return regression due to SKIPEVAL removal. ++ + 2010-10-18 Herbert Xu + + * Fix ifsfirst/ifslastp leak in casematch. +diff --git a/src/eval.c b/src/eval.c +index b966749..ea4afc6 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -304,10 +304,16 @@ setstatus: + break; + } + out: +- if ((checkexit & exitstatus) || +- (pendingsigs && dotrap()) || +- (flags & EV_EXIT)) ++ if (checkexit & exitstatus) ++ goto exexit; ++ ++ if (pendingsigs) ++ dotrap(); ++ ++ if (flags & EV_EXIT) { ++exexit: + exraise(EXEXIT); ++ } + } + + +diff --git a/src/trap.c b/src/trap.c +index 7bd60ab..3d28485 100644 +--- a/src/trap.c ++++ b/src/trap.c +@@ -309,8 +309,7 @@ onsig(int signo) + * handlers while we are executing a trap handler. + */ + +-int +-dotrap(void) ++void dotrap(void) + { + char *p; + char *q; +@@ -332,10 +331,8 @@ dotrap(void) + evalstring(p, 0); + exitstatus = savestatus; + if (evalskip) +- return evalskip; ++ break; + } +- +- return 0; + } + + +diff --git a/src/trap.h b/src/trap.h +index bdd7944..7573fd7 100644 +--- a/src/trap.h ++++ b/src/trap.h +@@ -46,7 +46,7 @@ void clear_traps(void); + void setsignal(int); + void ignoresig(int); + void onsig(int); +-int dotrap(void); ++void dotrap(void); + void setinteractive(int); + void exitshell(void) __attribute__((__noreturn__)); + int decode_signal(const char *, int); +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0027-MAN-Document-optional-open-parenthesis-for-case-patte.diff +++ dash-0.5.6.1/debian/diff/0027-MAN-Document-optional-open-parenthesis-for-case-patte.diff @@ -0,0 +1,60 @@ +From a76d9cb127ec01e610448f12ff9c91383f721098 Mon Sep 17 00:00:00 2001 +From: Philipp Weis +Date: Sun, 28 Nov 2010 19:40:17 +0800 +Subject: [MAN] Document optional open parenthesis for case patterns + +While inspecting some dash scripts on my system, I was surprised to +see that some of them use an open parenthesis at the beginning of case +patterns while that's not mentioned in the manpage. Dash currently is +fine with and without that parenthesis (parser.c:413). The attached +patch documents this feature. + +Signed-off-by: Herbert Xu +(cherry picked from commit 83a7565d3c3a74cc2df831e86f9fd3f979a3f7aa) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/dash.1 | 7 ++++++- + 2 files changed, 10 insertions(+), 1 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index d1d36ef..487ed7b 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-11-28 Philipp Weis ++ ++ * Document optional open parenthesis for case patterns. ++ + 2010-11-28 Herbert Xu + + * Fixed trap/return regression due to SKIPEVAL removal. +diff --git a/src/dash.1 b/src/dash.1 +index c7771d0..ddeb52b 100644 +--- a/src/dash.1 ++++ b/src/dash.1 +@@ -663,7 +663,7 @@ These are implemented as builtin commands. + The syntax of the case command is + .Bd -literal -offset indent + case word in +-pattern) list ;; ++[(]pattern) list ;; + \&... + esac + .Ed +@@ -673,6 +673,11 @@ The pattern can actually be one or more patterns (see + described later), separated by + .Dq \*(Ba + characters. ++The ++.Do ++( ++.Dc ++character before the pattern is optional. + .Ss Grouping Commands Together + Commands may be grouped by writing either + .Pp +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0028-ERROR-Allow-the-originator-of-EXERROR-to-set-the-exit.diff +++ dash-0.5.6.1/debian/diff/0028-ERROR-Allow-the-originator-of-EXERROR-to-set-the-exit.diff @@ -0,0 +1,81 @@ +From b3d26b9e71f36c5b22149af76decc5483e0a3148 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Sun, 28 Nov 2010 20:22:00 +0800 +Subject: [ERROR] Allow the originator of EXERROR to set the exit status + +Some errors have exit status values specified by POSIX and it is +therefore desirable to be able to set the exit status at the EXERROR +source rather than in main.c. + +Signed-off-by: Herbert Xu +(cherry picked from commit a42317f10233cf2fcff033cc705fd14315188374) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 1 + + src/error.c | 2 ++ + src/eval.c | 6 ++++-- + src/main.c | 2 -- + 4 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 487ed7b..7f0de2c 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -5,6 +5,7 @@ + 2010-11-28 Herbert Xu + + * Fixed trap/return regression due to SKIPEVAL removal. ++ * Allow the originator of EXERROR to set the exit status. + + 2010-10-18 Herbert Xu + +diff --git a/src/error.c b/src/error.c +index e304d3d..f1a358d 100644 +--- a/src/error.c ++++ b/src/error.c +@@ -163,6 +163,8 @@ sh_error(const char *msg, ...) + { + va_list ap; + ++ exitstatus = 2; ++ + va_start(ap, msg); + exverror(EXERROR, msg, ap); + /* NOTREACHED */ +diff --git a/src/eval.c b/src/eval.c +index ea4afc6..013a8dd 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -823,11 +823,13 @@ evalcommand(union node *cmd, int flags) + } + + if (status) { ++bail: ++ exitstatus = status; ++ + /* We have a redirection error. */ + if (spclbltin > 0) + exraise(EXERROR); +-bail: +- exitstatus = status; ++ + goto out; + } + +diff --git a/src/main.c b/src/main.c +index 2bff956..1735c67 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -113,8 +113,6 @@ main(int argc, char **argv) + reset(); + + e = exception; +- if (e == EXERROR) +- exitstatus = 2; + + s = state; + if (e == EXEXIT || s == 0 || iflag == 0 || shlvl) +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0029-INPUT-Use-exit-status-127-when-the-script-to-run-does.diff +++ dash-0.5.6.1/debian/diff/0029-INPUT-Use-exit-status-127-when-the-script-to-run-does.diff @@ -0,0 +1,61 @@ +From 37cf7f5ba73b4e3bb92a0ae1be5352b0c7f8d9aa Mon Sep 17 00:00:00 2001 +From: Gerrit Pape +Date: Sun, 28 Nov 2010 20:32:00 +0800 +Subject: [INPUT] Use exit status 127 when the script to run does not exist + +This commit makes dash exit with return code 127 instead of 2 if +started as non-interactive shell with a non-existent command_file +specified as argument (or a directory), as documented in + http://www.opengroup.org/onlinepubs/009695399/utilities/sh.html#tag_04_128_14 + +The wrong exit code was reported by Clint Adams and Jari Aalto through + http://bugs.debian.org/548743 + http://bugs.debian.org/548687 + +Signed-off-by: Gerrit Pape +Signed-off-by: Herbert Xu +(cherry picked from commit 34f60a3781ea8f17f3d2a1a743a9aab9b31a296f) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/input.c | 4 +++- + 2 files changed, 7 insertions(+), 1 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 7f0de2c..1110970 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-11-28 Gerrit Pape ++ ++ * Use exit status 127 when the script to run does not exist. ++ + 2010-11-28 Philipp Weis + + * Document optional open parenthesis for case patterns. +diff --git a/src/input.c b/src/input.c +index e57ad76..bd3a9a2 100644 +--- a/src/input.c ++++ b/src/input.c +@@ -42,6 +42,7 @@ + * This file implements the input routines used by the parser. + */ + ++#include "eval.h" + #include "shell.h" + #include "redir.h" + #include "syntax.h" +@@ -408,7 +409,8 @@ setinputfile(const char *fname, int flags) + if ((fd = open(fname, O_RDONLY)) < 0) { + if (flags & INPUT_NOFILE_OK) + goto out; +- sh_error("Can't open %s", fname); ++ exitstatus = 127; ++ exerror(EXERROR, "Can't open %s", fname); + } + if (fd < 10) + fd = savefd(fd, fd); +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0030-BUILTIN-Use-EXEXIT-in-place-of-EXEXEC.diff +++ dash-0.5.6.1/debian/diff/0030-BUILTIN-Use-EXEXIT-in-place-of-EXEXEC.diff @@ -0,0 +1,87 @@ +From d273ef80d08fbf790df65bf7a0ffaea723a9490f Mon Sep 17 00:00:00 2001 +From: Jonathan Nieder +Date: Sun, 28 Nov 2010 20:44:37 +0800 +Subject: [BUILTIN] Use EXEXIT in place of EXEXEC + +The intended semantics of EXEXEC are identical to EXEXIT, so +simplify by using EXEXIT directly. + +Functional change: in edge cases (exec within a trap handler), +this causes the exit status from exec not to be clobbered. +For example, without this patch: + + $ sh -c 'trap "exec nonexistent" EXIT'; echo $? + exec: 1: nonexistent: not found + 0 + +And with it: + + $ sh -c 'trap "exec nonexistent" EXIT'; echo $? + exec: 1: nonexistent: not found + 127 + +Signed-off-by: Jonathan Nieder +Signed-off-by: Herbert Xu +(cherry picked from commit 8949a86cfe5d1daf2f46b5cd6b3bb73f78db2f31) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/error.h | 1 - + src/eval.c | 2 +- + src/exec.c | 2 +- + 4 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 1110970..207ff29 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-11-28 Jonathan Nieder ++ ++ * Use EXEXIT in place of EXEXEC. ++ + 2010-11-28 Gerrit Pape + + * Use exit status 127 when the script to run does not exist. +diff --git a/src/error.h b/src/error.h +index 3162e15..ad1e55b 100644 +--- a/src/error.h ++++ b/src/error.h +@@ -67,7 +67,6 @@ extern int exception; + #define EXINT 0 /* SIGINT received */ + #define EXERROR 1 /* a generic error */ + #define EXSHELLPROC 2 /* execute a shell procedure */ +-#define EXEXEC 3 /* command execution failed */ + #define EXEXIT 4 /* exit the shell */ + + +diff --git a/src/eval.c b/src/eval.c +index 013a8dd..64aabb1 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -862,7 +862,7 @@ bail: + int i; + + i = exception; +- if (i == EXEXIT || i == EXEXEC) ++ if (i == EXEXIT) + goto raise; + + status = (i == EXINT) ? SIGINT + 128 : 2; +diff --git a/src/exec.c b/src/exec.c +index 42299ea..b273420 100644 +--- a/src/exec.c ++++ b/src/exec.c +@@ -141,7 +141,7 @@ shellexec(char **argv, const char *path, int idx) + exitstatus = exerrno; + TRACE(("shellexec failed for %s, errno %d, suppressint %d\n", + argv[0], e, suppressint )); +- exerror(EXEXEC, "%s: %s", argv[0], errmsg(e, E_EXEC)); ++ exerror(EXEXIT, "%s: %s", argv[0], errmsg(e, E_EXEC)); + /* NOTREACHED */ + } + +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0031-BUILTIN-Stop-documenting-EXSHELLPROC.diff +++ dash-0.5.6.1/debian/diff/0031-BUILTIN-Stop-documenting-EXSHELLPROC.diff @@ -0,0 +1,51 @@ +From dcdffbce2ed8467a8c7d82c321c5cd63b589a4b6 Mon Sep 17 00:00:00 2001 +From: Jonathan Nieder +Date: Sun, 28 Nov 2010 20:47:07 +0800 +Subject: [BUILTIN] Stop documenting EXSHELLPROC + +At some point between ash 0.3.5-11.0.1 and ash 0.3.8-37, Debian +ash stopped using the EXSHELLPROC exception to handle shell +scripts without a magic number. + +Remove all remaining references to it to avoid confusion. + +Signed-off-by: Jonathan Nieder +Signed-off-by: Herbert Xu +(cherry picked from commit 8393af1b1412201a2815e0a21cfec1e7d2f83b68) + +[Excluding src/TOUR from the diff --- src/TOUR is not part of upstream +tarballs for some reason.] + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 1 + + src/error.h | 1 - + 2 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 207ff29..a3ffd3e 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,6 +1,7 @@ + 2010-11-28 Jonathan Nieder + + * Use EXEXIT in place of EXEXEC. ++ * Stop documenting EXSHELLPROC. + + 2010-11-28 Gerrit Pape + +diff --git a/src/error.h b/src/error.h +index ad1e55b..f236d9f 100644 +--- a/src/error.h ++++ b/src/error.h +@@ -66,7 +66,6 @@ extern int exception; + /* exceptions */ + #define EXINT 0 /* SIGINT received */ + #define EXERROR 1 /* a generic error */ +-#define EXSHELLPROC 2 /* execute a shell procedure */ + #define EXEXIT 4 /* exit the shell */ + + +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0032-SIGNAL-Mark-status-as-volatile-in-exitshell.diff +++ dash-0.5.6.1/debian/diff/0032-SIGNAL-Mark-status-as-volatile-in-exitshell.diff @@ -0,0 +1,49 @@ +From b358c9cc9e1ec9fc8c0443b457894eea3b01cb70 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Maciej=20=C5=BBenczykowski?= +Date: Sun, 28 Nov 2010 20:55:20 +0800 +Subject: [SIGNAL] Mark status as volatile in exitshell +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +trap.c: In function 'exitshell': +trap.c:354: warning: variable 'status' might be clobbered by 'longjmp' or 'vfork' + +Signed-off-by: Maciej Żenczykowski +Signed-off-by: Herbert Xu +(cherry picked from commit b262e08555a5be355514224d3b47ae48ab447436) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/trap.c | 2 +- + 2 files changed, 5 insertions(+), 1 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index a3ffd3e..c8d979f 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2010-11-28 Maciej Żenczykowski ++ ++ * Mark status as volatile in exitshell. ++ + 2010-11-28 Jonathan Nieder + + * Use EXEXIT in place of EXEXEC. +diff --git a/src/trap.c b/src/trap.c +index 3d28485..17316c9 100644 +--- a/src/trap.c ++++ b/src/trap.c +@@ -366,7 +366,7 @@ exitshell(void) + { + struct jmploc loc; + char *p; +- int status; ++ volatile int status; + + #ifdef HETIO + hetio_reset_term(); +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0033-EXPAND-Free-IFS-state-in-evalbackcmd.diff +++ dash-0.5.6.1/debian/diff/0033-EXPAND-Free-IFS-state-in-evalbackcmd.diff @@ -0,0 +1,72 @@ +From 4220710681ffb2f09812969a7ca8ac6d703d73ee Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Sun, 28 Nov 2010 21:09:51 +0800 +Subject: [EXPAND] Free IFS state in evalbackcmd + +On Sun, Nov 07, 2010 at 04:04:20PM -0600, Jonathan Nieder wrote: +> +> Herbert Xu wrote: +> +> > commit f42e443bb511ed3224f09b4fcf0772438ebdbbfa +> > Author: Herbert Xu +> > Date: Wed Sep 8 20:07:26 2010 +0800 +> > +> > [EXPAND] Fix ifsfirst/ifslastp leak +> +> Another puzzle bisecting to f42e443bb. This one comes from the +> grub-mkconfig script: +> +> $ sh -c 'datadir=/usr/share; pkgdatadir=${datadir}/`cat`' 2>&1 | cat -A +> cat: M-^\^M^F^HM-4^M^F^HM-(^M^F^H: No such file or directory$ +> cat: M-(^M^F^H: No such file or directory$ +> +> Still reproducible with 016b529. I'll try to find time to look into +> it, but thought you might like to know nevertheless. + +This is the symptom of another leak. In this case evalbackcmd +occurs in the middle of an expansion (as it should) but the forked +child never clears the previous IFS state. + +This patch adds the missing ifsfree call. + +This wasn't as much of a problem as the previously discovered leaks +since all it means is that the child gets to carry around the parent's +expansion state and the child is usually short-lived. + +Reported-by: Jonathan Nieder +Signed-off-by: Herbert Xu +(cherry picked from commit 49a94e2bab1e4f601a9fbdf9615d9e4e0150e412) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 1 + + src/eval.c | 1 + + 2 files changed, 2 insertions(+), 0 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index c8d979f..926e597 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -19,6 +19,7 @@ + + * Fixed trap/return regression due to SKIPEVAL removal. + * Allow the originator of EXERROR to set the exit status. ++ * Free IFS state in evalbackcmd. + + 2010-10-18 Herbert Xu + +diff --git a/src/eval.c b/src/eval.c +index 64aabb1..6e5c43e 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -625,6 +625,7 @@ evalbackcmd(union node *n, struct backcmd *result) + dup2(pip[1], 1); + close(pip[1]); + } ++ ifsfree(); + evaltreenr(n, EV_EXIT); + /* NOTREACHED */ + } +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0034-REDIR-Replace-GPL-noclobberopen-code-with-the-FreeBSD.diff +++ dash-0.5.6.1/debian/diff/0034-REDIR-Replace-GPL-noclobberopen-code-with-the-FreeBSD.diff @@ -0,0 +1,144 @@ +From 228504d9c2c17bff4c761f1b2a54e7a4993f3ea2 Mon Sep 17 00:00:00 2001 +From: Jilles Tjoelker +Date: Thu, 10 Mar 2011 16:52:13 +0800 +Subject: [REDIR] Replace GPL noclobberopen code with the FreeBSD version + +Replace noclobberopen() from bash with the FreeBSD code for noclobber +opens. + +This also reduces code size by eliminating an unnecessary check. + +Signed-off-by: Herbert Xu +(cherry picked from commit f78674ed6f95b594dcac0e96d6a76c5f64aa2cbf) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 +++ + src/redir.c | 77 +++++++++++----------------------------------------------- + 2 files changed, 19 insertions(+), 62 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 926e597..320b6ec 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2011-03-10 Jilles Tjoelker ++ ++ * Replace GPL noclobberopen code with the FreeBSD version. ++ + 2010-11-28 Maciej Żenczykowski + + * Mark status as volatile in exitshell. +diff --git a/src/redir.c b/src/redir.c +index b4e49c0..f96a76b 100644 +--- a/src/redir.c ++++ b/src/redir.c +@@ -84,7 +84,6 @@ STATIC void dupredirect(union node *, int, char[10]); + STATIC void dupredirect(union node *, int); + #endif + STATIC int openhere(union node *); +-STATIC int noclobberopen(const char *); + + + /* +@@ -168,6 +167,7 @@ redirect(union node *redir, int flags) + STATIC int + openredirect(union node *redir) + { ++ struct stat64 sb; + char *fname; + int f; + +@@ -186,8 +186,21 @@ openredirect(union node *redir) + /* Take care of noclobber mode. */ + if (Cflag) { + fname = redir->nfile.expfname; +- if ((f = noclobberopen(fname)) < 0) ++ if (stat64(fname, &sb) < 0) { ++ if ((f = open64(fname, O_WRONLY|O_CREAT|O_EXCL, 0666)) < 0) ++ goto ecreate; ++ } else if (!S_ISREG(sb.st_mode)) { ++ if ((f = open64(fname, O_WRONLY, 0666)) < 0) ++ goto ecreate; ++ if (fstat64(f, &sb) < 0 && S_ISREG(sb.st_mode)) { ++ close(f); ++ errno = EEXIST; ++ goto ecreate; ++ } ++ } else { ++ errno = EEXIST; + goto ecreate; ++ } + break; + } + /* FALLTHROUGH */ +@@ -397,66 +410,6 @@ savefd(int from, int ofd) + } + + +-/* +- * Open a file in noclobber mode. +- * The code was copied from bash. +- */ +-int +-noclobberopen(fname) +- const char *fname; +-{ +- int r, fd; +- struct stat64 finfo, finfo2; +- +- /* +- * If the file exists and is a regular file, return an error +- * immediately. +- */ +- r = stat64(fname, &finfo); +- if (r == 0 && S_ISREG(finfo.st_mode)) { +- errno = EEXIST; +- return -1; +- } +- +- /* +- * If the file was not present (r != 0), make sure we open it +- * exclusively so that if it is created before we open it, our open +- * will fail. Make sure that we do not truncate an existing file. +- * Note that we don't turn on O_EXCL unless the stat failed -- if the +- * file was not a regular file, we leave O_EXCL off. +- */ +- if (r != 0) +- return open64(fname, O_WRONLY|O_CREAT|O_EXCL, 0666); +- fd = open64(fname, O_WRONLY|O_CREAT, 0666); +- +- /* If the open failed, return the file descriptor right away. */ +- if (fd < 0) +- return fd; +- +- /* +- * OK, the open succeeded, but the file may have been changed from a +- * non-regular file to a regular file between the stat and the open. +- * We are assuming that the O_EXCL open handles the case where FILENAME +- * did not exist and is symlinked to an existing file between the stat +- * and open. +- */ +- +- /* +- * If we can open it and fstat the file descriptor, and neither check +- * revealed that it was a regular file, and the file has not been +- * replaced, return the file descriptor. +- */ +- if (fstat64(fd, &finfo2) == 0 && !S_ISREG(finfo2.st_mode) && +- finfo.st_dev == finfo2.st_dev && finfo.st_ino == finfo2.st_ino) +- return fd; +- +- /* The file has been replaced. badness. */ +- close(fd); +- errno = EEXIST; +- return -1; +-} +- +- + int + redirectsafe(union node *redir, int flags) + { +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0035-EXPAND-Do-not-split-the-result-of-tilde-expansion.diff +++ dash-0.5.6.1/debian/diff/0035-EXPAND-Do-not-split-the-result-of-tilde-expansion.diff @@ -0,0 +1,62 @@ +From 8026601c747a22ae1266e92dbbaf0c2b4472a757 Mon Sep 17 00:00:00 2001 +From: Jilles Tjoelker +Date: Thu, 10 Mar 2011 17:16:13 +0800 +Subject: [EXPAND] Do not split the result of tilde expansion + +A tilde expansion generates a valid pathname. Splitting it using IFS +either leaves it unchanged or changes it to something unintended. + +This fixes FreeBSD sh test expansion/tilde1.0 and does not change the +outcome of the other tests. + +This fixes Debian bug #601096. + +Example: + IFS=m HOME=/tmp; printf "%s\n" ~ + +Signed-off-by: Herbert Xu +(cherry picked from commit 834629283f6c629a4da05ef60bae9445c954a19a) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 1 + + src/expand.c | 3 --- + 2 files changed, 1 insertions(+), 3 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 320b6ec..f32dced 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,6 +1,7 @@ + 2011-03-10 Jilles Tjoelker + + * Replace GPL noclobberopen code with the FreeBSD version. ++ * Do not split the result of tilde expansion. + + 2010-11-28 Maciej Żenczykowski + +diff --git a/src/expand.c b/src/expand.c +index 1b77b7c..6bee5c5 100644 +--- a/src/expand.c ++++ b/src/expand.c +@@ -364,7 +364,6 @@ exptilde(char *startp, char *p, int flag) + char *name; + const char *home; + int quotes = flag & QUOTES_ESC; +- int startloc; + + name = p + 1; + +@@ -393,9 +392,7 @@ done: + if (!home || !*home) + goto lose; + *p = c; +- startloc = expdest - (char *)stackblock(); + strtodest(home, SQSYNTAX, quotes); +- recordregion(startloc, expdest - (char *)stackblock(), 0); + return (p); + lose: + *p = c; +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0036-SHELL-Port-to-AIX.diff +++ dash-0.5.6.1/debian/diff/0036-SHELL-Port-to-AIX.diff @@ -0,0 +1,69 @@ +From 7b47a0956ed8b6f8284b6cc8cd8ddaa3c0af3975 Mon Sep 17 00:00:00 2001 +From: Brian Koropoff +Date: Thu, 10 Mar 2011 20:19:16 +0800 +Subject: [SHELL] Port to AIX + +- AIX lacks a WCOREDUMP macro. It's just used to + append "(core dumped)" to the crash message, so + #ifdef around it. + +- For some reason, the nl program on AIX defaults + to not printing line numbers ("-b n"), even though + the spec says it should default to "-b t". + Explicitly pass "-b a" for good measure in mkbuiltins. + +Signed-off-by: Brian Koropoff +Signed-off-by: Herbert Xu +(cherry picked from commit 8c7562f11d4baa3316bc7b8547cf6497181468c5) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/jobs.c | 2 ++ + src/mkbuiltins | 2 +- + 3 files changed, 7 insertions(+), 1 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index f32dced..4f35c81 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2011-03-10 Brian Koropoff ++ ++ * Port to AIX. ++ + 2011-03-10 Jilles Tjoelker + + * Replace GPL noclobberopen code with the FreeBSD version. +diff --git a/src/jobs.c b/src/jobs.c +index 826a9af..f67116e 100644 +--- a/src/jobs.c ++++ b/src/jobs.c +@@ -426,9 +426,11 @@ sprint_status(char *s, int status, int sigonly) + #endif + } + col = fmtstr(s, 32, strsignal(st)); ++#ifdef WCOREDUMP + if (WCOREDUMP(status)) { + col += fmtstr(s + col, 16, " (core dumped)"); + } ++#endif + } else if (!sigonly) { + if (st) + col = fmtstr(s, 16, "Done(%d)", st); +diff --git a/src/mkbuiltins b/src/mkbuiltins +index e38ce4c..99107c2 100644 +--- a/src/mkbuiltins ++++ b/src/mkbuiltins +@@ -84,7 +84,7 @@ cat <<\! + */ + + ! +-sed 's/ -[a-z]*//' $temp2 | nl -v 0 | LC_COLLATE=C sort -u -k 3,3 | ++sed 's/ -[a-z]*//' $temp2 | nl -b a -v 0 | LC_COLLATE=C sort -u -k 3,3 | + tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | + awk '{ printf "#define %s (builtincmd + %d)\n", $3, $1}' + printf '\n#define NUMBUILTINS %d\n' $(wc -l < $temp2) +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0037-BUILTIN-Fix-CTLESC-clobbering-by-read-1.diff +++ dash-0.5.6.1/debian/diff/0037-BUILTIN-Fix-CTLESC-clobbering-by-read-1.diff @@ -0,0 +1,51 @@ +From b7650d420320a4a4955ef7aca732271d0de0bdf2 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Thu, 10 Mar 2011 20:59:46 +0800 +Subject: [BUILTIN] Fix CTLESC clobbering by read(1) + +The changeset 55c46b7286f5d9f2d8291158203e2b61d2494420 + + [BUILTIN] Honor tab as IFS whitespace when splitting fields in readcmd + +uses CTLESC to prevent field splitting in read(1). However, +it did not escape CTLESC itself in the input stream. This patch +adds the necessary CTLESC characters so that CTLESC isn't corrupted. + +Reported-by: Alexey Gladkov +Signed-off-by: Herbert Xu +(cherry picked from commit 54413164e587dd2dc5d7bce0bd3fab61d7ba758c) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/miscbltin.c | 2 +- + 2 files changed, 5 insertions(+), 1 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 4f35c81..acb39e9 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2011-03-10 Herbert Xu ++ ++ * Fix CTLESC clobbering by read(1). ++ + 2011-03-10 Brian Koropoff + + * Port to AIX. +diff --git a/src/miscbltin.c b/src/miscbltin.c +index 653c92f..800cbbb 100644 +--- a/src/miscbltin.c ++++ b/src/miscbltin.c +@@ -178,7 +178,7 @@ readcmd(int argc, char **argv) + } + if (c == '\0') + continue; +- if (backslash) { ++ if (backslash || c == CTLESC) { + if (c == '\n') + goto resetbs; + STPUTC(CTLESC, p); +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0038-BUILTIN-Dotcmd-should-exit-with-zero-when-doing-nothi.diff +++ dash-0.5.6.1/debian/diff/0038-BUILTIN-Dotcmd-should-exit-with-zero-when-doing-nothi.diff @@ -0,0 +1,92 @@ +From c6637c827d3c48c4af7042cd9ffaba17b0569a17 Mon Sep 17 00:00:00 2001 +From: Jonathan Nieder +Date: Thu, 10 Mar 2011 21:23:11 +0800 +Subject: [BUILTIN] Dotcmd should exit with zero when doing nothing + +Tim Allen wrote: + +> The POSIX specification for the dot command[1] states: +> +> EXIT STATUS +> Returns the value of the last command executed, or a zero exit +> status if no command is executed. +> +> If an empty file is sourced, then "no command is executed" + +I agree. Looking through "git log --patch src/main.c", though, I find +v0.5.3~42 (Do not clobber exit status in dotcmd., 2005-03-03), which +appears to have been meant to take care of the following case: + + $ cat printstatus.sh + echo $? + $ false + $ . ./printstatus.sh + 1 + +I wonder if the following on top might help (imitating evalcmd)? + +Signed-off-by: Jonathan Nieder +Signed-off-by: Herbert Xu +(cherry picked from commit 8213431d222b56316e225a1f308b62a72fbb1faa) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/main.c | 7 ++++--- + 2 files changed, 8 insertions(+), 3 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index acb39e9..92f46d5 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2011-03-10 Jonathan Nieder ++ ++ * Dotcmd should exit with zero when doing nothing. ++ + 2011-03-10 Herbert Xu + + * Fix CTLESC clobbering by read(1). +diff --git a/src/main.c b/src/main.c +index 1735c67..b38dc27 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -202,6 +202,7 @@ cmdloop(int top) + union node *n; + struct stackmark smark; + int inter; ++ int status = 0; + int numeof = 0; + + TRACE(("cmdloop(%d) called\n", top)); +@@ -235,6 +236,7 @@ cmdloop(int top) + job_warning = (job_warning == 2) ? 1 : 0; + numeof = 0; + evaltree(n, 0); ++ status = exitstatus; + } + popstackmark(&smark); + +@@ -245,7 +247,7 @@ cmdloop(int top) + } + } + +- return 0; ++ return status; + } + + +@@ -325,9 +327,8 @@ dotcmd(int argc, char **argv) + fullname = find_dot_file(argv[1]); + setinputfile(fullname, INPUT_PUSH_FILE); + commandname = fullname; +- cmdloop(0); ++ status = cmdloop(0); + popfile(); +- status = exitstatus; + } + return status; + } +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0039-BUILTIN-Fix-backslash-handling-in-read-1.diff +++ dash-0.5.6.1/debian/diff/0039-BUILTIN-Fix-backslash-handling-in-read-1.diff @@ -0,0 +1,177 @@ +From 9cd05d675ed39940d62bd6543288c472bd0e65a9 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Fri, 11 Mar 2011 11:07:42 +0800 +Subject: [BUILTIN] Fix backslash handling in read(1) + +The new read(1) implementation incorrectly assumes that ifsbreakup +ignores characters escaped by CTLESC. As such it fails to handle +backslashes except for escaping newlines. + +This patch makes it use recordregion for every part that isn't +escaped by a backslash. + +Reported-by: Jilles Tjoelker +Signed-off-by: Herbert Xu +(cherry picked from commit 6e1c8399e82c015f4e9d7d67e98d70541a3ef2d0) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/expand.c | 1 - + src/miscbltin.c | 38 ++++++++++++++++++++++++++------------ + src/mystring.c | 1 + + src/mystring.h | 1 + + 5 files changed, 32 insertions(+), 13 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 92f46d5..9404282 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2011-03-11 Herbert Xu ++ ++ * Fix backslash handling in read(1). ++ + 2011-03-10 Jonathan Nieder + + * Dotcmd should exit with zero when doing nothing. +diff --git a/src/expand.c b/src/expand.c +index 6bee5c5..7a9b157 100644 +--- a/src/expand.c ++++ b/src/expand.c +@@ -1597,7 +1597,6 @@ char * + _rmescapes(char *str, int flag) + { + char *p, *q, *r; +- static const char qchars[] = { CTLESC, CTLQUOTEMARK, 0 }; + unsigned inquotes; + int notescaped; + int globbing; +diff --git a/src/miscbltin.c b/src/miscbltin.c +index 800cbbb..f507381 100644 +--- a/src/miscbltin.c ++++ b/src/miscbltin.c +@@ -71,21 +71,22 @@ + * @param len length of line including trailing '\0' + */ + static void +-readcmd_handle_line(char *line, char **ap, size_t len) ++readcmd_handle_line(char *s, char **ap) + { + struct arglist arglist; + struct strlist *sl; +- char *s, *backup; ++ char *backup; ++ char *line; + + /* ifsbreakup will fiddle with stack region... */ +- s = grabstackstr(line + len); ++ line = stackblock(); ++ s = grabstackstr(s); + + /* need a copy, so that delimiters aren't lost + * in case there are more fields than variables */ + backup = sstrdup(line); + + arglist.lastp = &arglist.list; +- recordregion(0, len - 1, 0); + + ifsbreakup(s, &arglist); + *arglist.lastp = NULL; +@@ -137,11 +138,12 @@ int + readcmd(int argc, char **argv) + { + char **ap; +- int backslash; + char c; + int rflag; + char *prompt; + char *p; ++ int startloc; ++ int newloc; + int status; + int i; + +@@ -161,9 +163,12 @@ readcmd(int argc, char **argv) + } + if (*(ap = argptr) == NULL) + sh_error("arg count"); ++ + status = 0; +- backslash = 0; + STARTSTACKSTR(p); ++ ++ goto start; ++ + for (;;) { + switch (read(0, &c, 1)) { + case 1: +@@ -178,26 +183,35 @@ readcmd(int argc, char **argv) + } + if (c == '\0') + continue; +- if (backslash || c == CTLESC) { ++ if (newloc >= startloc) { + if (c == '\n') + goto resetbs; +- STPUTC(CTLESC, p); + goto put; + } + if (!rflag && c == '\\') { +- backslash++; ++ newloc = p - (char *)stackblock(); + continue; + } + if (c == '\n') + break; + put: +- STPUTC(c, p); ++ CHECKSTRSPACE(2, p); ++ if (strchr(qchars, c)) ++ USTPUTC(CTLESC, p); ++ USTPUTC(c, p); ++ ++ if (newloc >= startloc) { + resetbs: +- backslash = 0; ++ recordregion(startloc, newloc, 0); ++start: ++ startloc = p - (char *)stackblock(); ++ newloc = startloc - 1; ++ } + } + out: ++ recordregion(startloc, p - (char *)stackblock(), 0); + STACKSTRNUL(p); +- readcmd_handle_line(stackblock(), ap, p + 1 - (char *)stackblock()); ++ readcmd_handle_line(p + 1, ap); + return status; + } + +diff --git a/src/mystring.c b/src/mystring.c +index ce48c82..bbb6b77 100644 +--- a/src/mystring.c ++++ b/src/mystring.c +@@ -62,6 +62,7 @@ const char spcstr[] = " "; + const char snlfmt[] = "%s\n"; + const char dolatstr[] = { CTLQUOTEMARK, CTLVAR, VSNORMAL, '@', '=', + CTLQUOTEMARK, '\0' }; ++const char qchars[] = { CTLESC, CTLQUOTEMARK, 0 }; + const char illnum[] = "Illegal number: %s"; + const char homestr[] = "HOME"; + +diff --git a/src/mystring.h b/src/mystring.h +index 2e0540a..3522523 100644 +--- a/src/mystring.h ++++ b/src/mystring.h +@@ -41,6 +41,7 @@ extern const char snlfmt[]; + extern const char spcstr[]; + extern const char dolatstr[]; + #define DOLATSTRLEN 6 ++extern const char qchars[]; + extern const char illnum[]; + extern const char homestr[]; + +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0040-EVAL-Let-funcnode-refer-to-a-function-definition-not-.diff +++ dash-0.5.6.1/debian/diff/0040-EVAL-Let-funcnode-refer-to-a-function-definition-not-.diff @@ -0,0 +1,95 @@ +From dcf97fb841b5e80d2f96e0882c317f7851cf87a4 Mon Sep 17 00:00:00 2001 +From: Harald van Dijk +Date: Tue, 15 Mar 2011 15:44:47 +0800 +Subject: [EVAL] Let funcnode refer to a function definition, not its first command + +It is not unrelated: I changed the meaning of struct funcnode's field n +to refer to the function definition, rather than the list of the +function's commands, because I needed to refer to the function +definition node from evalfun, which only gets passed a funcnode. But it +is something that could be applied independently (without being useful +by itself), so I've attached it as a separate patch for easier review. + +Signed-off-by: Harald van Dijk +Signed-off-by: Herbert Xu +(cherry picked from commit accde25e09f39d3aca64a50c72f23bf84d312757) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/eval.c | 4 ++-- + src/exec.c | 4 ++-- + src/exec.h | 2 +- + 4 files changed, 9 insertions(+), 5 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 9404282..4884cf2 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2011-03-15 Harald van Dijk ++ ++ * Let funcnode refer to a function definition, not its first command. ++ + 2011-03-11 Herbert Xu + + * Fix backslash handling in read(1). +diff --git a/src/eval.c b/src/eval.c +index 6e5c43e..9f4388a 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -296,7 +296,7 @@ calleval: + } + goto success; + case NDEFUN: +- defun(n->narg.text, n->narg.next); ++ defun(n); + success: + status = 0; + setstatus: +@@ -954,7 +954,7 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags) + shellparam.optind = 1; + shellparam.optoff = -1; + pushlocalvars(); +- evaltree(&func->n, flags & EV_TESTED); ++ evaltree(func->n.narg.next, flags & EV_TESTED); + poplocalvars(0); + funcdone: + INTOFF; +diff --git a/src/exec.c b/src/exec.c +index b273420..7ae34c4 100644 +--- a/src/exec.c ++++ b/src/exec.c +@@ -688,14 +688,14 @@ addcmdentry(char *name, struct cmdentry *entry) + */ + + void +-defun(char *name, union node *func) ++defun(union node *func) + { + struct cmdentry entry; + + INTOFF; + entry.cmdtype = CMDFUNCTION; + entry.u.func = copyfunc(func); +- addcmdentry(name, &entry); ++ addcmdentry(func->narg.text, &entry); + INTON; + } + +diff --git a/src/exec.h b/src/exec.h +index daa6f10..9ccb305 100644 +--- a/src/exec.h ++++ b/src/exec.h +@@ -71,7 +71,7 @@ void changepath(const char *); + #ifdef notdef + void getcmdentry(char *, struct cmdentry *); + #endif +-void defun(char *, union node *); ++void defun(union node *); + void unsetfunc(const char *); + int typecmd(int, char **); + int commandcmd(int, char **); +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0041-SHELL-Improve-LINENO-support.diff +++ dash-0.5.6.1/debian/diff/0041-SHELL-Improve-LINENO-support.diff @@ -0,0 +1,611 @@ +From 99628f8e1c06875a15da1058254eba93ae87cd33 Mon Sep 17 00:00:00 2001 +From: Harald van Dijk +Date: Tue, 15 Mar 2011 15:52:05 +0800 +Subject: [SHELL] Improve LINENO support + +This patch improves LINENO support by storing line numbers in the parse +tree, for commands as well as for function definitions. It makes LINENO +behaves properly when calling functions, and has the added benefit of +improved line numbers in error messages when the last-parsed command is +not the last-executed one. It removes the earlier LINENO support, and +instead sets LINENO from evaltree when a command is executed + +Signed-off-by: Harald van Dijk +Signed-off-by: Herbert Xu +(cherry picked from commit 5bb39bb1995cb12d8da76b1d482df9be1acc2eb4) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 1 + + src/error.c | 12 ++++++------ + src/error.h | 1 + + src/eval.c | 33 +++++++++++++++++++++++++++------ + src/exec.c | 2 +- + src/input.c | 10 ---------- + src/input.h | 1 - + src/jobs.c | 2 +- + src/nodetypes | 11 +++++++++-- + src/parser.c | 35 +++++++++++++++++++++-------------- + src/parser.h | 1 - + src/var.c | 9 ++++++++- + src/var.h | 7 ++++++- + 13 files changed, 81 insertions(+), 44 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 4884cf2..0a4a9d7 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,6 +1,7 @@ + 2011-03-15 Harald van Dijk + + * Let funcnode refer to a function definition, not its first command. ++ * Improve LINENO support. + + 2011-03-11 Herbert Xu + +diff --git a/src/error.c b/src/error.c +index f1a358d..7ad73bc 100644 +--- a/src/error.c ++++ b/src/error.c +@@ -62,6 +62,7 @@ struct jmploc *handler; + int exception; + int suppressint; + volatile sig_atomic_t intpending; ++int errlinno; + + + static void exverror(int, const char *, va_list) +@@ -116,13 +117,12 @@ exvwarning2(const char *msg, va_list ap) + const char *fmt; + + errs = out2; +- name = arg0 ?: "sh"; +- fmt = "%s: "; +- if (commandname) { +- name = commandname; ++ name = arg0 ? arg0 : "sh"; ++ if (!commandname) + fmt = "%s: %d: "; +- } +- outfmt(errs, fmt, name, startlinno); ++ else ++ fmt = "%s: %d: %s: "; ++ outfmt(errs, fmt, name, errlinno, commandname); + doformat(errs, msg, ap); + #if FLUSHERR + outc('\n', errs); +diff --git a/src/error.h b/src/error.h +index f236d9f..9630b56 100644 +--- a/src/error.h ++++ b/src/error.h +@@ -120,6 +120,7 @@ void onint(void) __attribute__((__noreturn__)); + #else + void onint(void); + #endif ++extern int errlinno; + void sh_error(const char *, ...) __attribute__((__noreturn__)); + void exerror(int, const char *, ...) __attribute__((__noreturn__)); + const char *errmsg(int, int); +diff --git a/src/eval.c b/src/eval.c +index 9f4388a..426c03a 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -73,7 +73,7 @@ + int evalskip; /* set if we are skipping commands */ + STATIC int skipcount; /* number of levels to skip */ + MKINIT int loopnest; /* current loop nesting level */ +-static int funcnest; /* depth of function calls */ ++static int funcline; /* starting line number of current function, or 0 if not in a function */ + + + char *commandname; +@@ -218,6 +218,9 @@ evaltree(union node *n, int flags) + status = !exitstatus; + goto setstatus; + case NREDIR: ++ errlinno = lineno = n->nredir.linno; ++ if (funcline) ++ lineno -= funcline - 1; + expredir(n->nredir.redirect); + pushredir(n->nredir.redirect); + status = redirectsafe(n->nredir.redirect, REDIR_PUSH); +@@ -376,6 +379,10 @@ evalfor(union node *n, int flags) + struct strlist *sp; + struct stackmark smark; + ++ errlinno = lineno = n->nfor.linno; ++ if (funcline) ++ lineno -= funcline - 1; ++ + setstackmark(&smark); + arglist.lastp = &arglist.list; + for (argp = n->nfor.args ; argp ; argp = argp->narg.next) { +@@ -417,6 +424,10 @@ evalcase(union node *n, int flags) + struct arglist arglist; + struct stackmark smark; + ++ errlinno = lineno = n->ncase.linno; ++ if (funcline) ++ lineno -= funcline - 1; ++ + setstackmark(&smark); + arglist.lastp = &arglist.list; + expandarg(n->ncase.expr, &arglist, EXP_TILDE); +@@ -448,6 +459,10 @@ evalsubshell(union node *n, int flags) + int backgnd = (n->type == NBACKGND); + int status; + ++ errlinno = lineno = n->nredir.linno; ++ if (funcline) ++ lineno -= funcline - 1; ++ + expredir(n->nredir.redirect); + if (!backgnd && flags & EV_EXIT && !have_traps()) + goto nofork; +@@ -704,6 +719,10 @@ evalcommand(union node *cmd, int flags) + int status; + char **nargv; + ++ errlinno = lineno = cmd->ncmd.linno; ++ if (funcline) ++ lineno -= funcline - 1; ++ + /* First expand the arguments. */ + TRACE(("evalcommand(0x%lx, %d) called\n", (long)cmd, flags)); + setstackmark(&smark); +@@ -737,7 +756,7 @@ evalcommand(union node *cmd, int flags) + *nargv = NULL; + + lastarg = NULL; +- if (iflag && funcnest == 0 && argc > 0) ++ if (iflag && funcline == 0 && argc > 0) + lastarg = nargv[-1]; + + preverrout.fd = 2; +@@ -937,8 +956,10 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags) + struct jmploc *volatile savehandler; + struct jmploc jmploc; + int e; ++ int savefuncline; + + saveparam = shellparam; ++ savefuncline = funcline; + if ((e = setjmp(jmploc.loc))) { + goto funcdone; + } +@@ -947,18 +968,18 @@ evalfun(struct funcnode *func, int argc, char **argv, int flags) + handler = &jmploc; + shellparam.malloc = 0; + func->count++; +- funcnest++; ++ funcline = func->n.ndefun.linno; + INTON; + shellparam.nparam = argc - 1; + shellparam.p = argv + 1; + shellparam.optind = 1; + shellparam.optoff = -1; + pushlocalvars(); +- evaltree(func->n.narg.next, flags & EV_TESTED); ++ evaltree(func->n.ndefun.body, flags & EV_TESTED); + poplocalvars(0); + funcdone: + INTOFF; +- funcnest--; ++ funcline = savefuncline; + freefunc(func); + freeparam(&shellparam); + shellparam = saveparam; +@@ -1048,7 +1069,7 @@ returncmd(int argc, char **argv) + * If called outside a function, do what ksh does; + * skip the rest of the file. + */ +- evalskip = funcnest ? SKIPFUNC : SKIPFILE; ++ evalskip = funcline ? SKIPFUNC : SKIPFILE; + return argv[1] ? number(argv[1]) : exitstatus; + } + +diff --git a/src/exec.c b/src/exec.c +index 7ae34c4..cdf56e2 100644 +--- a/src/exec.c ++++ b/src/exec.c +@@ -695,7 +695,7 @@ defun(union node *func) + INTOFF; + entry.cmdtype = CMDFUNCTION; + entry.u.func = copyfunc(func); +- addcmdentry(func->narg.text, &entry); ++ addcmdentry(func->ndefun.text, &entry); + INTON; + } + +diff --git a/src/input.c b/src/input.c +index bd3a9a2..d31c45b 100644 +--- a/src/input.c ++++ b/src/input.c +@@ -54,7 +54,6 @@ + #include "alias.h" + #include "parser.h" + #include "main.h" +-#include "var.h" + #ifndef SMALL + #include "myhistedit.h" + #endif +@@ -531,12 +530,3 @@ closescript(void) + parsefile->fd = 0; + } + } +- +- +-int lineno_inc(void) +-{ +- int lineno = plinno++; +- +- setvarint("LINENO", lineno, 0); +- return lineno; +-} +diff --git a/src/input.h b/src/input.h +index bdf8857..50a7797 100644 +--- a/src/input.h ++++ b/src/input.h +@@ -61,7 +61,6 @@ void setinputstring(char *); + void popfile(void); + void popallfiles(void); + void closescript(void); +-int lineno_inc(void); + + #define pgetc_macro() \ + (--parsenleft >= 0 ? (signed char)*parsenextc++ : preadbuffer()) +diff --git a/src/jobs.c b/src/jobs.c +index f67116e..ae591a3 100644 +--- a/src/jobs.c ++++ b/src/jobs.c +@@ -1286,7 +1286,7 @@ dotail: + p = "; done"; + goto dodo; + case NDEFUN: +- cmdputs(n->narg.text); ++ cmdputs(n->ndefun.text); + p = "() { ... }"; + goto dotail2; + case NCMD: +diff --git a/src/nodetypes b/src/nodetypes +index 17a7b3c..ceaf478 100644 +--- a/src/nodetypes ++++ b/src/nodetypes +@@ -51,6 +51,7 @@ + + NCMD ncmd # a simple command + type int ++ linno int + assign nodeptr # variable assignments + args nodeptr # the arguments + redirect nodeptr # list of file redirections +@@ -62,6 +63,7 @@ NPIPE npipe # a pipeline + + NREDIR nredir # redirection (of a complex command) + type int ++ linno int + n nodeptr # the command + redirect nodeptr # list of file redirections + +@@ -87,12 +89,14 @@ NUNTIL nbinary # the until statement + + NFOR nfor # the for statement + type int ++ linno int + args nodeptr # for var in args + body nodeptr # do body; done + var string # the for variable + + NCASE ncase # a case statement + type int ++ linno int + expr nodeptr # the word to switch on + cases nodeptr # the list of cases (NCLIST nodes) + +@@ -103,8 +107,11 @@ NCLIST nclist # a case + body nodeptr # code to execute for this case + + +-NDEFUN narg # define a function. The "next" field contains +- # the body of the function. ++NDEFUN ndefun # a function ++ type int ++ linno int ++ text string ++ body nodeptr + + NARG narg # represents a word + type int +diff --git a/src/parser.c b/src/parser.c +index be20ff7..0bfd620 100644 +--- a/src/parser.c ++++ b/src/parser.c +@@ -93,7 +93,6 @@ struct nodelist *backquotelist; + union node *redirnode; + struct heredoc *heredoc; + int quoteflag; /* set if (part of) last token was quoted */ +-int startlinno; /* line # where last token started */ + + + STATIC union node *list(int); +@@ -304,10 +303,13 @@ command(void) + union node *redir, **rpp; + union node **rpp2; + int t; ++ int savelinno; + + redir = NULL; + rpp2 = &redir; + ++ savelinno = plinno; ++ + switch (readtoken()) { + default: + synexpect(-1); +@@ -356,6 +358,7 @@ TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : "")); + synerror("Bad for loop variable"); + n1 = (union node *)stalloc(sizeof (struct nfor)); + n1->type = NFOR; ++ n1->nfor.linno = savelinno; + n1->nfor.var = wordtext; + checkkwd = CHKNL | CHKKWD | CHKALIAS; + if (readtoken() == TIN) { +@@ -395,6 +398,7 @@ TRACE(("expecting DO got %s %s\n", tokname[got], got == TWORD ? wordtext : "")); + case TCASE: + n1 = (union node *)stalloc(sizeof (struct ncase)); + n1->type = NCASE; ++ n1->ncase.linno = savelinno; + if (readtoken() != TWORD) + synexpect(TWORD); + n1->ncase.expr = n2 = (union node *)stalloc(sizeof (struct narg)); +@@ -445,6 +449,7 @@ next_case: + case TLP: + n1 = (union node *)stalloc(sizeof (struct nredir)); + n1->type = NSUBSHELL; ++ n1->nredir.linno = savelinno; + n1->nredir.n = list(0); + n1->nredir.redirect = NULL; + t = TRP; +@@ -477,6 +482,7 @@ redir: + if (n1->type != NSUBSHELL) { + n2 = (union node *)stalloc(sizeof (struct nredir)); + n2->type = NREDIR; ++ n2->nredir.linno = savelinno; + n2->nredir.n = n1; + n1 = n2; + } +@@ -494,6 +500,7 @@ simplecmd(void) { + union node *vars, **vpp; + union node **rpp, *redir; + int savecheckkwd; ++ int savelinno; + + args = NULL; + app = &args; +@@ -503,6 +510,7 @@ simplecmd(void) { + rpp = &redir; + + savecheckkwd = CHKALIAS; ++ savelinno = plinno; + for (;;) { + checkkwd = savecheckkwd; + switch (readtoken()) { +@@ -546,7 +554,9 @@ simplecmd(void) { + synerror("Bad function name"); + n->type = NDEFUN; + checkkwd = CHKNL | CHKKWD | CHKALIAS; +- n->narg.next = command(); ++ n->ndefun.text = n->narg.text; ++ n->ndefun.linno = plinno; ++ n->ndefun.body = command(); + return n; + } + /* fall through */ +@@ -561,6 +571,7 @@ out: + *rpp = NULL; + n = (union node *)stalloc(sizeof (struct ncmd)); + n->type = NCMD; ++ n->ncmd.linno = savelinno; + n->ncmd.args = args; + n->ncmd.assign = vars; + n->ncmd.redirect = redir; +@@ -738,8 +749,6 @@ out: + * quoted. + * If the token is TREDIR, then we set redirnode to a structure containing + * the redirection. +- * In all cases, the variable startlinno is set to the number of the line +- * on which the token starts. + * + * [Change comment: here documents and internal procedures] + * [Readtoken shouldn't have any arguments. Perhaps we should make the +@@ -763,7 +772,6 @@ xxreadtoken(void) + if (needprompt) { + setprompt(2); + } +- startlinno = plinno; + for (;;) { /* until token or start of word found */ + c = pgetc_macro(); + switch (c) { +@@ -776,7 +784,7 @@ xxreadtoken(void) + continue; + case '\\': + if (pgetc() == '\n') { +- startlinno = lineno_inc(); ++ plinno++; + if (doprompt) + setprompt(2); + continue; +@@ -784,7 +792,7 @@ xxreadtoken(void) + pungetc(); + goto breakloop; + case '\n': +- lineno_inc(); ++ plinno++; + needprompt = doprompt; + RETURN(TNL); + case PEOF: +@@ -855,7 +863,6 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) + /* syntax before arithmetic */ + char const *uninitialized_var(prevsyntax); + +- startlinno = plinno; + dblquote = 0; + if (syntax == DQSYNTAX) + dblquote = 1; +@@ -886,7 +893,7 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) + if (syntax == BASESYNTAX) + goto endword; /* exit outer loop */ + USTPUTC(c, out); +- lineno_inc(); ++ plinno++; + if (doprompt) + setprompt(2); + c = pgetc(); +@@ -907,6 +914,7 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) + USTPUTC('\\', out); + pungetc(); + } else if (c == '\n') { ++ plinno++; + if (doprompt) + setprompt(2); + } else { +@@ -1008,7 +1016,6 @@ endword: + if (syntax != BASESYNTAX && eofmark == NULL) + synerror("Unterminated quoted string"); + if (varnest != 0) { +- startlinno = plinno; + /* { */ + synerror("Missing '}'"); + } +@@ -1065,7 +1072,7 @@ checkend: { + + if (c == '\n' || c == PEOF) { + c = PEOF; +- lineno_inc(); ++ plinno++; + needprompt = doprompt; + } else { + int len; +@@ -1315,7 +1322,7 @@ parsebackq: { + + case '\\': + if ((pc = pgetc()) == '\n') { +- lineno_inc(); ++ plinno++; + if (doprompt) + setprompt(2); + /* +@@ -1336,11 +1343,10 @@ parsebackq: { + + case PEOF: + case PEOA: +- startlinno = plinno; + synerror("EOF in backquote substitution"); + + case '\n': +- lineno_inc(); ++ plinno++; + needprompt = doprompt; + break; + +@@ -1472,6 +1478,7 @@ synexpect(int token) + STATIC void + synerror(const char *msg) + { ++ errlinno = plinno; + sh_error("Syntax error: %s", msg); + /* NOTREACHED */ + } +diff --git a/src/parser.h b/src/parser.h +index 6bdf1c9..e6caed6 100644 +--- a/src/parser.h ++++ b/src/parser.h +@@ -77,7 +77,6 @@ extern int tokpushback; + #define NEOF ((union node *)&tokpushback) + extern int whichprompt; /* 1 == PS1, 2 == PS2 */ + extern int checkkwd; +-extern int startlinno; /* line # where last token started */ + + + union node *parsecmd(int); +diff --git a/src/var.c b/src/var.c +index 25c2216..c8e5671 100644 +--- a/src/var.c ++++ b/src/var.c +@@ -33,6 +33,7 @@ + */ + + #include ++#include + #include + #include + +@@ -78,6 +79,9 @@ const char defifsvar[] = "IFS= \t\n"; + const char defifs[] = " \t\n"; + #endif + ++int lineno; ++char linenovar[sizeof("LINENO=")+sizeof(int)*CHAR_BIT/3+1] = "LINENO="; ++ + /* Some macros in var.h depend on the order, add new variables to the end. */ + struct var varinit[] = { + #if ATTY +@@ -95,11 +99,11 @@ struct var varinit[] = { + { 0, VSTRFIXED|VTEXTFIXED, "PS2=> ", 0 }, + { 0, VSTRFIXED|VTEXTFIXED, "PS4=+ ", 0 }, + { 0, VSTRFIXED|VTEXTFIXED, "OPTIND=1", getoptsreset }, ++ { 0, VSTRFIXED|VTEXTFIXED, linenovar, 0 }, + #ifndef SMALL + { 0, VSTRFIXED|VTEXTFIXED|VUNSET, "TERM\0", 0 }, + { 0, VSTRFIXED|VTEXTFIXED|VUNSET, "HISTSIZE\0", sethistsize }, + #endif +- { 0, VSTRFIXED|VTEXTFIXED, "LINENO=1", 0 }, + }; + + STATIC struct var *vartab[VTABSIZE]; +@@ -329,6 +333,9 @@ lookupvar(const char *name) + struct var *v; + + if ((v = *findvar(hashvar(name), name)) && !(v->flags & VUNSET)) { ++ if (v == &vlineno && v->text == linenovar) { ++ fmtstr(linenovar+7, sizeof(linenovar)-7, "%d", lineno); ++ } + return strchrnul(v->text, '=') + 1; + } + return NULL; +diff --git a/src/var.h b/src/var.h +index 7aa051f..3d2c2cb 100644 +--- a/src/var.h ++++ b/src/var.h +@@ -88,8 +88,9 @@ extern struct var varinit[]; + #define vps2 (&vps1)[1] + #define vps4 (&vps2)[1] + #define voptind (&vps4)[1] ++#define vlineno (&voptind)[1] + #ifndef SMALL +-#define vterm (&voptind)[1] ++#define vterm (&vlineno)[1] + #define vhistsize (&vterm)[1] + #endif + +@@ -102,6 +103,9 @@ extern const char defifs[]; + extern const char defpathvar[]; + #define defpath (defpathvar + 5) + ++extern int lineno; ++extern char linenovar[]; ++ + /* + * The following macros access the values of the above variables. + * They have to skip over the name. They return the null string +@@ -117,6 +121,7 @@ extern const char defpathvar[]; + #define ps2val() (vps2.text + 4) + #define ps4val() (vps4.text + 4) + #define optindval() (voptind.text + 7) ++#define linenoval() (vlineno.text + 7) + #ifndef SMALL + #define histsizeval() (vhistsize.text + 9) + #define termval() (vterm.text + 5) +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0042-EXPAND-Free-IFS-state-after-here-document-expansion.diff +++ dash-0.5.6.1/debian/diff/0042-EXPAND-Free-IFS-state-after-here-document-expansion.diff @@ -0,0 +1,81 @@ +From 6d96613f3543784dccabbc6106cb50109ee5e15c Mon Sep 17 00:00:00 2001 +From: Jonathan Nieder +Date: Tue, 15 Mar 2011 16:01:34 +0800 +Subject: [EXPAND] Free IFS state after here document expansion +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Here's another bug bisecting to f42e443bb ([EXPAND] Fix +ifsfirst/ifslastp leak, 2010-09-08). It was found with the following +test case, based on the configure script for Tracker: + + dash -x -c ' + <<-_ACEOF + $@ + _ACEOF + exec + ' - abcdefgh + + + + exec �a + exec: 1: : Permission denied + +The missing ifsfree call is in expandarg when it returns to openhere +during here document expansion. + +Reported-by: Aurelien Jarno +Signed-off-by: Jonathan Nieder +Signed-off-by: Herbert Xu +(cherry picked from commit a58d301405d96fb8ff87cffa3cabe3b110214a31) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/expand.c | 7 +++++-- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 0a4a9d7..ad711e1 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2011-03-15 Jonathan Nieder ++ ++ * Free IFS state after here document expansion. ++ + 2011-03-15 Harald van Dijk + + * Let funcnode refer to a function definition, not its first command. +diff --git a/src/expand.c b/src/expand.c +index 7a9b157..714d07f 100644 +--- a/src/expand.c ++++ b/src/expand.c +@@ -194,7 +194,8 @@ expandarg(union node *arg, struct arglist *arglist, int flag) + p = _STPUTC('\0', expdest); + expdest = p - 1; + if (arglist == NULL) { +- return; /* here document expanded */ ++ /* here document expanded */ ++ goto out; + } + p = grabstackstr(p); + exparg.lastp = &exparg.list; +@@ -212,12 +213,14 @@ expandarg(union node *arg, struct arglist *arglist, int flag) + *exparg.lastp = sp; + exparg.lastp = &sp->next; + } +- ifsfree(); + *exparg.lastp = NULL; + if (exparg.list) { + *arglist->lastp = exparg.list; + arglist->lastp = exparg.lastp; + } ++ ++out: ++ ifsfree(); + } + + +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0043-DEBUG-Use-va_copy-when-reusing-a-va_list.diff +++ dash-0.5.6.1/debian/diff/0043-DEBUG-Use-va_copy-when-reusing-a-va_list.diff @@ -0,0 +1,59 @@ +From 147557672291c1cb73a8eb9e43a84adf5ffcdf86 Mon Sep 17 00:00:00 2001 +From: Jonathan Nieder +Date: Tue, 15 Mar 2011 16:03:47 +0800 +Subject: [DEBUG] Use va_copy when reusing a va_list + +When tracing (with the DEBUG compile-time option set to 1 or 2), +exverror calls TRACEV to print its arguments before passing them on. +So the arguments are consumed by the time exvwarning looks for them, +resulting in a segfault: + + $ sh -c '"' + sh: Syntax error: Unterminated quoted string + $ sh -o debug -c '"' + sh: Segmentation fault (core dumped) + +Make a copy with va_copy to avoid this. + +Signed-off-by: Jonathan Nieder +Signed-off-by: Herbert Xu +(cherry picked from commit fd45f364a8387f7193f2b9be5d316ffb4361a5da) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 1 + + src/error.c | 5 ++++- + 2 files changed, 5 insertions(+), 1 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index ad711e1..2b7c114 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,6 +1,7 @@ + 2011-03-15 Jonathan Nieder + + * Free IFS state after here document expansion. ++ * Use va_copy when reusing a va_list. + + 2011-03-15 Harald van Dijk + +diff --git a/src/error.c b/src/error.c +index 7ad73bc..9d31989 100644 +--- a/src/error.c ++++ b/src/error.c +@@ -143,8 +143,11 @@ exverror(int cond, const char *msg, va_list ap) + { + #ifdef DEBUG + if (msg) { ++ va_list aq; + TRACE(("exverror(%d, \"", cond)); +- TRACEV((msg, ap)); ++ va_copy(aq, ap); ++ TRACEV((msg, aq)); ++ va_end(aq); + TRACE(("\") pid=%d\n", getpid())); + } else + TRACE(("exverror(%d, NULL) pid=%d\n", cond, getpid())); +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0044-PARSER-Fix-clobbering-of-checkkwd.diff +++ dash-0.5.6.1/debian/diff/0044-PARSER-Fix-clobbering-of-checkkwd.diff @@ -0,0 +1,91 @@ +From 5dad22a88bedf7dde00b199b7266ca1d27363e61 Mon Sep 17 00:00:00 2001 +From: Herbert Xu +Date: Tue, 15 Mar 2011 17:41:53 +0800 +Subject: [PARSER] Fix clobbering of checkkwd + +On Sun, Nov 07, 2010 at 02:21:21AM +0000, Jonathan Nieder wrote: +> +> Just ran into some strange behavior: +> +> $ cat test.sh +> #!/bin/sh +> echo hello >greeting +> cat < $(cat greeting) +> EOF +> { +> echo $? +> cat greeting +> } >/dev/null +> +> +> $ sh test.sh +> hello +> test.sh: 7: {: not found +> 127 +> hello +> test.sh: 10: Syntax error: "}" unexpected +> +> bash, mksh, pdksh, and ksh93 all print hello as expected. The problem +> is reproducible with all versions of dash in the git repo. + +This is caused by the clobbering of checkkwd due to readtoken +recursion while parsing a here document. + +This patch fixes it by saving the original value of checkkwd. + +Reported-by: Jonathan Nieder +Signed-off-by: Herbert Xu +(cherry picked from commit ec2c84d3c4dba4b74440d72bdd1de416a9acd2a9) + +Signed-off-by: Jonathan Nieder +--- + ChangeLog | 4 ++++ + src/parser.c | 5 +++-- + 2 files changed, 7 insertions(+), 2 deletions(-) + +diff --git a/ChangeLog b/ChangeLog +index 2b7c114..8e6e991 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2011-03-15 Herbert Xu ++ ++ * Fix clobbering of checkkwd. ++ + 2011-03-15 Jonathan Nieder + + * Free IFS state after here document expansion. +diff --git a/src/parser.c b/src/parser.c +index 0bfd620..528d005 100644 +--- a/src/parser.c ++++ b/src/parser.c +@@ -687,6 +687,7 @@ STATIC int + readtoken(void) + { + int t; ++ int kwd = checkkwd; + #ifdef DEBUG + int alreadyseen = tokpushback; + #endif +@@ -697,7 +698,7 @@ top: + /* + * eat newlines + */ +- if (checkkwd & CHKNL) { ++ if (kwd & CHKNL) { + while (t == TNL) { + parseheredoc(); + t = xxreadtoken(); +@@ -711,7 +712,7 @@ top: + /* + * check for keywords + */ +- if (checkkwd & CHKKWD) { ++ if (kwd & CHKKWD) { + const char *const *pp; + + if ((pp = findkwd(wordtext))) { +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0045-SHELL-print-n-upon-EOF-CTRL-D-when-run-interactively.diff +++ dash-0.5.6.1/debian/diff/0045-SHELL-print-n-upon-EOF-CTRL-D-when-run-interactively.diff @@ -0,0 +1,38 @@ +From e645a3e0d53bb2a025631eb6707cb0497ff15b1d Mon Sep 17 00:00:00 2001 +From: Gerrit Pape +Date: Wed, 11 Feb 2009 01:38:49 +0000 +Subject: [SHELL] print \n upon EOF (CTRL-D) when run interactively + +Suggested by jidanni through + http://bugs.debian.org/476422 + +Signed-off-by: Gerrit Pape +Signed-off-by: Jonathan Nieder +--- + src/main.c | 9 ++++++++- + 1 files changed, 8 insertions(+), 1 deletions(-) + +diff --git a/src/main.c b/src/main.c +index b38dc27..1614ffb 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -227,8 +227,15 @@ cmdloop(int top) + if (!top || numeof >= 50) + break; + if (!stoppedjobs()) { +- if (!Iflag) ++ if (!Iflag) { ++ if (iflag) { ++ out2c('\n'); ++#ifdef FLUSHERR ++ flushout(out2); ++#endif ++ } + break; ++ } + out2str("\nUse \"exit\" to leave shell.\n"); + } + numeof++; +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/diff/0046-PARSER-Remove-backslash-before-in-double-quotes-in-va.diff +++ dash-0.5.6.1/debian/diff/0046-PARSER-Remove-backslash-before-in-double-quotes-in-va.diff @@ -0,0 +1,37 @@ +From 5ee250459f64daba3139b29604ac12873c6fbefc Mon Sep 17 00:00:00 2001 +From: Jilles Tjoelker +Date: Sun, 21 Nov 2010 14:42:22 +0100 +Subject: [PARSER] Remove backslash before } in double-quotes in variable + +The backslash prevents the closing brace from terminating the +substitution, therefore it should be removed. + +FreeBSD sh test expansion/plus-minus2.0 starts working, no other tests +are affected. + +Example: + printf "%s\n" ${$+\}} ${$+"\}"} "${$+\}}" +should print } three times, without backslashes. + +Signed-off-by: Jonathan Nieder +--- + src/parser.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/src/parser.c b/src/parser.c +index 528d005..49528a5 100644 +--- a/src/parser.c ++++ b/src/parser.c +@@ -925,6 +925,9 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) + c != '$' && ( + c != '"' || + eofmark != NULL ++ ) && ( ++ c != '}' || ++ varnest == 0 + ) + ) { + USTPUTC('\\', out); +-- +1.7.4.1 + --- dash-0.5.6.1.orig/debian/po/POTFILES.in +++ dash-0.5.6.1/debian/po/POTFILES.in @@ -0,0 +1 @@ +[type: gettext/rfc822deb] dash.templates.in --- dash-0.5.6.1.orig/debian/po/bg.po +++ dash-0.5.6.1/debian/po/bg.po @@ -0,0 +1,59 @@ +# translation of bg.po to Bulgarian +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Damyan Ivanov , 2008, 2009. +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2009-12-28 15:02+0200\n" +"Last-Translator: Damyan Ivanov \n" +"Language-Team: Bulgarian \n" +"Language: bg\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "Използване на dash като системна обвивка (/bin/sh)?" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "" +"Системната обвивка се използва по подразбиране от скриптовете на обвивката." + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" +"Използването на dash като системна обвивка ще подобри бързодействието на " +"системата като цяло. Тази настройка не променя обвивката на интерактивните " +"потребители." + +#~ msgid "Install dash as /bin/sh?" +#~ msgstr "Инсталиране на dash като /bin/sh?" + +#~ msgid "" +#~ "The default /bin/sh shell on Debian and Debian-based systems is bash." +#~ msgstr "Обвивката по подразбиране (/bin/sh) е bash." + +#~ msgid "" +#~ "However, since the default shell is required to be POSIX-compliant, any " +#~ "shell that conforms to POSIX, such as dash, can serve as /bin/sh. You may " +#~ "wish to do this because dash is faster and smaller than bash." +#~ msgstr "" +#~ "Тъй като изискването към обвивката по подразбиране е единствено да бъде " +#~ "съвместима с POSIX, всяко обвивка, която отговаря на това условие, като " +#~ "например dash, може да изпълнява тази роля. Възможна причина да " +#~ "предпочетете dash пред bash е, че е по-малка и по-бърза." --- dash-0.5.6.1.orig/debian/po/cs.po +++ dash-0.5.6.1/debian/po/cs.po @@ -0,0 +1,59 @@ +# Czech translation of dash templates +# +msgid "" +msgstr "" +"Project-Id-Version: dash\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2010-04-21 20:18+0200\n" +"Last-Translator: Miroslav Kure \n" +"Language-Team: Czech \n" +"Language: cs\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "Použít dash jako výchozí systémový shell (/bin/sh)?" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "Systémový shell je výchozí příkazový interpret shellových skriptů." + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" +"Použití dash jako systémového shellu celkově zlepší výkon systému. Toto " +"nastavení nijak neovlivní interaktivní shell jednotlivých uživatelů." + +#~ msgid "Install dash as /bin/sh?" +#~ msgstr "Nainstalovat dash jako /bin/sh?" + +#~ msgid "" +#~ "The default /bin/sh shell on Debian and Debian-based systems is bash." +#~ msgstr "" +#~ "Výchozím shellem /bin/sh je v Debianu a systémech z něj odvozených bash." + +#~| msgid "" +#~| "However, since the distribution policy requires all shell scripts using /" +#~| "bin/sh to be POSIX compliant, any shell that conforms to POSIX, such as " +#~| "dash, can serve as /bin/sh. You may wish to do this because dash is " +#~| "faster and smaller than bash." +#~ msgid "" +#~ "However, since the default shell is required to be POSIX-compliant, any " +#~ "shell that conforms to POSIX, such as dash, can serve as /bin/sh. You may " +#~ "wish to do this because dash is faster and smaller than bash." +#~ msgstr "" +#~ "Protože však politika distribuce vyžaduje, aby byly všechny shellové " +#~ "skripty využívající /bin/sh kompatibilní s POSIXem, můžete jako /bin/sh " +#~ "použít jakýkoliv shell splňující normu POSIX, například shell dash. " +#~ "Určitě to stojí za vyzkoušení, protože dash je rychlejší a menší než bash." --- dash-0.5.6.1.orig/debian/po/da.po +++ dash-0.5.6.1/debian/po/da.po @@ -0,0 +1,41 @@ +# Danish translation Dash. +# Copyright (C) 2010 Dash & nedenstående oversættere. +# This file is distributed under the same license as the Dash package. +# Claus Hindsgaul , 2004. +# Claus Hindsgaul , 2006. +# Joe Hansen , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: dash\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2010-06-03 17:30+01:00\n" +"Last-Translator: Joe Hansen \n" +"Language-Team: Danish \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "Brug dash som standardsystemskal (/bin/sh)?" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "Systemskallen er standardkommandofortolkeren til skalskript." + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" +"Brug af dash som systemskal vil forbedre systemets generelle ydeevne. Den " +"ændrer ikke på skallen vist til interaktive brugere." --- dash-0.5.6.1.orig/debian/po/de.po +++ dash-0.5.6.1/debian/po/de.po @@ -0,0 +1,57 @@ +# Translation of dash debconf templates to German +# Copyright (C) Helge Kreutzmann , 2006-2009. +# This file is distributed under the same license as the dash package. +# +msgid "" +msgstr "" +"Project-Id-Version: dash 0.5.5.1-2.3\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2009-08-03 20:33+0200\n" +"Last-Translator: Helge Kreutzmann \n" +"Language-Team: de \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "Dash als Standard-Systemshell (/bin/sh) verwenden?" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "" +"Die Systemshell ist der Standard-Kommandointerpreter fr Shell-Skripte." + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" +"Dash als Systemshell zu verwenden verbessert die Gesamtleistung des Systems. " +"Dies verndert nicht die interaktiven Benutzern prsentierte Shell." + +#~ msgid "Install dash as /bin/sh?" +#~ msgstr "Dash als /bin/sh installieren?" + +#~ msgid "" +#~ "The default /bin/sh shell on Debian and Debian-based systems is bash." +#~ msgstr "" +#~ "Standardmig ist bash als /bin/sh in Debian und auf Debian-basierten " +#~ "Systemen installiert." + +#~ msgid "" +#~ "However, since the default shell is required to be POSIX-compliant, any " +#~ "shell that conforms to POSIX, such as dash, can serve as /bin/sh. You may " +#~ "wish to do this because dash is faster and smaller than bash." +#~ msgstr "" +#~ "Da die Standardshell allerdings POSIX-konform sein muss, kann jede Shell, " +#~ "die (wie Dash) POSIX-konform ist als /bin/sh dienen. Eventuell wollen Sie " +#~ "Dash verwenden, da Dash schneller und kleiner als Bash ist." --- dash-0.5.6.1.orig/debian/po/es.po +++ dash-0.5.6.1/debian/po/es.po @@ -0,0 +1,87 @@ +# dash po-debconf translation to Spanish +# Copyright (C) 2008, 2009 Software in the Public Interest +# This file is distributed under the same license as the dash package. +# +# Changes: +# - Initial translation +# Fernando Cerezal López , 2008 +# +# - Updates +# Francisco Javier Cuadrado , 2009 +# +# Traductores, si no conocen el formato PO, merece la pena leer la +# documentación de gettext, especialmente las secciones dedicadas a este +# formato, por ejemplo ejecutando: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Equipo de traducción al español, por favor lean antes de traducir +# los siguientes documentos: +# +# - El proyecto de traducción de Debian al español +# http://www.debian.org/intl/spanish/ +# especialmente las notas de traducción en +# http://www.debian.org/intl/spanish/notas +# +# - La guía de traducción de po's de debconf: +# /usr/share/doc/po-debconf/README-trans +# o http://www.debian.org/intl/l10n/po-debconf/README-trans +# +msgid "" +msgstr "" +"Project-Id-Version: dash 0.5.5.1-2.3\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2009-08-02 17:21+0100\n" +"Last-Translator: Francisco Javier Cuadrado \n" +"Language-Team: Debian l10n Spanish \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "" +"¿Desea utilizar dash como el intérprete de órdenes predeterminado del " +"sistema (/bin/sh)?" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "" +"El intérprete de órdenes del sistema es el que se utiliza de forma " +"predeterminada para todos los programas y scripts." + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" +"El uso de dash como el intérprete de órdenes del sistema mejorará el " +"rendimiento general de éste. Esto no altera el intérprete de órdenes que " +"utilizan los usuarios interactivos." + +#~ msgid "Install dash as /bin/sh?" +#~ msgstr "¿Desea instalar dash como «/bin/sh»?" + +#~ msgid "" +#~ "The default /bin/sh shell on Debian and Debian-based systems is bash." +#~ msgstr "" +#~ "Bash es el intérprete de órdenes «/bin/sh» predeterminado de los sistemas " +#~ "Debian y basados en Debian." + +#~ msgid "" +#~ "However, since the default shell is required to be POSIX-compliant, any " +#~ "shell that conforms to POSIX, such as dash, can serve as /bin/sh. You may " +#~ "wish to do this because dash is faster and smaller than bash." +#~ msgstr "" +#~ "Sin embargo, dado que el intérprete de órdenes tiene que cumplir las " +#~ "normas POSIX, cualquier intérprete compatible con POSIX, como dash, puede " +#~ "servir como «/bin/sh». Puede que lo prefiera porque dash es más rápido y " +#~ "más pequeño que bash." --- dash-0.5.6.1.orig/debian/po/eu.po +++ dash-0.5.6.1/debian/po/eu.po @@ -0,0 +1,65 @@ +# translation of dash_0.5.5.1-3._eu.po to Basque +# translation of dash debconf template to Basque +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Xabier Bilbao , 2008. +# Iñaki Larrañaga Murgoitio , 2008, 2010. +msgid "" +msgstr "" +"Project-Id-Version: dash_0.5.5.1-3._eu\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2010-04-12 12:28+0200\n" +"Last-Translator: Iñaki Larrañaga Murgoitio \n" +"Language-Team: Basque \n" +"Language: eu\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "Erabili dash sistemako shell lehenetsi gisa (/bin/sh)?" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "" +"Sistemako shell-a komandoen interpretatzaile lehenetsia da shell-eko script-" +"entzako." + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" +"Dash erabiltzean (sistemako shell lehenetsi gisa) sistemako errendimendu " +"orokorra hobetzen da. Honek ez du aldatzen erabiltzaileekin elkarreragiteko " +"aurkezten den shell-a." + +#~ msgid "Install dash as /bin/sh?" +#~ msgstr "Dash instalatu /bin/sh gisa?" + +#~ msgid "" +#~ "The default /bin/sh shell on Debian and Debian-based systems is bash." +#~ msgstr "" +#~ "Debian banaketan, eta Debian-en oinarriturikoetan, bash da lehenetsitako /" +#~ "bin/sh shell-a." + +#~ msgid "" +#~ "However, since the default shell is required to be POSIX-compliant, any " +#~ "shell that conforms to POSIX, such as dash, can serve as /bin/sh. You may " +#~ "wish to do this because dash is faster and smaller than bash." +#~ msgstr "" +#~ "Alabaina, lehenetsitako shell-ak POSIX-ekin bateragarria izan behar " +#~ "duenez, POSIX-ekin bat datorren edozein shell, hala nola dash, /bin/sh " +#~ "gisa ezar daiteke. Aldaketa hau egitea nahi izan dezakezu, dash " +#~ "bizkorragoa eta txikiagoa baita bash baino." --- dash-0.5.6.1.orig/debian/po/fi.po +++ dash-0.5.6.1/debian/po/fi.po @@ -0,0 +1,40 @@ +# Esko Arajärvi , 2010. +msgid "" +msgstr "" +"Project-Id-Version: dash 0.5.4-8\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2010-10-17 21:53+0300\n" +"Last-Translator: Esko Arajärvi \n" +"Language-Team: Finnish \n" +"Language: fi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Finnish\n" +"X-Poedit-Country: FINLAND\n" +"X-Generator: Lokalize 1.0\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "Käytetäänkö dashia järjestelmän oletuskomentotulkkina (/bin/sh)?" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "Komentosarjat ajetaan oletuksena järjestelmän komentotulkilla." + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" +"Järjestelmän suorituskykyä voidaan parantaa käyttämällä dashia järjestelmän " +"oletuskomentotulkkina. Tämä ei vaikuta käyttäjille näytettäviin " +"komentotulkkeihin." --- dash-0.5.6.1.orig/debian/po/fr.po +++ dash-0.5.6.1/debian/po/fr.po @@ -0,0 +1,44 @@ +# Translation of dash debconf templates to French +# Copyright (C) 2009 Debian French l10n team +# This file is distributed under the same license as the dash package. +# +# Translator: +# Julien Patriarca , 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: dash 0.5.5.1-2.3\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2009-08-02 13:30+0100\n" +"Last-Translator: Julien Patriarca \n" +"Language-Team: French \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "" +"Utiliser Dash comme interpréteur de ligne de commande par défaut (/bin/sh)?" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "" +"Le shell système est l'intérpréteur de commandes utilisé par le système." + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" +"Utiliser Dash comme interpréteur de ligne de commande du système améliorera " +"les performances globales. Cela ne change pas l'intérpréteur utilisé " +"interactivement par les utilisateurs." --- dash-0.5.6.1.orig/debian/po/gl.po +++ dash-0.5.6.1/debian/po/gl.po @@ -0,0 +1,55 @@ +# Galician translation of dash's debconf templates +# This file is distributed under the same license as the dash package. +# Jacobo Tarrio , 2007, 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: dash\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2008-05-13 00:31+0100\n" +"Last-Translator: Jacobo Tarrio \n" +"Language-Team: Galician \n" +"Language: gl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" + +#~ msgid "Install dash as /bin/sh?" +#~ msgstr "¿Instalar dash coma /bin/sh?" + +#~ msgid "" +#~ "The default /bin/sh shell on Debian and Debian-based systems is bash." +#~ msgstr "" +#~ "O intérprete de ordes /bin/sh por defecto dos sistemas Debian e baseados " +#~ "en Debian é bash." + +#~ msgid "" +#~ "However, since the default shell is required to be POSIX-compliant, any " +#~ "shell that conforms to POSIX, such as dash, can serve as /bin/sh. You may " +#~ "wish to do this because dash is faster and smaller than bash." +#~ msgstr "" +#~ "Nembargantes, como o intérprete de ordes por defecto ten que ser " +#~ "compatible con POSIX, calquera shell que siga POSIX, coma dash, pode " +#~ "servir coma /bin/sh. Pode ser unha boa idea facelo, xa que dash é máis " +#~ "rápido e máis pequeno que bash." --- dash-0.5.6.1.orig/debian/po/it.po +++ dash-0.5.6.1/debian/po/it.po @@ -0,0 +1,41 @@ +# dash -- Italian debconf messages +# This file is distributed under the same license as the dash package. +# Andrea Bolognani , 2006. +# Luca Monducci , 2007 - 2009. +# +msgid "" +msgstr "" +"Project-Id-Version: dash 0.5.5.1 italian debconf templates\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2009-08-09 10:51+0200\n" +"Last-Translator: Luca Monducci \n" +"Language-Team: Italian \n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "Usare dash come shell di sistema (/bin/sh)?" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "" +"La shell di sistema è l'interprete dei comandi predefinito negli script " +"della shell." + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" +"Usando dash come shell di sistema miglioreranno le prestazioni generali del " +"sistema. Non verrà cambiata la shell presentata agli utenti interattivi." --- dash-0.5.6.1.orig/debian/po/ja.po +++ dash-0.5.6.1/debian/po/ja.po @@ -0,0 +1,48 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +msgid "" +msgstr "" +"Project-Id-Version: dash 0.5.5.1-3\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2010-01-09 11:21+0200\n" +"Last-Translator: Hideki Yamane (Debian-JP) \n" +"Language-Team: Japanese \n" +"Language: ja\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "dash をデフォルトのシステムシェル (/bin/sh) として使いますか?" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "" +"システムシェルはシェルスクリプト用のデフォルトのコマンドインタプリタです。" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" +"dash をシステムシェルとして使うことは、システム全体のパフォーマンスを改善しま" +"す。対話的に利用しているユーザのシェルについては、変更しません。" --- dash-0.5.6.1.orig/debian/po/ko.po +++ dash-0.5.6.1/debian/po/ko.po @@ -0,0 +1,54 @@ +# Korean translations for dash package +# dash 패키지에 대한 한국어 번역문. +# Sunjae Park , 2007 - 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: dash\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2008-06-24 18:27-0400\n" +"Last-Translator: Sunjae Park \n" +"Language-Team: Korean \n" +"Language: ko\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" + +#~ msgid "Install dash as /bin/sh?" +#~ msgstr "dash를 /bin/sh로 설치할까요?" + +#~ msgid "" +#~ "The default /bin/sh shell on Debian and Debian-based systems is bash." +#~ msgstr "" +#~ "데비안과 데비안 기반 시스템은 모두 bash를 기본 /bin/sh용 셸로 사용합니다." + +#~ msgid "" +#~ "However, since the default shell is required to be POSIX-compliant, any " +#~ "shell that conforms to POSIX, such as dash, can serve as /bin/sh. You may " +#~ "wish to do this because dash is faster and smaller than bash." +#~ msgstr "" +#~ "하지만 기본 셸은 모두 POSIX 호환이어야 하므로, dash와 같이 POSIX 호환 셸이" +#~ "기만 하면 /bin/sh로 사용할 수 있습니다. dash는 bash보다 작고 빠르기 때문" +#~ "에 dash를 사용하길 원하실 수 있습니다." --- dash-0.5.6.1.orig/debian/po/nl.po +++ dash-0.5.6.1/debian/po/nl.po @@ -0,0 +1,63 @@ +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans +# +# Developers do not need to manually edit POT or PO files. +# +msgid "" +msgstr "" +"Project-Id-Version: dash 0.4.18\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2008-07-21 10:50+0200\n" +"Last-Translator: Thijs Kinkhorst \n" +"Language-Team: Debian Dutch \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=iso-8859-15\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" + +#~ msgid "Install dash as /bin/sh?" +#~ msgstr "dash als /bin/sh installeren?" + +#~ msgid "" +#~ "The default /bin/sh shell on Debian and Debian-based systems is bash." +#~ msgstr "" +#~ "De standaard /bin/sh shell voor Debian en voor op Debian-gebaseerde " +#~ "systemen is bash." + +#~ msgid "" +#~ "However, since the default shell is required to be POSIX-compliant, any " +#~ "shell that conforms to POSIX, such as dash, can serve as /bin/sh. You may " +#~ "wish to do this because dash is faster and smaller than bash." +#~ msgstr "" +#~ "Echter, Debian-beleid eist dat elke shell die zich conformeert aan POSIX, " +#~ "zoals dash, kan worden gebruikt voor /bin/sh. Een reden om dit te " +#~ "overwegen is dat dash sneller en compacter is dan bash." --- dash-0.5.6.1.orig/debian/po/pt.po +++ dash-0.5.6.1/debian/po/pt.po @@ -0,0 +1,61 @@ +# Portuguese translation of dash's debconf messages. +# Copyright (C) 2007 the package copyright holder +# This file is distributed under the same license as the dash package. +# Ricardo Silva , 2007. +# Miguel Figueiredo , 2010. +# +msgid "" +msgstr "" +"Project-Id-Version: dash 0.5.4-9\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2010-04-16 22:37+0100\n" +"Last-Translator: Miguel Figueiredo \n" +"Language-Team: Portuguese \n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "Utilizar o dash como shell predefinida do sistema (/bin/sh)?" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "" +"A shell do sistema é o interpretador de comandos predefinido para scripts da " +"shell." + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" +"Utilizar o dash como shell do sistema irá melhorar a performance em geral do " +"sistema. Não altera a shell apresentada aos utilizadores interactivos." + +#~ msgid "Install dash as /bin/sh?" +#~ msgstr "Instalar dash como /bin/sh?" + +#~ msgid "" +#~ "The default /bin/sh shell on Debian and Debian-based systems is bash." +#~ msgstr "" +#~ "A shell em /bin/sh por omissão em sistemas Debian e baseados em Debian é " +#~ "a bash." + +#~ msgid "" +#~ "However, since the default shell is required to be POSIX-compliant, any " +#~ "shell that conforms to POSIX, such as dash, can serve as /bin/sh. You may " +#~ "wish to do this because dash is faster and smaller than bash." +#~ msgstr "" +#~ "No entanto, uma vez que a shell por omissão tem de ser compatível com " +#~ "POSIX, qualquer shell que o seja, tal como a dash, pode servir como /bin/" +#~ "sh. Você pode querer fazer isto uma vez que a dash é mais pequena e " +#~ "rápida que a bash." --- dash-0.5.6.1.orig/debian/po/pt_BR.po +++ dash-0.5.6.1/debian/po/pt_BR.po @@ -0,0 +1,68 @@ +# dash Brazilian Portuguese translation +# Copyright (C) 2008 THE dash'S COPYRIGHT HOLDER +# This file is distributed under the same license as the dash package. +# André Luís Lopes , 2008. +# Adriano Rafael Gomes , 2008-2010. +# +msgid "" +msgstr "" +"Project-Id-Version: dash 0.5.5.1-3\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2010-05-16 22:18-0300\n" +"Last-Translator: Adriano Rafael Gomes \n" +"Language-Team: Brazilian Portuguese \n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"pt_BR utf-8\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "Usar o dash como shell padrão do sistema (/bin/sh)?" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "" +"O shell do sistema é o interpretador de comandos padrão para shell scripts." + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" +"Usar o dash como shell do sistema irá melhorar o desempenho geral do " +"sistema. Isso não altera o shell apresentado para usuários interativos." + +#~ msgid "Install dash as /bin/sh?" +#~ msgstr "Instalar o dash como /bin/sh?" + +#~ msgid "" +#~ "The default /bin/sh shell on Debian and Debian-based systems is bash." +#~ msgstr "" +#~ "O shell /bin/sh padrão no Debian e em sistemas baseados no Debian é o " +#~ "bash." + +#~| msgid "" +#~| "Bash is the default /bin/sh on a Debian system. However, since the " +#~| "Debian policy requires all shell scripts using /bin/sh to be POSIX " +#~| "compliant, any shell that conforms to POSIX can serve as /bin/sh. Since " +#~| "dash is POSIX compliant, it can be used as /bin/sh. You may wish to do " +#~| "this because dash is faster and smaller than bash." +#~ msgid "" +#~ "However, since the default shell is required to be POSIX-compliant, any " +#~ "shell that conforms to POSIX, such as dash, can serve as /bin/sh. You may " +#~ "wish to do this because dash is faster and smaller than bash." +#~ msgstr "" +#~ "Contudo, como é requerido que o shell padrão seja compatível com o padrão " +#~ "POSIX, qualquer shell que esteja em conformidade com o padrão POSIX, tal " +#~ "como o dash, pode servir como /bin/sh. Você pode desejar fazer isto " +#~ "porque o dash é mais rápido e menor que o bash." --- dash-0.5.6.1.orig/debian/po/ro.po +++ dash-0.5.6.1/debian/po/ro.po @@ -0,0 +1,62 @@ +# translation of ro.po to Romanian +# Romanian translations for PACKAGE package +# Traducerea în limba română pentru pachetul PACKAGE. +# Copyright (C) 2008 THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# +# Eddy Petrisor , 2008. +# Eddy Petrișor , 2008. +msgid "" +msgstr "" +"Project-Id-Version: ro\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2008-06-28 21:24+0300\n" +"Last-Translator: Eddy Petrișor \n" +"Language-Team: Romanian \n" +"Language: ro\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " +"20)) ? 1 : 2;\n" +"X-Generator: KBabel 1.11.4\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" + +#~ msgid "Install dash as /bin/sh?" +#~ msgstr "Se instalează dash ca /bin/sh?" + +#~ msgid "" +#~ "The default /bin/sh shell on Debian and Debian-based systems is bash." +#~ msgstr "" +#~ "Shell-ul implicit /bin/sh pe sistemele Debian și bazate pe Debian este " +#~ "bash." + +#~ msgid "" +#~ "However, since the default shell is required to be POSIX-compliant, any " +#~ "shell that conforms to POSIX, such as dash, can serve as /bin/sh. You may " +#~ "wish to do this because dash is faster and smaller than bash." +#~ msgstr "" +#~ "Totuși, deoarece shell-ul implicit trebuie să respecte standardul POSIX, " +#~ "orice alt shell conform cu POSIX, precum dash, poate fi folosit ca /bin/" +#~ "sh. Ați putea dori acest lucru deoarece dash este mai rapid și mai mic " +#~ "decât bash." --- dash-0.5.6.1.orig/debian/po/ru.po +++ dash-0.5.6.1/debian/po/ru.po @@ -0,0 +1,56 @@ +# translation of ru.po to Russian +# +# Translators, if you are not familiar with the PO format, gettext +# documentation is worth reading, especially sections dedicated to +# this format, e.g. by running: +# info -n '(gettext)PO Files' +# info -n '(gettext)Header Entry' +# Some information specific to po-debconf are available at +# /usr/share/doc/po-debconf/README-trans +# or http://www.debian.org/intl/l10n/po-debconf/README-trans# +# Developers do not need to manually edit POT or PO files. +# +# Ilgiz Kalmetev , 2003. +# Yuri Kozlov , 2007, 2008. +# Yuri Kozlov , 2009. +msgid "" +msgstr "" +"Project-Id-Version: dash 0.5.5.1-2.3\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2009-07-29 21:06+0400\n" +"Last-Translator: Yuri Kozlov \n" +"Language-Team: Russian \n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "" +"Использовать dash в качестве системной оболочки по умолчанию (/bin/sh)?" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "" +"Системная оболочка -- это командный интерпретатор для сценариев оболочки " +"командной строки." + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" +"Использование dash в качестве системной оболочки улучшит общую " +"производительность системы. Это не изменит оболочки командной строки, " +"используемые пользователями." --- dash-0.5.6.1.orig/debian/po/sv.po +++ dash-0.5.6.1/debian/po/sv.po @@ -0,0 +1,63 @@ +# Translation of Dash debconf template to Swedish +# Copyright (C) 2009 Martin Bagge +# This file is distributed under the same license as the Dash package. +# +# Martin Bagge , 2009 +# Martin Ågren , 2008. +msgid "" +msgstr "" +"Project-Id-Version: dash_0.5.4-11_sv\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2009-07-28 22:49+0100\n" +"Last-Translator: Martin Bagge \n" +"Language-Team: Swedish \n" +"Language: sv\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: KBabel 1.11.4\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-Language: Swedish\n" +"X-Poedit-Country: Sweden\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "Ska dash användas som standardskal (/bin/sh)?" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "Systemskalet är kommandotolken för skript skrivna för skalet." + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" +"Att använda dash som systemskal kommer att inverka positivt på " +"drifthastigheten av hela systemet. Det kommer inte innebära att användarnas " +"skal byts ut." + +#~ msgid "Install dash as /bin/sh?" +#~ msgstr "Installera dash som /bin/sh?" + +#~ msgid "" +#~ "The default /bin/sh shell on Debian and Debian-based systems is bash." +#~ msgstr "" +#~ "Standardvalet för skalet /bin/sh på Debian och Debianbaserade system är " +#~ "bash." + +#~ msgid "" +#~ "However, since the default shell is required to be POSIX-compliant, any " +#~ "shell that conforms to POSIX, such as dash, can serve as /bin/sh. You may " +#~ "wish to do this because dash is faster and smaller than bash." +#~ msgstr "" +#~ "Eftersom standardskalet måste vara POSIX-kompatibelt, kan dock vilket " +#~ "POSIX-kompatibelt skal som helst, såsom dash, tjänstgöra som /bin/sh. Du " +#~ "kanske önskar detta eftersom dash är snabbare och mindre än bash." --- dash-0.5.6.1.orig/debian/po/templates.pot +++ dash-0.5.6.1/debian/po/templates.pot @@ -0,0 +1,37 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" --- dash-0.5.6.1.orig/debian/po/tr.po +++ dash-0.5.6.1/debian/po/tr.po @@ -0,0 +1,55 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# Mert Dirik , 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: $paket $surum\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2008-06-17 01:15+0200\n" +"Last-Translator: Mert Dirik \n" +"Language-Team: Debian L10n Turkish \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Poedit-Language: Turkish\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" + +#~ msgid "Install dash as /bin/sh?" +#~ msgstr "dash /bin/sh olarak kurulsun mu?" + +#~ msgid "" +#~ "The default /bin/sh shell on Debian and Debian-based systems is bash." +#~ msgstr "Debian tabanlı sistemlerdeki öntanımlı /bin/sh kabuğu bash'tir." + +#~ msgid "" +#~ "However, since the default shell is required to be POSIX-compliant, any " +#~ "shell that conforms to POSIX, such as dash, can serve as /bin/sh. You may " +#~ "wish to do this because dash is faster and smaller than bash." +#~ msgstr "" +#~ "Ama, öntanımlı kabuğun POSIX uyumlu olması gerektiğinden, POSIX " +#~ "standartlarına uyan herhangi bir kabuk, örneğin dash, /bin/sh olarak " +#~ "kullanılabilir. dash bash'ten daha küçük ve daha hızlı olduğundan dash'i /" +#~ "bin/sh olarak kullanmak isteyebilirsiniz." --- dash-0.5.6.1.orig/debian/po/vi.po +++ dash-0.5.6.1/debian/po/vi.po @@ -0,0 +1,42 @@ +# Vietnamese translation for Dash. +# Copyright © 2010 Free Software Foundation, Inc. +# Clytie Siddall , 2005-2010. +# +msgid "" +msgstr "" +"Project-Id-Version: dash 0.5.5.1-3.1\n" +"Report-Msgid-Bugs-To: dash@packages.debian.org\n" +"POT-Creation-Date: 2009-07-27 12:43+0000\n" +"PO-Revision-Date: 2010-04-10 16:54+0930\n" +"Last-Translator: Clytie Siddall \n" +"Language-Team: Vietnamese \n" +"Language: vi\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Generator: LocFactoryEditor 1.8\n" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "Use dash as the default system shell (/bin/sh)?" +msgstr "Dùng dash làm trình bao hệ thống mặc định (/bin/sh) ?" + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "The system shell is the default command interpreter for shell scripts." +msgstr "" +"Trình bao hệ thống là bộ thông thích lệnh mặc định cho văn lệnh trình bao." + +#. Type: boolean +#. Description +#: ../dash.templates.in:1001 +msgid "" +"Using dash as the system shell will improve the system's overall " +"performance. It does not alter the shell presented to interactive users." +msgstr "" +"Dùng dash làm trình bao hệ thống thì tăng cường hiệu suất toàn cục của hệ " +"thống. Nó không sửa đổi trình bao được hiển thị cho người dùng tương tác (v." +"d. bash, tcsh)."