Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Relocation messages only with --debug.

  • Loading branch information...
commit b09d6076219c63b162921c8e78c1e23a6fae96f2 1 parent db06797
@janneke authored
Showing with 14 additions and 4 deletions.
  1. +3 −1 ikli.scm
  2. +11 −3 ikli/relocate.scm
View
4 ikli.scm
@@ -52,7 +52,9 @@ PATH=$(dirname $0):$PATH exec guile-gnome-2 --debug -L $(dirname $0) -s $0 "$@"
(if (and (not (equal? prefix "."))
(not (equal? (string-take prefix (min (string-length prefix) 4)) "/usr")))
- ((@ (ikli relocate) relocate) prefix))
+ ((@ (ikli relocate) relocate) prefix)
+ (if (member "--debug" (command-line))
+ (format (current-error-port) "skipping relocation: standard prefix=: ~a\n" prefix)))
(define-public (main args)
((@ (ikli ikli) main) args)
View
14 ikli/relocate.scm
@@ -20,6 +20,14 @@
:use-module (ikli misc)
:export (relocate))
+(define-public (stderr string . rest)
+ (apply format (cons (current-error-port) (cons string rest)))
+ (force-output (current-error-port)))
+
+(define (debugf string . rest)
+ (if (member "--debug" (command-line))
+ (apply stderr (cons string rest))))
+
(define (relocate prefix)
(define (safe-getenv key default)
(let ((val (getenv key)))
@@ -38,10 +46,10 @@
(is-file? value))
(and (equal? command "setdir")
(is-dir? value)))
- (format #t "setting: ~a -> ~a\n" var value)
+ (debugf "setting: ~a -> ~a\n" var value)
(setenv var value))
((equal? command "prependdir")
- (format #t "prepending: ~a -> ~a\n" var value)
+ (debugf "prepending: ~a -> ~a\n" var value)
(setenv var (string-append value PATHSEP (safe-getenv var "-")))))))))
(read-lines f)))
@@ -52,4 +60,4 @@
(directory-files dir))))
;;os.environ['PATH'] = prefix + '/bin' + os.pathsep + os.environ['PATH']
(for-each reloc-file files))
- (format #t "skipping relocation: no such directory: ~a\n" dir))))
+ (debugf "skipping relocation: no such directory: ~a\n" dir))))
Please sign in to comment.
Something went wrong with that request. Please try again.