~ruther/guix-local

3441e164976c14ef8bf9a95ab4130ca25ac85e70 — Ludovic Courtès 13 years ago 706d064
ui: Factorize bug-report information in `--help'.

* guix/config.scm.in (%guix-home-page-url): New variable.
* guix/ui.scm (show-bug-report-information): New procedure.
* guix-build.in (show-help): Use it.
* guix-download.in (show-help): Likewise.
* guix-import.in (show-help): Likewise.
* guix-package.in (show-help): Likewise.
7 files changed, 25 insertions(+), 14 deletions(-)

M guix-build.in
M guix-download.in
M guix-import.in
M guix-package.in
M guix/config.scm.in
M guix/ui.scm
M po/POTFILES.in
M guix-build.in => guix-build.in +2 -3
@@ 12,7 12,7 @@ exec ${GUILE-@GUILE@} -L "@guilemoduledir@" -l "$0"    \
         -c "(apply $main (cdr (command-line)))" "$@"
!#
;;; Guix --- Nix package management from Guile.         -*- coding: utf-8 -*-
;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
;;; Copyright (C) 2012, 2013 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of Guix.
;;;


@@ 104,8 104,7 @@ Build the given PACKAGE-OR-DERIVATION and return their output paths.\n"))
  (display (_ "
  -V, --version          display version information and exit"))
  (newline)
  (format #t (_ "
Report bugs to: ~a.~%") "@PACKAGE_BUGREPORT@"))
  (show-bug-report-information))

(define %options
  ;; Specifications of the command-line options.

M guix-download.in => guix-download.in +2 -3
@@ 12,7 12,7 @@ exec ${GUILE-@GUILE@} -L "@guilemoduledir@" -l "$0"    \
         -c "(apply $main (cdr (command-line)))" "$@"
!#
;;; Guix --- Nix package management from Guile.
;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
;;; Copyright (C) 2012, 2013 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of Guix.
;;;


@@ 90,8 90,7 @@ and the hash of its contents.\n"))
  (display (_ "
  -V, --version          display version information and exit"))
  (newline)
  (format #t (_ "
Report bugs to: ~a.~%") "@PACKAGE_BUGREPORT@"))
  (show-bug-report-information))

(define %options
  ;; Specifications of the command-line options.

M guix-import.in => guix-import.in +2 -3
@@ 12,7 12,7 @@ exec ${GUILE-@GUILE@} -L "@guilemoduledir@" -l "$0"    \
         -c "(apply $main (cdr (command-line)))" "$@"
!#
;;; Guix --- Nix package management from Guile.         -*- coding: utf-8 -*-
;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
;;; Copyright (C) 2012, 2013 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of Guix.
;;;


@@ 88,8 88,7 @@ Import and convert the Nix expression ATTRIBUTE of NIXPKGS.\n"))
  (display (_ "
  -V, --version          display version information and exit"))
  (newline)
  (format #t (_ "
Report bugs to: ~a.~%") "@PACKAGE_BUGREPORT@"))
  (show-bug-report-information))

(define %options
  ;; Specification of the command-line options.

M guix-package.in => guix-package.in +2 -3
@@ 12,7 12,7 @@ exec ${GUILE-@GUILE@} -L "@guilemoduledir@" -l "$0"    \
         -c "(apply $main (cdr (command-line)))" "$@"
!#
;;; Guix --- Nix package management from Guile.         -*- coding: utf-8 -*-
;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
;;; Copyright (C) 2012, 2013 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of Guix.
;;;


@@ 217,8 217,7 @@ Install, remove, or upgrade PACKAGES in a single transaction.\n"))
  (display (_ "
  -V, --version          display version information and exit"))
  (newline)
  (format #t (_ "
Report bugs to: ~a.~%") "@PACKAGE_BUGREPORT@"))
  (show-bug-report-information))

(define %options
  ;; Specification of the command-line options.

M guix/config.scm.in => guix/config.scm.in +5 -1
@@ 1,5 1,5 @@
;;; Guix --- Nix package management from Guile.         -*- coding: utf-8 -*-
;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
;;; Copyright (C) 2012, 2013 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of Guix.
;;;


@@ 20,6 20,7 @@
  #:export (%guix-package-name
            %guix-version
            %guix-bug-report-address
            %guix-home-page-url
            %store-directory
            %state-directory
            %system


@@ 42,6 43,9 @@
(define %guix-bug-report-address
  "@PACKAGE_BUGREPORT@")

(define %guix-home-page-url
  "@PACKAGE_URL@")

(define %store-directory
  "@storedir@")


M guix/ui.scm => guix/ui.scm +11 -1
@@ 1,5 1,5 @@
;;; Guix --- Nix package management from Guile.         -*- coding: utf-8 -*-
;;; Copyright (C) 2012 Ludovic Courtès <ludo@gnu.org>
;;; Copyright (C) 2012, 2013 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of Guix.
;;;


@@ 28,6 28,7 @@
            N_
            leave
            show-version-and-exit
            show-bug-report-information
            call-with-error-handling
            with-error-handling
            location->string))


@@ 56,6 57,15 @@
                 command %guix-package-name %guix-version)
  (exit 0))

(define (show-bug-report-information)
  (format #t (_ "
Report bugs to: ~a.") %guix-bug-report-address)
  (format #t (_ "
~a home page: <~a>") %guix-package-name %guix-home-page-url)
  (display (_ "
General help using GNU software: <http://www.gnu.org/gethelp/>"))
  (newline))

(define (call-with-error-handling thunk)
  "Call THUNK within a user-friendly error handler."
  (guard (c ((package-input-error? c)

M po/POTFILES.in => po/POTFILES.in +1 -0
@@ 7,3 7,4 @@ distro/packages/recutils.scm
guix/ui.scm
guix-build.in
guix-download.in
guix-package.in