Use `find-executable-path' to find a tar executable, wait for it to finish.

This commit is contained in:
Eli Barzilay 2010-11-08 10:10:54 -05:00
parent da31296bf9
commit 3de1b31eaf

View File

@ -57,7 +57,7 @@
["libgthread-2.0.0.dylib" 21728] ["libgthread-2.0.0.dylib" 21728]
["libpng14.14.dylib" 192224] ["libpng14.14.dylib" 192224]
["PSMTabBarControl.tgz" 105765])] ["PSMTabBarControl.tgz" 105765])]
[(ppc-macosx) [(ppc-macosx)
'(["libcairo.2.dylib" 2716096] '(["libcairo.2.dylib" 2716096]
["libintl.8.dylib" 133156] ["libintl.8.dylib" 133156]
["libgio-2.0.0.dylib" 936176] ["libgio-2.0.0.dylib" 936176]
@ -79,7 +79,7 @@
["libpng14-14.dll" 219305] ["libpng14-14.dll" 219305]
["zlib1.dll" 55808] ["zlib1.dll" 55808]
["freetype6.dll" 535264] ["freetype6.dll" 535264]
["libfontconfig-1.dll" 279059] ["libfontconfig-1.dll" 279059]
["libglib-2.0-0.dll" 1110713] ["libglib-2.0-0.dll" 1110713]
["libgobject-2.0-0.dll" 316586] ["libgobject-2.0-0.dll" 316586]
["libgmodule-2.0-0.dll" 31692] ["libgmodule-2.0-0.dll" 31692]
@ -135,10 +135,7 @@
(= (file-size dest) size)) (= (file-size dest) size))
(printf " ~a is ready\n" file) (printf " ~a is ready\n" file)
(let* ([sub (unixize (system-library-subpath #f))] (let* ([sub (unixize (system-library-subpath #f))]
[src (format "~a~a/~a" [src (format "~a~a/~a" url-path sub file)])
url-path
sub
file)])
(unless explained? (unless explained?
(set! explained? #t) (set! explained? #t)
(printf ">> Downloading files from\n>> ~a~a\n" url-base sub) (printf ">> Downloading files from\n>> ~a~a\n" url-base sub)
@ -161,7 +158,7 @@
(rename-file-or-directory tmp dest #t) (rename-file-or-directory tmp dest #t)
(let ([sz (file-size dest)]) (let ([sz (file-size dest)])
(unless (= size sz) (unless (= size sz)
(raise-user-error (raise-user-error
'get-libs 'get-libs
"size of ~a is ~a; doesn't match expected size ~a" "size of ~a is ~a; doesn't match expected size ~a"
dest sz size))) dest sz size)))
@ -185,15 +182,14 @@
(copy-file src dest)))) (copy-file src dest))))
(define (unpack-tgz src dest) (define (unpack-tgz src dest)
(let ([src (path->complete-path src)]) (define src (path->string (path->complete-path src)))
(parameterize ([current-directory (let-values ([(base name dir?) (split-path dest)]) (parameterize ([current-directory
base)]) (let-values ([(base name dir?) (split-path dest)]) base)])
(subprocess (current-output-port) (define-values [p pout pin perr]
(current-input-port) (subprocess
(current-error-port) (current-output-port) (current-input-port) (current-error-port)
"/usr/bin/tar" (find-executable-path "tar") "zxf" src))
"zxf" (subprocess-wait p)))
(path->string src)))))
(case (mode) (case (mode)
[(download) [(download)