[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.11-30-g2da97
From: |
Ludovic Courtès |
Subject: |
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.11-30-g2da97f1 |
Date: |
Tue, 03 Jun 2014 13:02:53 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=2da97f1c7c0748509180308d9e6a817bc49172e7
The branch, stable-2.0 has been updated
via 2da97f1c7c0748509180308d9e6a817bc49172e7 (commit)
from a5186f506f69ef8a8accd234ca434efd13f302c9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 2da97f1c7c0748509180308d9e6a817bc49172e7
Author: Ludovic Courtès <address@hidden>
Date: Tue Jun 3 14:58:55 2014 +0200
'guild compile' doesn't leave temporary files behind it.
* module/scripts/compile.scm (compile): Add 'sigaction' call.
* test-suite/standalone/test-guild-compile: New file.
* test-suite/standalone/Makefile.am (check_SCRIPTS, TESTS): Add it.
-----------------------------------------------------------------------
Summary of changes:
module/scripts/compile.scm | 10 ++++++-
test-suite/standalone/Makefile.am | 3 ++
test-suite/standalone/test-guild-compile | 42 ++++++++++++++++++++++++++++++
3 files changed, 54 insertions(+), 1 deletions(-)
create mode 100755 test-suite/standalone/test-guild-compile
diff --git a/module/scripts/compile.scm b/module/scripts/compile.scm
index 20db944..0a2ca4d 100644
--- a/module/scripts/compile.scm
+++ b/module/scripts/compile.scm
@@ -1,6 +1,6 @@
;;; Compile --- Command-line Guile Scheme compiler -*- coding: iso-8859-1 -*-
-;; Copyright 2005,2008,2009,2010,2011 Free Software Foundation, Inc.
+;; Copyright 2005, 2008, 2009, 2010, 2011, 2014 Free Software Foundation, Inc.
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
@@ -176,6 +176,14 @@ Report bugs to <~A>.~%"
(fail "`-o' option can only be specified "
"when compiling a single file"))
+ ;; Install a SIGINT handler. As a side effect, this gives unwind
+ ;; handlers an opportunity to run upon SIGINT; this includes that of
+ ;; 'call-with-output-file/atomic', called by 'compile-file', which
+ ;; removes the temporary output file.
+ (sigaction SIGINT
+ (lambda args
+ (fail "interrupted by the user")))
+
(for-each (lambda (file)
(format #t "wrote `~A'\n"
(with-fluids ((*current-warning-prefix* ""))
diff --git a/test-suite/standalone/Makefile.am
b/test-suite/standalone/Makefile.am
index 9360f69..6f676eb 100644
--- a/test-suite/standalone/Makefile.am
+++ b/test-suite/standalone/Makefile.am
@@ -93,6 +93,9 @@ check_SCRIPTS += test-language
TESTS += test-language
EXTRA_DIST += test-language.el test-language.js
+check_SCRIPTS += test-guild-compile
+TESTS += test-guild-compile
+
# test-num2integral
test_num2integral_SOURCES = test-num2integral.c
test_num2integral_CFLAGS = ${test_cflags}
diff --git a/test-suite/standalone/test-guild-compile
b/test-suite/standalone/test-guild-compile
new file mode 100755
index 0000000..05d45ce
--- /dev/null
+++ b/test-suite/standalone/test-guild-compile
@@ -0,0 +1,42 @@
+#!/bin/sh
+#
+# This -*- sh -*- script tests whether 'guild compile' leaves traces
+# behind it upon SIGINT.
+
+source="t-guild-compile-$$"
+target="$source.go"
+
+trap 'rm -f "$source" "$target"' EXIT
+
+cat > "$source"<<EOF
+(eval-when (expand load eval)
+ (sleep 100))
+(define chbouib 42)
+EOF
+
+guild compile -o "$target" "$source" &
+pid="$!"
+
+# Send SIGINT.
+sleep 1 && kill -INT "$pid"
+
+# Wait for 'guild compile' to terminate.
+sleep 2
+
+# Check whether there are any leftovers.
+for file in "$target"*
+do
+ if test "$file" != "${target}*"
+ then
+ echo "error: 'guild compile' failed to remove '$file'" >&2
+ rm "$target"*
+ kill "$pid"
+ exit 1
+ fi
+done
+
+if test -f "$target"
+then
+ echo "error: '$target' produced" >&2
+ exit 1
+fi
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.11-30-g2da97f1,
Ludovic Courtès <=