Source: dash Version: 0.5.8-2.4 Severity: wishlist Tags: patch Dear Maintainer,
Dash does not use debhelper sequencer which would greatly reduce the amount of code in debian/rules. The attached patch converts the package to use it. Cheers, Balint -- Balint Reczey Debian & Ubuntu Developer
diff -Nru dash-0.5.8/debian/ash.docs dash-0.5.8/debian/ash.docs --- dash-0.5.8/debian/ash.docs 1969-12-31 16:00:00.000000000 -0800 +++ dash-0.5.8/debian/ash.docs 2017-06-08 21:41:11.000000000 -0700 @@ -0,0 +1 @@ +changelog \ No newline at end of file diff -Nru dash-0.5.8/debian/ash.links dash-0.5.8/debian/ash.links --- dash-0.5.8/debian/ash.links 1969-12-31 16:00:00.000000000 -0800 +++ dash-0.5.8/debian/ash.links 2017-06-08 21:41:11.000000000 -0700 @@ -0,0 +1,2 @@ +bin/dash bin/ash +usr/share/man/man1/dash.1.gz usr/share/man/man1/ash.1.gz \ No newline at end of file diff -Nru dash-0.5.8/debian/changelog dash-0.5.8/debian/changelog --- dash-0.5.8/debian/changelog 2017-06-08 21:42:21.000000000 -0700 +++ dash-0.5.8/debian/changelog 2017-06-08 21:41:11.000000000 -0700 @@ -1,3 +1,12 @@ +dash (0.5.8-2.5) unstable; urgency=medium + + * Non-maintainer upload. + * Move to quilt + * Refresh patches + * Move to Debhelper 10 + + -- Balint Reczey <[email protected]> Thu, 08 Jun 2017 21:37:45 -0700 + dash (0.5.8-2.4) unstable; urgency=medium * Non-maintainer upload. diff -Nru dash-0.5.8/debian/compat dash-0.5.8/debian/compat --- dash-0.5.8/debian/compat 1969-12-31 16:00:00.000000000 -0800 +++ dash-0.5.8/debian/compat 2017-06-08 21:41:11.000000000 -0700 @@ -0,0 +1 @@ +10 diff -Nru dash-0.5.8/debian/control dash-0.5.8/debian/control --- dash-0.5.8/debian/control 2017-06-08 21:42:21.000000000 -0700 +++ dash-0.5.8/debian/control 2017-06-08 21:41:11.000000000 -0700 @@ -2,7 +2,9 @@ Section: shells Priority: optional Maintainer: Gerrit Pape <[email protected]> -Build-Depends: po-debconf, dpkg-dev (>= 1.16.1), +Build-Depends: debhelper (>= 10), + dpkg-dev (>= 1.16.1), + po-debconf Standards-Version: 3.9.3.0 Homepage: http://gondor.apana.org.au/~herbert/dash/ Vcs-Git: http://smarden.org/git/dash.git/ diff -Nru dash-0.5.8/debian/dash.docs dash-0.5.8/debian/dash.docs --- dash-0.5.8/debian/dash.docs 2017-06-08 21:42:21.000000000 -0700 +++ dash-0.5.8/debian/dash.docs 2017-06-08 21:41:11.000000000 -0700 @@ -1 +1,3 @@ debian/README.Debian.diet +debian/NEWS.Debian +changelog \ No newline at end of file diff -Nru dash-0.5.8/debian/dash.install dash-0.5.8/debian/dash.install --- dash-0.5.8/debian/dash.install 1969-12-31 16:00:00.000000000 -0800 +++ dash-0.5.8/debian/dash.install 2017-06-08 21:41:11.000000000 -0700 @@ -0,0 +1 @@ +usr/bin/dash bin diff -Nru dash-0.5.8/debian/dash.links dash-0.5.8/debian/dash.links --- dash-0.5.8/debian/dash.links 1969-12-31 16:00:00.000000000 -0800 +++ dash-0.5.8/debian/dash.links 2017-06-08 21:41:11.000000000 -0700 @@ -0,0 +1,2 @@ +bin/dash bin/sh +usr/share/man/man1/dash.1.gz usr/share/man/man1/sh.1.gz diff -Nru dash-0.5.8/debian/dash.manpages dash-0.5.8/debian/dash.manpages --- dash-0.5.8/debian/dash.manpages 1969-12-31 16:00:00.000000000 -0800 +++ dash-0.5.8/debian/dash.manpages 2017-06-08 21:41:11.000000000 -0700 @@ -0,0 +1 @@ +src/dash.1 diff -Nru dash-0.5.8/debian/dash.NEWS.Debian dash-0.5.8/debian/dash.NEWS.Debian --- dash-0.5.8/debian/dash.NEWS.Debian 2017-06-08 21:42:21.000000000 -0700 +++ dash-0.5.8/debian/dash.NEWS.Debian 1969-12-31 16:00:00.000000000 -0800 @@ -1,10 +0,0 @@ -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 <[email protected]> Wed, 22 Jul 2009 17:23:20 +0200 diff -Nru dash-0.5.8/debian/diff/0001-SHELL-print-n-upon-EOF-CTRL-D-when-run-interactively.diff dash-0.5.8/debian/diff/0001-SHELL-print-n-upon-EOF-CTRL-D-when-run-interactively.diff --- dash-0.5.8/debian/diff/0001-SHELL-print-n-upon-EOF-CTRL-D-when-run-interactively.diff 2017-06-08 21:42:21.000000000 -0700 +++ dash-0.5.8/debian/diff/0001-SHELL-print-n-upon-EOF-CTRL-D-when-run-interactively.diff 1969-12-31 16:00:00.000000000 -0800 @@ -1,38 +0,0 @@ -From 8e1751b198cf0872519319724eae00e399c2db83 Mon Sep 17 00:00:00 2001 -From: Gerrit Pape <[email protected]> -Date: Wed, 11 Feb 2009 01:38:49 +0000 -Subject: [PATCH 1/6] [SHELL] print \n upon EOF (CTRL-D) when run interactively - -Suggested by jidanni through - http://bugs.debian.org/476422 - -Signed-off-by: Gerrit Pape <[email protected]> -Signed-off-by: Jonathan Nieder <[email protected]> ---- - src/main.c | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/src/main.c b/src/main.c -index f79ad7d..efd7da8 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++; --- -2.1.0 - diff -Nru dash-0.5.8/debian/diff/0002-PARSER-Remove-backslash-before-in-double-quotes-in-va.diff dash-0.5.8/debian/diff/0002-PARSER-Remove-backslash-before-in-double-quotes-in-va.diff --- dash-0.5.8/debian/diff/0002-PARSER-Remove-backslash-before-in-double-quotes-in-va.diff 2017-06-08 21:42:21.000000000 -0700 +++ dash-0.5.8/debian/diff/0002-PARSER-Remove-backslash-before-in-double-quotes-in-va.diff 1969-12-31 16:00:00.000000000 -0800 @@ -1,38 +0,0 @@ -From e2df6dcefedb2cc6b1d0559154a871587ed2748d Mon Sep 17 00:00:00 2001 -From: Jilles Tjoelker <[email protected]> -Date: Sun, 21 Nov 2010 14:42:22 +0100 -Subject: [PATCH 2/6] [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 <[email protected]> ---- - src/parser.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/src/parser.c b/src/parser.c -index 572cbcd..33bb77d 100644 ---- a/src/parser.c -+++ b/src/parser.c -@@ -926,6 +926,9 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) - c != '$' && ( - c != '"' || - eofmark != NULL -+ ) && ( -+ c != '}' || -+ varnest == 0 - ) - ) { - USTPUTC('\\', out); --- -2.1.0 - diff -Nru dash-0.5.8/debian/diff/0003-BUILTIN-Fix-test-x-as-root-on-platforms-with-old-fash.diff dash-0.5.8/debian/diff/0003-BUILTIN-Fix-test-x-as-root-on-platforms-with-old-fash.diff --- dash-0.5.8/debian/diff/0003-BUILTIN-Fix-test-x-as-root-on-platforms-with-old-fash.diff 2017-06-08 21:42:21.000000000 -0700 +++ dash-0.5.8/debian/diff/0003-BUILTIN-Fix-test-x-as-root-on-platforms-with-old-fash.diff 1969-12-31 16:00:00.000000000 -0800 @@ -1,60 +0,0 @@ -From e08afc373611ba3e7f2f90bd8e7ce022a1bebed9 Mon Sep 17 00:00:00 2001 -From: Jonathan Nieder <[email protected]> -Date: Mon, 26 Sep 2011 16:16:37 -0500 -Subject: [PATCH 3/6] [BUILTIN] Fix "test -x" as root on platforms with - old-fashioned faccessat() -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -When dash switched from its own emulation to the true faccessat in -v0.5.7~54 (2010-04-02), on some platforms (e.g., old versions of -glibc-bsd), "test -x <path>" started returning true on all files when -run as root. This violates POSIX.1-2008 §4.4 "File Access -Permission", which says: - - If execute permission is requested, access shall be granted - if execute permission is granted to at least one user by the - file permission bits or by an alternate access control - mechanism; otherwise, access shall be denied. - -Unfortunately, for historical reasons, access() and faccessat() are -allowed by POSIX to return success for X_OK when the current process -is privileged even when the above condition is not fulfilled and -actual execution would fail. Work around this by checking the -permissions bits when mode == X_OK and geteuid() == 0. - -Reported-by: Christoph Egger <[email protected]> -Analysis-by: Petr Salinger <[email protected]> -Signed-off-by: Jonathan Nieder <[email protected]> ---- - src/bltin/test.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/src/bltin/test.c b/src/bltin/test.c -index baa91a5..ca29f40 100644 ---- a/src/bltin/test.c -+++ b/src/bltin/test.c -@@ -489,8 +489,19 @@ equalf (const char *f1, const char *f2) - } - - #ifdef HAVE_FACCESSAT -+static int has_exec_bit_set(const char *path) -+{ -+ struct stat64 st; -+ -+ if (stat64(path, &st)) -+ return 0; -+ return st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH); -+} -+ - static int test_file_access(const char *path, int mode) - { -+ if (mode == X_OK && geteuid() == 0 && !has_exec_bit_set(path)) -+ return 0; - return !faccessat(AT_FDCWD, path, mode, AT_EACCESS); - } - #else /* HAVE_FACCESSAT */ --- -2.1.0 - diff -Nru dash-0.5.8/debian/diff/0004-SHELL-Disable-sh-c-command-sh-c-exec-command-optimiza.diff dash-0.5.8/debian/diff/0004-SHELL-Disable-sh-c-command-sh-c-exec-command-optimiza.diff --- dash-0.5.8/debian/diff/0004-SHELL-Disable-sh-c-command-sh-c-exec-command-optimiza.diff 2017-06-08 21:42:21.000000000 -0700 +++ dash-0.5.8/debian/diff/0004-SHELL-Disable-sh-c-command-sh-c-exec-command-optimiza.diff 1969-12-31 16:00:00.000000000 -0800 @@ -1,37 +0,0 @@ -From dc3e43ef32309782d0ef5ce72d0b0c89efd1c70f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?St=C3=A9phane=20Glondu?= <[email protected]> -Date: Sun, 25 Sep 2011 19:28:27 +0200 -Subject: [PATCH 4/6] [SHELL] Disable sh -c "command" -> sh -c "exec command" - optimization - -Bugs #642706 (bin-prot FTBFS) and #642835 (sexplib310 FTBFS) can be -fixed by reverting the patch submitted at [1]. I don't understand why. - -[1] http://thread.gmane.org/gmane.comp.shells.dash/556 - -While investigating #642706, in the failing case, I observed that a -cpp process called with "sh -c" gets SIGPIPE while writing to -stderr. In the succeeding case, the write is successful, and is read -by the ocamlbuild process that started "sh -c cpp ...". - -Signed-off-by: Jonathan Nieder <[email protected]> ---- - src/main.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/main.c b/src/main.c -index efd7da8..e1418a9 100644 ---- a/src/main.c -+++ b/src/main.c -@@ -171,7 +171,7 @@ state2: - state3: - state = 4; - if (minusc) -- evalstring(minusc, sflag ? 0 : EV_EXIT); -+ evalstring(minusc, 0); - - if (sflag || minusc == NULL) { - state4: /* XXX ??? - why isn't this before the "if" statement */ --- -2.1.0 - diff -Nru dash-0.5.8/debian/diff/0005-JOBS-address-format-security-build-error.diff dash-0.5.8/debian/diff/0005-JOBS-address-format-security-build-error.diff --- dash-0.5.8/debian/diff/0005-JOBS-address-format-security-build-error.diff 2017-06-08 21:42:21.000000000 -0700 +++ dash-0.5.8/debian/diff/0005-JOBS-address-format-security-build-error.diff 1969-12-31 16:00:00.000000000 -0800 @@ -1,27 +0,0 @@ -From 2dff3fb701cabb75b843b5f35f28773aa3697ec2 Mon Sep 17 00:00:00 2001 -From: Gerrit Pape <[email protected]> -Date: Wed, 8 Jan 2014 12:26:59 +0000 -Subject: [PATCH 5/6] [JOBS] address format-security build error - -Apply patch from Simon Ruderich <[email protected]> included in NMU from -Michael Gilbert. ---- - src/jobs.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/jobs.c b/src/jobs.c -index c2c2332..dcb81c1 100644 ---- a/src/jobs.c -+++ b/src/jobs.c -@@ -427,7 +427,7 @@ sprint_status(char *s, int status, int sigonly) - goto out; - #endif - } -- col = fmtstr(s, 32, strsignal(st)); -+ col = fmtstr(s, 32, "%s", strsignal(st)); - #ifdef WCOREDUMP - if (WCOREDUMP(status)) { - col += fmtstr(s + col, 16, " (core dumped)"); --- -2.1.0 - diff -Nru dash-0.5.8/debian/diff/0006-EVAL-Report-I-O-error-on-stdout.diff dash-0.5.8/debian/diff/0006-EVAL-Report-I-O-error-on-stdout.diff --- dash-0.5.8/debian/diff/0006-EVAL-Report-I-O-error-on-stdout.diff 2017-06-08 21:42:21.000000000 -0700 +++ dash-0.5.8/debian/diff/0006-EVAL-Report-I-O-error-on-stdout.diff 1969-12-31 16:00:00.000000000 -0800 @@ -1,29 +0,0 @@ -From 598b9bad238f1034f2ccb100354f29d5080818e8 Mon Sep 17 00:00:00 2001 -From: Gerrit Pape <[email protected]> -Date: Wed, 8 Jan 2014 12:29:44 +0000 -Subject: [PATCH 6/6] [EVAL] Report I/O error on stdout - -Suggested by Roger Leigh through - http://bugs.debian.org/690473 - -Signed-off-by: Gerrit Pape <[email protected]> ---- - src/eval.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/src/eval.c b/src/eval.c -index c7358a6..3c47b59 100644 ---- a/src/eval.c -+++ b/src/eval.c -@@ -909,6 +909,8 @@ evalbltin(const struct builtincmd *cmd, int argc, char **argv, int flags) - else - status = (*cmd->builtin)(argc, argv); - flushall(); -+ if (outerr(out1)) -+ warnx("%s: I/O error", commandname); - status |= outerr(out1); - exitstatus = status; - cmddone: --- -2.1.0 - diff -Nru dash-0.5.8/debian/diff/0007-Don-t-execute-binary-files-if-execve-returned-ENOEXE.diff dash-0.5.8/debian/diff/0007-Don-t-execute-binary-files-if-execve-returned-ENOEXE.diff --- dash-0.5.8/debian/diff/0007-Don-t-execute-binary-files-if-execve-returned-ENOEXE.diff 2017-06-08 21:42:21.000000000 -0700 +++ dash-0.5.8/debian/diff/0007-Don-t-execute-binary-files-if-execve-returned-ENOEXE.diff 1969-12-31 16:00:00.000000000 -0800 @@ -1,77 +0,0 @@ -From fe901f54d6504076ead29c9447f3abf7a903e9a8 Mon Sep 17 00:00:00 2001 -From: Adam Borowski <[email protected]> -Date: Tue, 24 Jan 2017 05:11:38 +0100 -Subject: [PATCH 1/2] Don't execute binary files if execve() returned ENOEXEC. - -Both "dash -c foo" and "./foo" are supposed to be able to run hashbang-less -scripts, but attempts to execute common binary files tend to be nasty: -especially both ELF and PE tend to make dash create a bunch of files with -unprintable names, that in turn confuse some tools up to causing data loss. - -Thus, let's read the first line and see if it looks like text. This is a -variant of the approach used by bash and zsh; mksh instead checks for -signatures of a bunch of common file types. - -POSIX says: "If the executable file is not a text file, the shell may bypass -this command execution.". - -Signed-off-by: Adam Borowski <[email protected]> ---- - src/exec.c | 34 ++++++++++++++++++++++++++++++++++ - 1 file changed, 34 insertions(+) - -diff --git a/src/exec.c b/src/exec.c -index ec0eadd..72acd5e 100644 ---- a/src/exec.c -+++ b/src/exec.c -@@ -148,6 +148,38 @@ shellexec(char **argv, const char *path, int idx) - } - - -+/* -+ * Check if an executable that just failed with ENOEXEC shouldn't be -+ * considered a script (wrong-arch ELF/PE, junk accidentally set +x, etc). -+ * We check only the first line to allow binaries encapsulated in a shell -+ * script without proper quoting. The first line, if not a hashbang, is -+ * likely to contain comments; even ancient encodings, at least popular -+ * ones, don't use 0x7f nor values below 0x1f other than whitespace (\t, -+ * \n, \v, \f, \r), ISO/IEC 2022 can have SI, SO and \e). -+ */ -+STATIC int file_is_binary(const char *cmd) -+{ -+ char buf[128]; -+ int fd = open(cmd, O_RDONLY|O_NOCTTY); -+ if (fd == -1) -+ return 1; -+ int len = read(fd, buf, sizeof(buf)); -+ for (int i = 0; i < len; ++i) { -+ char c = buf[i]; -+ if (c >= 0 && c <= 8 || -+ c >= 16 && c <= 31 && c != 27 || -+ c == 0x7f) { -+ close(fd); -+ return 1; -+ } -+ if (c == '\n') -+ return 0; -+ } -+ close(fd); -+ return 0; -+} -+ -+ - STATIC void - tryexec(char *cmd, char **argv, char **envp) - { -@@ -162,6 +194,8 @@ repeat: - execve(cmd, argv, envp); - #endif - if (cmd != path_bshell && errno == ENOEXEC) { -+ if (file_is_binary(cmd)) -+ return; - *argv-- = cmd; - *argv = cmd = path_bshell; - goto repeat; --- -2.11.0 - diff -Nru dash-0.5.8/debian/diff/0008-Support-e-in-echo-and-printf-builtins.diff dash-0.5.8/debian/diff/0008-Support-e-in-echo-and-printf-builtins.diff --- dash-0.5.8/debian/diff/0008-Support-e-in-echo-and-printf-builtins.diff 2017-06-08 21:42:21.000000000 -0700 +++ dash-0.5.8/debian/diff/0008-Support-e-in-echo-and-printf-builtins.diff 1969-12-31 16:00:00.000000000 -0800 @@ -1,48 +0,0 @@ -From 95e564ee5fddf0d36e510572daca927f9e139411 Mon Sep 17 00:00:00 2001 -From: Adam Borowski <[email protected]> -Date: Sat, 28 Jun 2014 06:29:56 +0200 -Subject: [PATCH 2/2] Support \e in "echo" and "printf" builtins. - -Signed-off-by: Adam Borowski <[email protected]> ---- - src/bltin/printf.c | 1 + - src/dash.1 | 4 ++++ - 2 files changed, 5 insertions(+) - -diff --git a/src/bltin/printf.c b/src/bltin/printf.c -index a626cee..c34bf66 100644 ---- a/src/bltin/printf.c -+++ b/src/bltin/printf.c -@@ -332,6 +332,7 @@ conv_escape(char *str, int *conv_ch) - case '\\': value = '\\'; break; /* backslash */ - case 'a': value = '\a'; break; /* alert */ - case 'b': value = '\b'; break; /* backspace */ -+ case 'e': value = '\e'; break; /* escape */ - case 'f': value = '\f'; break; /* form-feed */ - case 'n': value = '\n'; break; /* newline */ - case 'r': value = '\r'; break; /* carriage-return */ -diff --git a/src/dash.1 b/src/dash.1 -index 8b8026d..c6f83a5 100644 ---- a/src/dash.1 -+++ b/src/dash.1 -@@ -1201,6 +1201,8 @@ Subsequent output is suppressed. This is normally used at the end of the - last argument to suppress the trailing newline that - .Ic echo - would otherwise output. -+.It Li \ee -+Outputs an escape character (ESC). - .It Li \ef - Output a form feed. - .It Li \en -@@ -1570,6 +1572,8 @@ The characters and their meanings are as follows: - Write a \*[Lt]bell\*[Gt] character. - .It Cm \eb - Write a \*[Lt]backspace\*[Gt] character. -+.It Cm \ee -+Write an \*[Lt]escape\*[Gt] (ESC) character. - .It Cm \ef - Write a \*[Lt]form-feed\*[Gt] character. - .It Cm \en --- -2.11.0 - diff -Nru dash-0.5.8/debian/implicit dash-0.5.8/debian/implicit --- dash-0.5.8/debian/implicit 2017-06-08 21:42:21.000000000 -0700 +++ dash-0.5.8/debian/implicit 1969-12-31 16:00:00.000000000 -0800 @@ -1,98 +0,0 @@ -# $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 -9n 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 -9n 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 -print0 | LC_ALL=C sort -z | \ - xargs -0r md5sum >>DEBIAN/md5sums - @chmod 0644 debian/*/DEBIAN/md5sums -%.deb-DEBIAN: %.deb-checkdir %.deb-DEBIAN-base %.deb-DEBIAN-scripts \ - %.deb-DEBIAN-md5sums - : debian/$*/DEBIAN/ ok diff -Nru dash-0.5.8/debian/NEWS.Debian dash-0.5.8/debian/NEWS.Debian --- dash-0.5.8/debian/NEWS.Debian 1969-12-31 16:00:00.000000000 -0800 +++ dash-0.5.8/debian/NEWS.Debian 2017-06-08 21:41:11.000000000 -0700 @@ -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 <[email protected]> Wed, 22 Jul 2009 17:23:20 +0200 diff -Nru dash-0.5.8/debian/patches/0001-SHELL-print-n-upon-EOF-CTRL-D-when-run-interactively.diff dash-0.5.8/debian/patches/0001-SHELL-print-n-upon-EOF-CTRL-D-when-run-interactively.diff --- dash-0.5.8/debian/patches/0001-SHELL-print-n-upon-EOF-CTRL-D-when-run-interactively.diff 1969-12-31 16:00:00.000000000 -0800 +++ dash-0.5.8/debian/patches/0001-SHELL-print-n-upon-EOF-CTRL-D-when-run-interactively.diff 2017-06-08 21:41:11.000000000 -0700 @@ -0,0 +1,38 @@ +From 8e1751b198cf0872519319724eae00e399c2db83 Mon Sep 17 00:00:00 2001 +From: Gerrit Pape <[email protected]> +Date: Wed, 11 Feb 2009 01:38:49 +0000 +Subject: [PATCH 1/6] [SHELL] print \n upon EOF (CTRL-D) when run interactively + +Suggested by jidanni through + http://bugs.debian.org/476422 + +Signed-off-by: Gerrit Pape <[email protected]> +Signed-off-by: Jonathan Nieder <[email protected]> +--- + src/main.c | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/src/main.c b/src/main.c +index f79ad7d..efd7da8 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++; +-- +2.1.0 + diff -Nru dash-0.5.8/debian/patches/0002-PARSER-Remove-backslash-before-in-double-quotes-in-va.diff dash-0.5.8/debian/patches/0002-PARSER-Remove-backslash-before-in-double-quotes-in-va.diff --- dash-0.5.8/debian/patches/0002-PARSER-Remove-backslash-before-in-double-quotes-in-va.diff 1969-12-31 16:00:00.000000000 -0800 +++ dash-0.5.8/debian/patches/0002-PARSER-Remove-backslash-before-in-double-quotes-in-va.diff 2017-06-08 21:41:11.000000000 -0700 @@ -0,0 +1,38 @@ +From e2df6dcefedb2cc6b1d0559154a871587ed2748d Mon Sep 17 00:00:00 2001 +From: Jilles Tjoelker <[email protected]> +Date: Sun, 21 Nov 2010 14:42:22 +0100 +Subject: [PATCH 2/6] [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 <[email protected]> +--- + src/parser.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/parser.c b/src/parser.c +index 572cbcd..33bb77d 100644 +--- a/src/parser.c ++++ b/src/parser.c +@@ -926,6 +926,9 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) + c != '$' && ( + c != '"' || + eofmark != NULL ++ ) && ( ++ c != '}' || ++ varnest == 0 + ) + ) { + USTPUTC('\\', out); +-- +2.1.0 + diff -Nru dash-0.5.8/debian/patches/0003-BUILTIN-Fix-test-x-as-root-on-platforms-with-old-fash.diff dash-0.5.8/debian/patches/0003-BUILTIN-Fix-test-x-as-root-on-platforms-with-old-fash.diff --- dash-0.5.8/debian/patches/0003-BUILTIN-Fix-test-x-as-root-on-platforms-with-old-fash.diff 1969-12-31 16:00:00.000000000 -0800 +++ dash-0.5.8/debian/patches/0003-BUILTIN-Fix-test-x-as-root-on-platforms-with-old-fash.diff 2017-06-08 21:41:11.000000000 -0700 @@ -0,0 +1,60 @@ +From e08afc373611ba3e7f2f90bd8e7ce022a1bebed9 Mon Sep 17 00:00:00 2001 +From: Jonathan Nieder <[email protected]> +Date: Mon, 26 Sep 2011 16:16:37 -0500 +Subject: [PATCH 3/6] [BUILTIN] Fix "test -x" as root on platforms with + old-fashioned faccessat() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When dash switched from its own emulation to the true faccessat in +v0.5.7~54 (2010-04-02), on some platforms (e.g., old versions of +glibc-bsd), "test -x <path>" started returning true on all files when +run as root. This violates POSIX.1-2008 §4.4 "File Access +Permission", which says: + + If execute permission is requested, access shall be granted + if execute permission is granted to at least one user by the + file permission bits or by an alternate access control + mechanism; otherwise, access shall be denied. + +Unfortunately, for historical reasons, access() and faccessat() are +allowed by POSIX to return success for X_OK when the current process +is privileged even when the above condition is not fulfilled and +actual execution would fail. Work around this by checking the +permissions bits when mode == X_OK and geteuid() == 0. + +Reported-by: Christoph Egger <[email protected]> +Analysis-by: Petr Salinger <[email protected]> +Signed-off-by: Jonathan Nieder <[email protected]> +--- + src/bltin/test.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/src/bltin/test.c b/src/bltin/test.c +index baa91a5..ca29f40 100644 +--- a/src/bltin/test.c ++++ b/src/bltin/test.c +@@ -489,8 +489,19 @@ equalf (const char *f1, const char *f2) + } + + #ifdef HAVE_FACCESSAT ++static int has_exec_bit_set(const char *path) ++{ ++ struct stat64 st; ++ ++ if (stat64(path, &st)) ++ return 0; ++ return st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH); ++} ++ + static int test_file_access(const char *path, int mode) + { ++ if (mode == X_OK && geteuid() == 0 && !has_exec_bit_set(path)) ++ return 0; + return !faccessat(AT_FDCWD, path, mode, AT_EACCESS); + } + #else /* HAVE_FACCESSAT */ +-- +2.1.0 + diff -Nru dash-0.5.8/debian/patches/0004-SHELL-Disable-sh-c-command-sh-c-exec-command-optimiza.diff dash-0.5.8/debian/patches/0004-SHELL-Disable-sh-c-command-sh-c-exec-command-optimiza.diff --- dash-0.5.8/debian/patches/0004-SHELL-Disable-sh-c-command-sh-c-exec-command-optimiza.diff 1969-12-31 16:00:00.000000000 -0800 +++ dash-0.5.8/debian/patches/0004-SHELL-Disable-sh-c-command-sh-c-exec-command-optimiza.diff 2017-06-08 21:41:11.000000000 -0700 @@ -0,0 +1,37 @@ +From dc3e43ef32309782d0ef5ce72d0b0c89efd1c70f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?St=C3=A9phane=20Glondu?= <[email protected]> +Date: Sun, 25 Sep 2011 19:28:27 +0200 +Subject: [PATCH 4/6] [SHELL] Disable sh -c "command" -> sh -c "exec command" + optimization + +Bugs #642706 (bin-prot FTBFS) and #642835 (sexplib310 FTBFS) can be +fixed by reverting the patch submitted at [1]. I don't understand why. + +[1] http://thread.gmane.org/gmane.comp.shells.dash/556 + +While investigating #642706, in the failing case, I observed that a +cpp process called with "sh -c" gets SIGPIPE while writing to +stderr. In the succeeding case, the write is successful, and is read +by the ocamlbuild process that started "sh -c cpp ...". + +Signed-off-by: Jonathan Nieder <[email protected]> +--- + src/main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/main.c b/src/main.c +index efd7da8..e1418a9 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -171,7 +171,7 @@ state2: + state3: + state = 4; + if (minusc) +- evalstring(minusc, sflag ? 0 : EV_EXIT); ++ evalstring(minusc, 0); + + if (sflag || minusc == NULL) { + state4: /* XXX ??? - why isn't this before the "if" statement */ +-- +2.1.0 + diff -Nru dash-0.5.8/debian/patches/0005-JOBS-address-format-security-build-error.diff dash-0.5.8/debian/patches/0005-JOBS-address-format-security-build-error.diff --- dash-0.5.8/debian/patches/0005-JOBS-address-format-security-build-error.diff 1969-12-31 16:00:00.000000000 -0800 +++ dash-0.5.8/debian/patches/0005-JOBS-address-format-security-build-error.diff 2017-06-08 21:41:11.000000000 -0700 @@ -0,0 +1,27 @@ +From 2dff3fb701cabb75b843b5f35f28773aa3697ec2 Mon Sep 17 00:00:00 2001 +From: Gerrit Pape <[email protected]> +Date: Wed, 8 Jan 2014 12:26:59 +0000 +Subject: [PATCH 5/6] [JOBS] address format-security build error + +Apply patch from Simon Ruderich <[email protected]> included in NMU from +Michael Gilbert. +--- + src/jobs.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/jobs.c b/src/jobs.c +index c2c2332..dcb81c1 100644 +--- a/src/jobs.c ++++ b/src/jobs.c +@@ -427,7 +427,7 @@ sprint_status(char *s, int status, int sigonly) + goto out; + #endif + } +- col = fmtstr(s, 32, strsignal(st)); ++ col = fmtstr(s, 32, "%s", strsignal(st)); + #ifdef WCOREDUMP + if (WCOREDUMP(status)) { + col += fmtstr(s + col, 16, " (core dumped)"); +-- +2.1.0 + diff -Nru dash-0.5.8/debian/patches/0006-EVAL-Report-I-O-error-on-stdout.diff dash-0.5.8/debian/patches/0006-EVAL-Report-I-O-error-on-stdout.diff --- dash-0.5.8/debian/patches/0006-EVAL-Report-I-O-error-on-stdout.diff 1969-12-31 16:00:00.000000000 -0800 +++ dash-0.5.8/debian/patches/0006-EVAL-Report-I-O-error-on-stdout.diff 2017-06-08 21:41:11.000000000 -0700 @@ -0,0 +1,29 @@ +From 598b9bad238f1034f2ccb100354f29d5080818e8 Mon Sep 17 00:00:00 2001 +From: Gerrit Pape <[email protected]> +Date: Wed, 8 Jan 2014 12:29:44 +0000 +Subject: [PATCH 6/6] [EVAL] Report I/O error on stdout + +Suggested by Roger Leigh through + http://bugs.debian.org/690473 + +Signed-off-by: Gerrit Pape <[email protected]> +--- + src/eval.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/src/eval.c b/src/eval.c +index c7358a6..3c47b59 100644 +--- a/src/eval.c ++++ b/src/eval.c +@@ -909,6 +909,8 @@ evalbltin(const struct builtincmd *cmd, int argc, char **argv, int flags) + else + status = (*cmd->builtin)(argc, argv); + flushall(); ++ if (outerr(out1)) ++ warnx("%s: I/O error", commandname); + status |= outerr(out1); + exitstatus = status; + cmddone: +-- +2.1.0 + diff -Nru dash-0.5.8/debian/patches/0007-Don-t-execute-binary-files-if-execve-returned-ENOEXE.diff dash-0.5.8/debian/patches/0007-Don-t-execute-binary-files-if-execve-returned-ENOEXE.diff --- dash-0.5.8/debian/patches/0007-Don-t-execute-binary-files-if-execve-returned-ENOEXE.diff 1969-12-31 16:00:00.000000000 -0800 +++ dash-0.5.8/debian/patches/0007-Don-t-execute-binary-files-if-execve-returned-ENOEXE.diff 2017-06-08 21:41:11.000000000 -0700 @@ -0,0 +1,77 @@ +From fe901f54d6504076ead29c9447f3abf7a903e9a8 Mon Sep 17 00:00:00 2001 +From: Adam Borowski <[email protected]> +Date: Tue, 24 Jan 2017 05:11:38 +0100 +Subject: [PATCH 1/2] Don't execute binary files if execve() returned ENOEXEC. + +Both "dash -c foo" and "./foo" are supposed to be able to run hashbang-less +scripts, but attempts to execute common binary files tend to be nasty: +especially both ELF and PE tend to make dash create a bunch of files with +unprintable names, that in turn confuse some tools up to causing data loss. + +Thus, let's read the first line and see if it looks like text. This is a +variant of the approach used by bash and zsh; mksh instead checks for +signatures of a bunch of common file types. + +POSIX says: "If the executable file is not a text file, the shell may bypass +this command execution.". + +Signed-off-by: Adam Borowski <[email protected]> +--- + src/exec.c | 34 ++++++++++++++++++++++++++++++++++ + 1 file changed, 34 insertions(+) + +diff --git a/src/exec.c b/src/exec.c +index ec0eadd..72acd5e 100644 +--- a/src/exec.c ++++ b/src/exec.c +@@ -148,6 +148,38 @@ shellexec(char **argv, const char *path, int idx) + } + + ++/* ++ * Check if an executable that just failed with ENOEXEC shouldn't be ++ * considered a script (wrong-arch ELF/PE, junk accidentally set +x, etc). ++ * We check only the first line to allow binaries encapsulated in a shell ++ * script without proper quoting. The first line, if not a hashbang, is ++ * likely to contain comments; even ancient encodings, at least popular ++ * ones, don't use 0x7f nor values below 0x1f other than whitespace (\t, ++ * \n, \v, \f, \r), ISO/IEC 2022 can have SI, SO and \e). ++ */ ++STATIC int file_is_binary(const char *cmd) ++{ ++ char buf[128]; ++ int fd = open(cmd, O_RDONLY|O_NOCTTY); ++ if (fd == -1) ++ return 1; ++ int len = read(fd, buf, sizeof(buf)); ++ for (int i = 0; i < len; ++i) { ++ char c = buf[i]; ++ if (c >= 0 && c <= 8 || ++ c >= 16 && c <= 31 && c != 27 || ++ c == 0x7f) { ++ close(fd); ++ return 1; ++ } ++ if (c == '\n') ++ return 0; ++ } ++ close(fd); ++ return 0; ++} ++ ++ + STATIC void + tryexec(char *cmd, char **argv, char **envp) + { +@@ -162,6 +194,8 @@ repeat: + execve(cmd, argv, envp); + #endif + if (cmd != path_bshell && errno == ENOEXEC) { ++ if (file_is_binary(cmd)) ++ return; + *argv-- = cmd; + *argv = cmd = path_bshell; + goto repeat; +-- +2.11.0 + diff -Nru dash-0.5.8/debian/patches/0008-Support-e-in-echo-and-printf-builtins.diff dash-0.5.8/debian/patches/0008-Support-e-in-echo-and-printf-builtins.diff --- dash-0.5.8/debian/patches/0008-Support-e-in-echo-and-printf-builtins.diff 1969-12-31 16:00:00.000000000 -0800 +++ dash-0.5.8/debian/patches/0008-Support-e-in-echo-and-printf-builtins.diff 2017-06-08 21:41:11.000000000 -0700 @@ -0,0 +1,41 @@ +From 95e564ee5fddf0d36e510572daca927f9e139411 Mon Sep 17 00:00:00 2001 +From: Adam Borowski <[email protected]> +Date: Sat, 28 Jun 2014 06:29:56 +0200 +Subject: [PATCH 2/2] Support \e in "echo" and "printf" builtins. + +Signed-off-by: Adam Borowski <[email protected]> +--- + src/bltin/printf.c | 1 + + src/dash.1 | 4 ++++ + 2 files changed, 5 insertions(+) + +--- a/src/bltin/printf.c ++++ b/src/bltin/printf.c +@@ -300,6 +300,7 @@ + case '\\': value = '\\'; break; /* backslash */ + case 'a': value = '\a'; break; /* alert */ + case 'b': value = '\b'; break; /* backspace */ ++ case 'e': value = '\e'; break; /* escape */ + case 'f': value = '\f'; break; /* form-feed */ + case 'n': value = '\n'; break; /* newline */ + case 'r': value = '\r'; break; /* carriage-return */ +--- a/src/dash.1 ++++ b/src/dash.1 +@@ -1199,6 +1199,8 @@ + last argument to suppress the trailing newline that + .Ic echo + would otherwise output. ++.It Li \ee ++Outputs an escape character (ESC). + .It Li \ef + Output a form feed. + .It Li \en +@@ -1573,6 +1575,8 @@ + Write a \*[Lt]bell\*[Gt] character. + .It Cm \eb + Write a \*[Lt]backspace\*[Gt] character. ++.It Cm \ee ++Write an \*[Lt]escape\*[Gt] (ESC) character. + .It Cm \ef + Write a \*[Lt]form-feed\*[Gt] character. + .It Cm \en diff -Nru dash-0.5.8/debian/patches/series dash-0.5.8/debian/patches/series --- dash-0.5.8/debian/patches/series 1969-12-31 16:00:00.000000000 -0800 +++ dash-0.5.8/debian/patches/series 2017-06-08 21:41:11.000000000 -0700 @@ -0,0 +1,8 @@ +0001-SHELL-print-n-upon-EOF-CTRL-D-when-run-interactively.diff +0002-PARSER-Remove-backslash-before-in-double-quotes-in-va.diff +0003-BUILTIN-Fix-test-x-as-root-on-platforms-with-old-fash.diff +0004-SHELL-Disable-sh-c-command-sh-c-exec-command-optimiza.diff +0005-JOBS-address-format-security-build-error.diff +0006-EVAL-Report-I-O-error-on-stdout.diff +0007-Don-t-execute-binary-files-if-execve-returned-ENOEXE.diff +0008-Support-e-in-echo-and-printf-builtins.diff diff -Nru dash-0.5.8/debian/rules dash-0.5.8/debian/rules --- dash-0.5.8/debian/rules 2017-06-08 21:42:21.000000000 -0700 +++ dash-0.5.8/debian/rules 2017-06-08 21:41:11.000000000 -0700 @@ -1,24 +1,6 @@ #!/usr/bin/make -f -CC =gcc -STRIP =strip - DEB_BUILD_MAINT_OPTIONS =hardening=+all -CFLAGS =$(shell DEB_BUILD_MAINT_OPTIONS=$(DEB_BUILD_MAINT_OPTIONS) \ - dpkg-buildflags --get CFLAGS) -LDFLAGS =$(shell DEB_BUILD_MAINT_OPTIONS=$(DEB_BUILD_MAINT_OPTIONS) \ - dpkg-buildflags --get LDFLAGS) -CPPFLAGS =$(shell DEB_BUILD_MAINT_OPTIONS=$(DEB_BUILD_MAINT_OPTIONS) \ - dpkg-buildflags --get CPPFLAGS) - -BUILD_DATE := $(shell dpkg-parsechangelog | sed -n -e 's/^Date: //p') - -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 - STRIP =$(DEB_HOST_GNU_TYPE)-strip -endif ifneq (,$(findstring diet,$(DEB_BUILD_OPTIONS))) CC =diet -v -Os gcc @@ -26,93 +8,18 @@ CPPFLAGS = LDFLAGS = 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)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' \ - exec ../configure --enable-fnmatch --disable-lineno \ - --host='$(DEB_HOST_GNU_TYPE)') - touch configure-stamp - -build: build-arch build-indep -build-arch: deb-checkdir build-stamp -build-indep: -build-stamp: configure-stamp - -$(CC) -v - (cd build-tmp && exec $(MAKE) CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)') || \ - (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 -9n '$(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)' - find '$(DIRA)' -depth -newermt '$(BUILD_DATE)' -print0 | \ - xargs -0r touch --no-dereference --date='$(BUILD_DATE)' - 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)' - find '$(DIR)' -depth -newermt '$(BUILD_DATE)' -print0 | \ - xargs -0r touch --no-dereference --date='$(BUILD_DATE)' - dpkg -b '$(DIR)' .. -.PHONY: configure build build-arch build-indep po-templates clean patch install install-indep \ - install-arch binary binary-indep binary-arch +%: + dh $@ -include debian/implicit +override_dh_auto_build: + cp ChangeLog changelog + dh_auto_build + +override_dh_auto_configure: + po2debconf debian/dash.templates.in > debian/dash.templates + dh_auto_configure -- --enable-fnmatch --disable-lineno + +override_dh_auto_clean: + rm -f debian/dash.templates changelog + dh_auto_clean diff -Nru dash-0.5.8/debian/source/format dash-0.5.8/debian/source/format --- dash-0.5.8/debian/source/format 1969-12-31 16:00:00.000000000 -0800 +++ dash-0.5.8/debian/source/format 2017-06-08 21:41:11.000000000 -0700 @@ -0,0 +1 @@ +3.0 (quilt)

