summaryrefslogtreecommitdiff
blob: fdd3b601533bbede558d59c1f2d2b16f84363f4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
From f41bf9380f7b08f5e8c07c9c58d66cd5da7bc356 Mon Sep 17 00:00:00 2001
From: Thien-Thi Nguyen <ttn@gnuvola.org>
Date: Thu, 28 Apr 2011 05:13:52 +0000
Subject: [v] Make alive.test avoid (mis-)loading the .scm files, if possible.

Reported by Bernardo Ezequiel Contreras:
<https://savannah.nongnu.org/bugs/?33175>

* source/alive.test: If guile has ‘%load-extensions’, create a
preload file that removes ".scm" from it; use that file for
all invocations; and delete it when done.  If in debug mode,
display ponderings, as well as ‘guile --version’ output.
---
diff --git a/source/ChangeLog b/source/ChangeLog
index 2b5bd1b..2de79f4 100644
--- a/source/ChangeLog
+++ b/source/ChangeLog
@@ -1,3 +1,15 @@
+2011-04-28  Thien-Thi Nguyen  <ttn@gnuvola.org>
+
+	[v] Make alive.test avoid (mis-)loading the .scm files, if possible.
+
+	Reported by Bernardo Ezequiel Contreras:
+	<https://savannah.nongnu.org/bugs/?33175>
+
+	* alive.test: If guile has ‘%load-extensions’, create a
+	preload file that removes ".scm" from it; use that file for
+	all invocations; and delete it when done.  If in debug mode,
+	display ponderings, as well as ‘guile --version’ output.
+
 2011-01-24  Thien-Thi Nguyen  <ttn@gnuvola.org>
 
 	Release: 2.29
diff --git a/source/alive.test b/source/alive.test
index 3521fcc..76e91c8 100755
--- a/source/alive.test
+++ b/source/alive.test
@@ -35,6 +35,25 @@ decho ()
     if $debug ; then echo "$1" ; fi
 }
 
+decho 'guile:'
+if $debug ; then ${GUILE-guile} --version ; fi
+
+if $guile -c '%load-extensions' >/dev/null 2>&1 ; then
+    preload=alive.preload
+    echo '(set! %load-extensions (delete ".scm" %load-extensions))' > $preload
+    if $debug ; then
+        decho 'preload:'
+        cat $preload
+        decho 'before:'
+        $guile -c '(begin (write %load-extensions) (newline))'
+    fi
+    guile="$guile -l $preload"
+    if $debug ; then
+        decho 'after:'
+        $guile -c '(begin (write %load-extensions) (newline))'
+    fi
+fi
+
 decho 'indivdually:'
 { while read m ;
     do
@@ -48,4 +67,8 @@ all="`cat $all`"
 decho "$guile -c '(use-modules $all)'"
 $guile -c "(use-modules $all)"
 
+if [ "$preload" ] ; then rm $preload ; fi
+
+exit 0
+
 # alive.test ends here
--
cgit v0.9.0.2