[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#32153] [PATCH 1/2] ruby-build-system: Error or return #t from all p
From: |
Marius Bakke |
Subject: |
[bug#32153] [PATCH 1/2] ruby-build-system: Error or return #t from all phases. |
Date: |
Sun, 15 Jul 2018 01:11:06 +0200 |
User-agent: |
Notmuch/0.27 (https://notmuchmail.org) Emacs/26.1 (x86_64-pc-linux-gnu) |
Christopher Baines <address@hidden> writes:
> Previously, if the tests didn't pass, the check phase would evaluate to #f,
> but the package would be built sucessfully. This changes all the phases to
> raise exceptions if errors are encountered, and return #t otherwise.
>
> This involves using invoke rather than system*, so that exceptions are raised
> if the program exits with a status other than 0, and also returning #t at the
> end of functions.
>
> * gnu/build/ruby-build-system.scm (unpack): Use invoke rather than system*,
> and return #t at the end.
> (build, check): Use invoke rather than system*.
> (install): Remove the use of "and", and rewrite the error handling to raise an
> exception.
> (wrap): Return #t.
Thanks! The changes LGTM. I will suggest a micro-improvement not
related to this patch since it was there from before:
> + ;; For gems with native extensions, several Makefile-related files
> + ;; are created that contain timestamps or other elements making
> + ;; them not reproducible. They are unnecessary so we remove them.
> + (if (file-exists? (string-append vendor-dir "/ext"))
> + (begin
> + (for-each (lambda (file)
> + (log-file-deletion file)
> + (delete-file file))
> + (append
> + (find-files (string-append vendor-dir "/doc")
> + "page-Makefile.ri")
> + (find-files (string-append vendor-dir "/extensions")
> + "gem_make.out")
> + (find-files (string-append vendor-dir "/ext")
> + "Makefile")))))
> +
> + #t))
I was confused whether the #t was the "else" clause for the "if"
expression until I realized it didn't have one.
Could you turn this into a (when (file-exists? ...) (for-each ...))
while at it? It also makes the (begin ...) redundant.
signature.asc
Description: PGP signature