added a little more logging output when removing a package and also fixed a few little things
svn: r13238
This commit is contained in:
parent
99eafbc1b5
commit
b0f64136bd
|
@ -497,6 +497,8 @@ Various common pieces of code that both the client and server need to access
|
|||
(apply fprintf (current-output-port) str fmt)
|
||||
(newline (current-output-port)))))))
|
||||
|
||||
;; note that this function assumes that 'f' prints line-by-line
|
||||
;; output, so that it can be easily logged.
|
||||
(define (with-logging logfile f)
|
||||
(let-values ([(in out) (make-pipe)])
|
||||
(thread
|
||||
|
@ -515,9 +517,10 @@ Various common pieces of code that both the client and server need to access
|
|||
(when outport (display l outport))
|
||||
(planet-log l)
|
||||
(loop)]))))))
|
||||
(parameterize ([current-output-port out])
|
||||
(f))))
|
||||
|
||||
(begin0
|
||||
(parameterize ([current-output-port out])
|
||||
(f))
|
||||
(close-output-port out))))
|
||||
|
||||
;; pkg->info : PKG -> (symbol (-> TST) -> TST)
|
||||
;; get an info.ss thunk for the given package
|
||||
|
|
|
@ -118,8 +118,11 @@
|
|||
(lambda ()
|
||||
(printf "\n============= Removing ~a =============\n" (list owner name maj min))
|
||||
(clean-planet-package path (list owner name '() maj min))))
|
||||
(planet-log "Erasing metadata")
|
||||
(erase-metadata p)
|
||||
(planet-log "Deleting files in ~a" (path->string path))
|
||||
(delete-directory/files path)
|
||||
(planet-log "Trimming empty directories")
|
||||
(trim-directory (CACHE-DIR) path)
|
||||
(void))))
|
||||
|
||||
|
@ -219,8 +222,8 @@
|
|||
(define (directory-empty? dir)
|
||||
(null? (directory-list dir)))
|
||||
|
||||
;; trim-directory path path -> void
|
||||
;; deletes nonempty directories starting with stem and working down to root
|
||||
;; trim-directory: path path -> void
|
||||
;; deletes empty directories starting with stem and working down to root
|
||||
(define (trim-directory root stem)
|
||||
(let* ([rootl (explode-path root)]
|
||||
[steml (explode-path stem)]
|
||||
|
|
Loading…
Reference in New Issue
Block a user