summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org>2017-01-30 06:25:42 (GMT)
committer Sergey Poznyakoff <gray@gnu.org>2017-01-30 06:25:42 (GMT)
commit9a286d24b51ab106db6fe389767d79d3f5dea159 (patch) (side-by-side diff)
treeedcf4a61cc076a57bc35a84703abe3d0344db95e
parent7e8606f27404fe8da3051f90eadef4076f2f7a08 (diff)
downloadidest-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.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--scheme/dry-run.scm1
-rw-r--r--scheme/idest/list-modules.scm42
-rw-r--r--tests/script05.at3
-rw-r--r--tests/script08.at5
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]~%"
(else
(let ((file-name (list-ref cmd 1)))
(set-program-arguments (cons (car cmd) (list-tail cmd 2)))
+ ; Note: a bug in Guile 2.0.9 causes %load-hook to be called twice
(primitive-load-path file-name)
(cond
(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 @@
(set! %load-hook #f)
(for-each
(lambda (candidate)
- (catch 'misc-error
+ (catch #t
(lambda ()
(let ((mod (resolve-module
(list 'idest type
(string->symbol (car candidate))))))
; Check if it defines idest-main
- (module-ref mod 'idest-main)
- ; Print module name
- (display (car candidate))
- ; Its directory, if required
- (if print-dir
- (format #t " (~A)" (cdr candidate)))
- ; A colon, and description (if any)
- (format #t ": ~A~%"
- (catch #t
- (lambda ()
- (module-ref mod 'description))
- (lambda (key . args)
- "no description")))))
+ (catch #t
+ (lambda ()
+ (module-ref mod 'idest-main)
+ ; Print module name
+ (display (car candidate))
+ ; Its directory, if required
+ (if print-dir
+ (format #t " (~A)" (cdr candidate)))
+ ; A colon, and description (if any)
+ (format #t ": ~A~%"
+ (catch #t
+ (lambda ()
+ (module-ref mod 'description))
+ (lambda (key . args)
+ "no description"))))
+ (lambda (key . args)
+ #f))))
+
(lambda (key . args)
- #f)))
+ (with-output-to-port
+ (current-error-port)
+ (lambda ()
+ (format #t "~A: " progname)
+ (apply format #t (list-ref args 1) (list-ref args 2))
+ (format #t ", while loading ~A/~A.scm" (cdr candidate)
+ (car candidate))
+ (newline))))))
candidates)
(newline)
(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
cp file file.bak
echo removing APIC frames
idest -N -p $abs_top_srcdir/scheme -n -S delpic.scm file |
- sed "s|$abs_top_srcdir|abs_top_srcdir|"])
+ sed -e '/^dry-run: loading/d'])
echo cmp
cmp file.bak file
],
[0],
[removing APIC frames
-dry-run: loading ./delpic.scm ...
File file
(TIT2 (descr . Title/songname/content description) (text . File))
(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
echo dry run
subdir=`pwd`/scheme
idest -N -p $abs_top_srcdir/scheme:$subdir -n --batch delpic file |
- sed "s|$subdir|subdir|;s|$abs_top_srcdir|abs_top_srcdir|"])
+ sed -e '/^dry-run: loading/d'])
echo cmp
cmp file.bak file
],
[0],
[dry run
-dry-run: loading abs_top_srcdir/scheme/batch.scm ...
-dry-run: loading abs_top_srcdir/scheme/idest/load-module.scm ...
-dry-run: loading subdir/idest/batch/delpic.scm ...
File file
(TIT2 (descr . Title/songname/content description) (text . File))
(TALB (descr . Album/movie/show title) (text . Idest Test Suite))

Return to:

Send suggestions and report system problems to the System administrator.