diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2017-01-30 08:25:42 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2017-01-30 08:25:42 +0200 |
commit | 9a286d24b51ab106db6fe389767d79d3f5dea159 (patch) | |
tree | edcf4a61cc076a57bc35a84703abe3d0344db95e | |
parent | 7e8606f27404fe8da3051f90eadef4076f2f7a08 (diff) | |
download | idest-9a286d24b51ab106db6fe389767d79d3f5dea159.tar.gz idest-9a286d24b51ab106db6fe389767d79d3f5dea159.tar.bz2 |
Minor scheme fixes.
* scheme/dry-run.scm: Mention a bug in Guile 2.0.9 that causes
%load-hook to be called twice.
* scheme/idest/list-modules.scm: Improve error handling.
* tests/script05.at: Remove the "loading" diagnostics from the
output.
* tests/script08.at: Likewise.
-rw-r--r-- | scheme/dry-run.scm | 1 | ||||
-rw-r--r-- | scheme/idest/list-modules.scm | 42 | ||||
-rw-r--r-- | tests/script05.at | 3 | ||||
-rw-r--r-- | tests/script08.at | 5 |
4 files changed, 30 insertions, 21 deletions
diff --git a/scheme/dry-run.scm b/scheme/dry-run.scm index 2cabc7d..5fcc0ad 100644 --- a/scheme/dry-run.scm +++ b/scheme/dry-run.scm | |||
@@ -30,6 +30,7 @@ use: idest --dry-run [SCRIPTING OPTIONS]~%" | |||
30 | (else | 30 | (else |
31 | (let ((file-name (list-ref cmd 1))) | 31 | (let ((file-name (list-ref cmd 1))) |
32 | (set-program-arguments (cons (car cmd) (list-tail cmd 2))) | 32 | (set-program-arguments (cons (car cmd) (list-tail cmd 2))) |
33 | ; Note: a bug in Guile 2.0.9 causes %load-hook to be called twice | ||
33 | (primitive-load-path file-name) | 34 | (primitive-load-path file-name) |
34 | (cond | 35 | (cond |
35 | (idest-readonly | 36 | (idest-readonly |
diff --git a/scheme/idest/list-modules.scm b/scheme/idest/list-modules.scm index 880dbf8..facc54b 100644 --- a/scheme/idest/list-modules.scm +++ b/scheme/idest/list-modules.scm | |||
@@ -99,27 +99,39 @@ | |||
99 | (set! %load-hook #f) | 99 | (set! %load-hook #f) |
100 | (for-each | 100 | (for-each |
101 | (lambda (candidate) | 101 | (lambda (candidate) |
102 | (catch 'misc-error | 102 | (catch #t |
103 | (lambda () | 103 | (lambda () |
104 | (let ((mod (resolve-module | 104 | (let ((mod (resolve-module |
105 | (list 'idest type | 105 | (list 'idest type |
106 | (string->symbol (car candidate)))))) | 106 | (string->symbol (car candidate)))))) |
107 | ; Check if it defines idest-main | 107 | ; Check if it defines idest-main |
108 | (module-ref mod 'idest-main) | 108 | (catch #t |
109 | ; Print module name | 109 | (lambda () |
110 | (display (car candidate)) | 110 | (module-ref mod 'idest-main) |
111 | ; Its directory, if required | 111 | ; Print module name |
112 | (if print-dir | 112 | (display (car candidate)) |
113 | (format #t " (~A)" (cdr candidate))) | 113 | ; Its directory, if required |
114 | ; A colon, and description (if any) | 114 | (if print-dir |
115 | (format #t ": ~A~%" | 115 | (format #t " (~A)" (cdr candidate))) |
116 | (catch #t | 116 | ; A colon, and description (if any) |
117 | (lambda () | 117 | (format #t ": ~A~%" |
118 | (module-ref mod 'description)) | 118 | (catch #t |
119 | (lambda (key . args) | 119 | (lambda () |
120 | "no description"))))) | 120 | (module-ref mod 'description)) |
121 | (lambda (key . args) | ||
122 | "no description")))) | ||
123 | (lambda (key . args) | ||
124 | #f)))) | ||
125 | |||
121 | (lambda (key . args) | 126 | (lambda (key . args) |
122 | #f))) | 127 | (with-output-to-port |
128 | (current-error-port) | ||
129 | (lambda () | ||
130 | (format #t "~A: " progname) | ||
131 | (apply format #t (list-ref args 1) (list-ref args 2)) | ||
132 | (format #t ", while loading ~A/~A.scm" (cdr candidate) | ||
133 | (car candidate)) | ||
134 | (newline)))))) | ||
123 | candidates) | 135 | candidates) |
124 | (newline) | 136 | (newline) |
125 | (set! %load-hook saved-load-hook)))) | 137 | (set! %load-hook saved-load-hook)))) |
diff --git a/tests/script05.at b/tests/script05.at index 89ebfb1..450c1c9 100644 --- a/tests/script05.at +++ b/tests/script05.at | |||
@@ -33,13 +33,12 @@ genfile -f file -p $abs_srcdir/id3v2 10k | |||
33 | cp file file.bak | 33 | cp file file.bak |
34 | echo removing APIC frames | 34 | echo removing APIC frames |
35 | idest -N -p $abs_top_srcdir/scheme -n -S delpic.scm file | | 35 | idest -N -p $abs_top_srcdir/scheme -n -S delpic.scm file | |
36 | sed "s|$abs_top_srcdir|abs_top_srcdir|"]) | 36 | sed -e '/^dry-run: loading/d']) |
37 | echo cmp | 37 | echo cmp |
38 | cmp file.bak file | 38 | cmp file.bak file |
39 | ], | 39 | ], |
40 | [0], | 40 | [0], |
41 | [removing APIC frames | 41 | [removing APIC frames |
42 | dry-run: loading ./delpic.scm ... | ||
43 | File file | 42 | File file |
44 | (TIT2 (descr . Title/songname/content description) (text . File)) | 43 | (TIT2 (descr . Title/songname/content description) (text . File)) |
45 | (TALB (descr . Album/movie/show title) (text . Idest Test Suite)) | 44 | (TALB (descr . Album/movie/show title) (text . Idest Test Suite)) |
diff --git a/tests/script08.at b/tests/script08.at index 8ff78f7..e3e996e 100644 --- a/tests/script08.at +++ b/tests/script08.at | |||
@@ -36,15 +36,12 @@ $INSTALL_PROG delpic.scm scheme/idest/batch | |||
36 | echo dry run | 36 | echo dry run |
37 | subdir=`pwd`/scheme | 37 | subdir=`pwd`/scheme |
38 | idest -N -p $abs_top_srcdir/scheme:$subdir -n --batch delpic file | | 38 | idest -N -p $abs_top_srcdir/scheme:$subdir -n --batch delpic file | |
39 | sed "s|$subdir|subdir|;s|$abs_top_srcdir|abs_top_srcdir|"]) | 39 | sed -e '/^dry-run: loading/d']) |
40 | echo cmp | 40 | echo cmp |
41 | cmp file.bak file | 41 | cmp file.bak file |
42 | ], | 42 | ], |
43 | [0], | 43 | [0], |
44 | [dry run | 44 | [dry run |
45 | dry-run: loading abs_top_srcdir/scheme/batch.scm ... | ||
46 | dry-run: loading abs_top_srcdir/scheme/idest/load-module.scm ... | ||
47 | dry-run: loading subdir/idest/batch/delpic.scm ... | ||
48 | File file | 45 | File file |
49 | (TIT2 (descr . Title/songname/content description) (text . File)) | 46 | (TIT2 (descr . Title/songname/content description) (text . File)) |
50 | (TALB (descr . Album/movie/show title) (text . Idest Test Suite)) | 47 | (TALB (descr . Album/movie/show title) (text . Idest Test Suite)) |