Loris  Check-in [62e183d81d]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Some fixes for getting a program-internal-name.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:62e183d81d1d5c9d1cf5327c55c8b005e023db0e
User & Date: jesper 2016-04-18 18:27:02
Context
2016-04-18
18:28
Since R7RS is now mandatory, use #\null check-in: 4c3f253883 user: jesper tags: trunk
18:27
Some fixes for getting a program-internal-name. check-in: 62e183d81d user: jesper tags: trunk
18:18
Recognise running from csi with an absolute path. check-in: a57ef3a1be user: jesper tags: trunk
Changes

Changes to platform.scm.

18
19
20
21
22
23
24

25
26
27
28
29
30
31
...
106
107
108
109
110
111
112

113
114
115
116
117

118

119
120
121
122
123
124
125
  (import (scheme base)
          (scheme char)		; XXX: "not unicode-aware" / r7rs egg ref
          (scheme process-context)
          (scheme file)
          (scheme process-context)
          (srfi 1)
          (srfi 13)

          (loris convenience)
          (loris output)
          (prefix (loris version) version:)

          ;; XXX: Chicken-specific
          (only (posix) process process-wait ; used here, not exported
                file-modification-time file-link current-directory) ; reexported only
................................................................................
        (debug* prepend: (conc "Checking availability of program " str)
                available?)))

    (define (delete-file* fn)
      (with-exception-handler* (lambda (x) #f) (delete-file fn)))

    (define (make-platform program-internal-name)

      (let* ((nix/win (lambda (nix win)
                        (if (eq? (software-type) 'windows)
                            win
                            nix)))
             (program-filename (let ((actual (program-name)))

                                 (if (string-suffix? "/csi" actual) program-internal-name actual)))

             (program-env-var-name (string-map (lambda (c) (if (char=? #\- c) #\_ (char-upcase c)))
                                               program-filename))
             (home-dir (nix/win (get-environment-variable "HOME")
                                (get-environment-variable "HOMEPATH")))
             (user-conf-dir (nix/win (get-environment-variable "HOME")
                                     (get-environment-variable "APPDATA")))
             (user-data-dir (platform-dir-slashes (conc user-conf-dir "/" (nix/win







>







 







>
|




>
|
>







18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
...
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
  (import (scheme base)
          (scheme char)		; XXX: "not unicode-aware" / r7rs egg ref
          (scheme process-context)
          (scheme file)
          (scheme process-context)
          (srfi 1)
          (srfi 13)
          (srfi 14)
          (loris convenience)
          (loris output)
          (prefix (loris version) version:)

          ;; XXX: Chicken-specific
          (only (posix) process process-wait ; used here, not exported
                file-modification-time file-link current-directory) ; reexported only
................................................................................
        (debug* prepend: (conc "Checking availability of program " str)
                available?)))

    (define (delete-file* fn)
      (with-exception-handler* (lambda (x) #f) (delete-file fn)))

    (define (make-platform program-internal-name)
      (let* ((program-internal-name (string-trim-both program-internal-name char-set:whitespace))
             (nix/win (lambda (nix win)
                        (if (eq? (software-type) 'windows)
                            win
                            nix)))
             (program-filename (let ((actual (program-name)))
                                 (if (string-suffix? (nix/win "/csi" "csi.exe") actual)
                                     program-internal-name
                                     actual)))
             (program-env-var-name (string-map (lambda (c) (if (char=? #\- c) #\_ (char-upcase c)))
                                               program-filename))
             (home-dir (nix/win (get-environment-variable "HOME")
                                (get-environment-variable "HOMEPATH")))
             (user-conf-dir (nix/win (get-environment-variable "HOME")
                                     (get-environment-variable "APPDATA")))
             (user-data-dir (platform-dir-slashes (conc user-conf-dir "/" (nix/win