[polyml] 06/09: Backport fix for --script with additional arguments

James Clarke jrtc27-guest at moszumanska.debian.org
Tue Feb 2 21:21:00 UTC 2016


This is an automated email from the git hooks/post-receive script.

jrtc27-guest pushed a commit to branch master
in repository polyml.

commit d29fc23c14e2915f3edc0403a6ddca62ecc4eb9b
Author: James Clarke <jrtc27 at jrtc27.com>
Date:   Sun Jan 31 18:28:53 2016 +0000

    Backport fix for --script with additional arguments
---
 debian/changelog                    |  2 ++
 debian/patches/fix-script-args.diff | 35 +++++++++++++++++++++++++++++++++++
 debian/patches/series               |  1 +
 3 files changed, 38 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 8c7701d..df9dba2 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,8 @@ polyml (5.6-2) UNRELEASED; urgency=low
     and disable-compile-time-real-eval.diff. Avoids modifying the test driver,
     instead skipping the test if unsupported directly inside the test itself.
   * New patches (excluding soft-float-rounding.diff replacements):
+    - fix-script-args.diff: Backport upstream's fix so --script can be used
+      with additional command-line arguments.
     - mips-abi.diff: Mark polyexport.o as CPIC on MIPS when code is
       position-independent. Fixes ld warning about linking abicalls files with
       non-abicalls files.
diff --git a/debian/patches/fix-script-args.diff b/debian/patches/fix-script-args.diff
new file mode 100644
index 0000000..9a38376
--- /dev/null
+++ b/debian/patches/fix-script-args.diff
@@ -0,0 +1,35 @@
+Description: Fix --script to read the next argument as the file rather than the last.
+ The --script argument is intended for use in a shell script to skip the
+ #! line.  It was reading the last argument as the name of the script file
+ which meant it only worked if there were no arguments.
+Origin: upstream, https://github.com/polyml/polyml/commit/e4b984c24afa1f738e7ce6f6bdc437cef23d0c40
+Author: David Matthews <dm at prolingua.co.uk>
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/basis/TopLevelPolyML.sml
++++ b/basis/TopLevelPolyML.sml
+@@ -1583,7 +1583,7 @@
+                 print "--error-exit         Exit shell on unhandled exception\n";
+                 print "--with-markup        Include extra mark-up information when printing\n";
+                 print "--ideprotocol[=v2]   Run the IDE communications protocol\n";
+-                print "--script             The input is a script.  Skips the first line if it begins with #!";
++                print "--script FILE        The input is a script.  Skips the first line if it begins with #!.";
+                 print "\nRun time system arguments:\n";
+                 print (rtsHelp())
+                )
+@@ -1594,10 +1594,13 @@
+             else if switchOption "--script"
+             then
+             let
+-                (* The last argument is the file name.  Open it but skip 
++                (* The next argument is the file name.  Open it but skip 
+                    the first line if it's #!.   The rest of this code is
+                    largely copied from PolyML.use.  *)
+-                val fileName = List.last argList (* We know there's at least one *)
++                fun getFileName("--script" :: fileName :: _) = fileName
++                |   getFileName [] = (print "Missing file name after --script\n"; OS.Process.exit OS.Process.failure)
++                |   getFileName(_ :: tail) = getFileName tail
++                val fileName = getFileName argList
+                 open TextIO
+                 val inStream = getInstream(TextIO.openIn fileName)
+                 open StreamIO
diff --git a/debian/patches/series b/debian/patches/series
index 0cb28ba..b46a1ee 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@ soft-fpu.diff
 disable-compile-time-real-eval.diff
 mips-abi.diff
 unix-const-vec-unsigned.diff
+fix-script-args.diff

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/polyml.git



More information about the debian-science-commits mailing list