From 073c34d72f94adf6c4c307239b1de0d14bdb60f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 1 Nov 2012 00:50:01 +0100 Subject: Add (guix ui). * guix/ui.scm: New file. * Makefile.am (MODULES): Add it. * po/POTFILES.in: Add it. * guix-build.in: Use it. (_, N_, leave): Remove. (guix-build): Use `with-error-handling' instead of the `guard' form. * guix-download.in: Use it. (_, N_, leave): Remove. --- guix-build.in | 21 ++------------------- 1 file changed, 2 insertions(+), 19 deletions(-) (limited to 'guix-build.in') diff --git a/guix-build.in b/guix-build.in index 7089a74731..961545b146 100644 --- a/guix-build.in +++ b/guix-build.in @@ -30,6 +30,7 @@ exec ${GUILE-@GUILE@} -L "@guilemoduledir@" -l "$0" \ ;;; along with Guix. If not, see . (define-module (guix-build) + #:use-module (guix ui) #:use-module (guix store) #:use-module (guix derivations) #:use-module (guix packages) @@ -43,9 +44,6 @@ exec ${GUILE-@GUILE@} -L "@guilemoduledir@" -l "$0" \ #:autoload (distro) (find-packages-by-name) #:export (guix-build)) -(define _ (cut gettext <> "guix")) -(define N_ (cut ngettext <> <> <> "guix")) - (define %store (open-connection)) @@ -73,12 +71,6 @@ When SOURCE? is true, return the derivations of the package sources." `((system . ,(%current-system)) (substitutes? . #t))) -(define-syntax-rule (leave fmt args ...) - "Format FMT and ARGS to the error port and exit." - (begin - (format (current-error-port) fmt args ...) - (exit 1))) - (define (show-version) (display "guix-build (@PACKAGE_NAME@) @PACKAGE_VERSION@\n")) @@ -206,16 +198,7 @@ Report bugs to: ~a.~%") "@PACKAGE_BUGREPORT@")) (setvbuf (current-output-port) _IOLBF) (setvbuf (current-error-port) _IOLBF) - (guard (c ((package-input-error? c) - (let* ((package (package-error-package c)) - (input (package-error-invalid-input c)) - (location (package-location package)) - (file (location-file location)) - (line (location-line location)) - (column (location-column location))) - (leave (_ "~a:~a:~a: error: package `~a' has an invalid input: ~s~%") - file line column - (package-full-name package) input)))) + (with-error-handling (let* ((opts (parse-options)) (src? (assoc-ref opts 'source?)) (sys (assoc-ref opts 'system)) -- cgit v1.2.3