From f20724c6ac872247d87215e6affcfdbdcb6a8e33 Mon Sep 17 00:00:00 2001 From: michel-schinz Date: Sat, 22 May 2004 10:43:08 +0000 Subject: [PATCH] - added a quiet version of install-main, - moved version to a separate file, - minor reformatting to fit code in 80 columns. --- scheme/install-lib/install-lib.scm | 47 ++++++++++-------------------- 1 file changed, 15 insertions(+), 32 deletions(-) diff --git a/scheme/install-lib/install-lib.scm b/scheme/install-lib/install-lib.scm index 16b6577..40931ea 100755 --- a/scheme/install-lib/install-lib.scm +++ b/scheme/install-lib/install-lib.scm @@ -1,5 +1,5 @@ ;;; Installation library for scsh modules. -;;; $Id: install-lib.scm,v 1.17 2004/05/16 14:33:12 michel-schinz Exp $ +;;; $Id: install-lib.scm,v 1.18 2004/05/22 10:43:08 michel-schinz Exp $ ;; TODO ;; - think about --build: does it make sense? @@ -9,33 +9,6 @@ ;; - add support for image creation ;; - add support to maintain a documentation index -;; -;; Version of the installation library -;; -;; The versioning scheme is as follows: a version is composed of three -;; integers called (from left to right) "major", "minor" and -;; "revision". -;; -;; Two versions which share a "major" and "minor" number must be fully -;; compatible in that one should be exchangeable for the other without -;; (important) change in behaviour. -;; -;; Two versions which share a "major" number must be compatible in an -;; ascendent fashion: the features offered by the version with the -;; greatest "minor" number must be a superset of those offered by the -;; other. -;; -;; Two versions which do not even share a "major" number can be -;; mutually incompatible. -;; -;; Clients using the installation library must specify which "major" -;; and "minor" number they need --- if the above scheme is respected, -;; the "revision" should not matter. This need is satisfied if the -;; requested "major" number matches the one of the library, and the -;; requested "minor" is smaller or equal to the one of the library. - -(define install-lib-version '(1 1 0)) - ;; ;; Support code templates ;; @@ -859,7 +832,8 @@ END (format usage-port " ~a~a~a [~a]\n" option/arg - (spaces 2 (- program-usage-descr-col (string-length option/arg))) + (spaces 2 + (- program-usage-descr-col (string-length option/arg))) (pkg-opt-help pkg-opt) ((pkg-opt-show pkg-opt) (pkg-opt-default pkg-opt))))) pkg-opts) @@ -1010,7 +984,9 @@ END (lambda (option name . rest) (display-usage-and-exit usage "Unknown option "name)) (lambda (operand . rest) - (display-usage-and-exit usage "Don't know what to do with " operand)) + (display-usage-and-exit usage + "Don't know what to do with " + operand)) defaults)) ;; Return user-specific defaults. @@ -1054,7 +1030,7 @@ END (force . #f) (exclude . ,(lambda args #f)))) -(define (install-main cmd-line) +(define (install-main-internal cmd-line display-hint?) (let* ((packages (load&check-packages)) (all-pkg-opts (all-package-options packages))) (if (not (null? all-pkg-opts)) @@ -1089,7 +1065,14 @@ END (if (not resolved-layout) (display-error-and-exit "invalid layout "layout)) (install-packages packages options-values) - (display-use-hint prefix resolved-layout packages))))) + (if display-hint? + (display-use-hint prefix resolved-layout packages)))))) + +(define (install-main-quiet cmd-line) + (install-main-internal cmd-line #f)) + +(define (install-main cmd-line) + (install-main-internal cmd-line #t)) (define (install-program-main cmd-line) (let* ((packages (cell-ref (fluid *packages*)))