Changeset 15530 in project


Ignore:
Timestamp:
08/22/09 05:37:12 (10 years ago)
Author:
Kon Lovett
Message:

The create dir is now "sudo" sensitive.

File:
1 edited

Legend:

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

    r15119 r15530  
    3131; evolved. The code was extracted and put into this module, without much
    3232; cleaning up. Nevertheless, it should work.
     33;
     34; *windows-shell* and, to a lesser extent, 'sudo' processing knowledge is
     35; scattered in the code.
    3336
    3437(module setup-api
     
    132135(define *chmod-command*)
    133136(define *ranlib-command*)
     137(define *mkdir-command*)
    134138
    135139(define (windows-user-install-setup)
     
    145149  (set! *move-command*        'mv)
    146150  (set! *chmod-command*       "chmod")
    147   (set! *ranlib-command*      "ranlib") )
     151  (set! *ranlib-command*      "ranlib")
     152  (set! *mkdir-command*       "mkdir") )
    148153
    149154(define (windows-sudo-install-setup)
     
    156161  (set! *move-command*        "sudo mv")
    157162  (set! *chmod-command*       "sudo chmod")
    158   (set! *ranlib-command*      "sudo ranlib") )
     163  (set! *ranlib-command*      "sudo ranlib")
     164  (set! *mkdir-command*       "sudo mkdir") )
    159165
    160166(define (user-install-setup)
     
    174180        ((car args)     (sudo-install-setup))
    175181        (else           (user-install-setup)) ) )
    176 
    177 ; User setup by default
    178 (user-install-setup)
    179 
    180 
    181 (define create-directory/parents
    182   (let ()
    183     (define create-directory-0
    184       (let ([create-directory create-directory])
    185         (lambda (dir)
    186           (let loop ([dir dir])
    187             (when (and dir (not (directory? dir)))
    188               (loop (pathname-directory dir))
    189               (create-directory dir))) ) ) )
    190     (define (verb dir)
    191       (when (setup-verbose-mode) (printf "  creating directory `~a'~%~!" dir)) )
    192     (if *windows-shell*
    193         (lambda (dir)
    194           (verb dir)
    195           (create-directory-0 dir) )
    196         (lambda (dir)
    197           (verb dir)
    198           ($system (sprintf "mkdir -p ~a" (shellpath dir) ) ) ) ) ) )
    199182
    200183(define abort-setup (make-parameter exit))
     
    438421  (make-parameter (or (get-environment-variable "CHICKEN_INSTALL_PREFIX") #f)))
    439422
     423(define create-directory/parents
     424  (let ()
     425    (define create-directory-0
     426      (let ([create-directory create-directory])
     427        (lambda (dir)
     428          (let loop ([dir dir])
     429            (when (and dir (not (directory? dir)))
     430              (loop (pathname-directory dir))
     431              (create-directory dir))) ) ) )
     432    (define (verb dir)
     433      (when (setup-verbose-mode) (printf "  creating directory `~a'~%~!" dir)) )
     434    (if *windows-shell*
     435        (lambda (dir)
     436          (verb dir)
     437          (create-directory-0 dir) )
     438        (lambda (dir)
     439          (verb dir)
     440          (run (,*mkdir-command* -p ,(shellpath dir))) ) ) ) )
     441
    440442(define (write-info id files info)
    441443  (let ((info `((files ,@files)
     
    774776      (error "shell command failed with nonzero exit status" r str))))
    775777
     778;;; Module Setup
     779
     780; User setup by default
     781(user-install-setup)
    776782)
Note: See TracChangeset for help on using the changeset viewer.