Changeset 12608 in project for chicken


Ignore:
Timestamp:
11/27/08 03:23:32 (11 years ago)
Author:
Kon Lovett
Message:

Bug fix for sudo install mode - inconsitent signature for 'sudo-install' & didn't set the *sudo* flag.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/setup-api.scm

    r12342 r12608  
    159159(define (cross-chicken) (##sys#fudge 39))
    160160
    161 (define *copy-command* (if *windows-shell* 'copy "cp -r"))
    162 (define *remove-command* (if *windows-shell* "del /Q /S" "rm -fr"))
    163 (define *move-command* (if *windows-shell* 'move 'mv))
    164 (define *chmod-command* "chmod")
    165 (define *ranlib-command* "ranlib")
    166161(define *csc-options* '())
    167162(define *base-directory* (current-directory))
     
    173168(define keep-intermediates (make-parameter #f))
    174169
    175 (define (sudo-install)
    176   (set! *copy-command* "sudo cp -r")
    177   (set! *remove-command* "sudo rm -fr")
    178   (set! *move-command* "sudo mv")
    179   (set! *chmod-command* "sudo chmod")
    180   (set! *ranlib-command* "sudo ranlib"))
     170; Setup shell commands
     171
     172(define *copy-command*)
     173(define *remove-command*)
     174(define *move-command*)
     175(define *chmod-command*)
     176(define *ranlib-command*)
     177
     178(define (windows-user-install-setup)
     179  (set! *copy-command*        'copy)
     180  (set! *remove-command*      "del /Q /S")
     181  (set! *move-command*        'move)
     182  (set! *chmod-command*       "chmod")
     183  (set! *ranlib-command*      "ranlib") )
     184
     185(define (unix-user-install-setup)
     186  (set! *copy-command*        "cp -r")
     187  (set! *remove-command*      "rm -fr")
     188  (set! *move-command*        'mv)
     189  (set! *chmod-command*       "chmod")
     190  (set! *ranlib-command*      "ranlib") )
     191
     192(define (windows-sudo-install-setup)
     193  (set! *sudo* #f)
     194  (print "Warning: can not install as superuser with Windows") )
     195
     196(define (unix-sudo-install-setup)
     197  (set! *copy-command*        "sudo cp -r")
     198  (set! *remove-command*      "sudo rm -fr")
     199  (set! *move-command*        "sudo mv")
     200  (set! *chmod-command*       "sudo chmod")
     201  (set! *ranlib-command*      "sudo ranlib") )
     202
     203(define (user-install-setup)
     204  (set! *sudo* #f)
     205  (if *windows-shell*
     206      (windows-user-install-setup)
     207      (unix-user-install-setup) ) )
     208
     209(define (sudo-install-setup)
     210  (set! *sudo* #t)
     211  (if *windows-shell*
     212      (windows-sudo-install-setup)
     213      (unix-sudo-install-setup) ) )
     214
     215(define (sudo-install . args)
     216  (cond ((null? args)   *sudo*)
     217        ((car args)     (sudo-install-setup))
     218        (else           (user-install-setup)) ) )
     219
     220; User setup by default
     221(user-install-setup)
    181222
    182223; Convert a string with a version (such as "1.22.0") to a list of the
Note: See TracChangeset for help on using the changeset viewer.