mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-06 20:56:38 +02:00
Handle missing user/group password info in tar-create.
This commit is contained in:
parent
dc89521801
commit
89661f8b75
1 changed files with 7 additions and 2 deletions
|
@ -148,6 +148,11 @@
|
||||||
(lambda (tar bv) (if (equal? (tar-path tar) file) (return bv))))
|
(lambda (tar bv) (if (equal? (tar-path tar) file) (return bv))))
|
||||||
#f)))
|
#f)))
|
||||||
|
|
||||||
|
(define (file-owner-or-nobody st)
|
||||||
|
(or (user-name (user-information (file-owner st))) "nobody"))
|
||||||
|
(define (file-group-or-nobody st)
|
||||||
|
(or (group-name (group-information (file-group st))) "nobody"))
|
||||||
|
|
||||||
(define (file->tar file)
|
(define (file->tar file)
|
||||||
(let ((tar (make-tar))
|
(let ((tar (make-tar))
|
||||||
(st (file-link-status file)))
|
(st (file-link-status file)))
|
||||||
|
@ -159,8 +164,8 @@
|
||||||
(tar-mode-set! tar (file-mode st))
|
(tar-mode-set! tar (file-mode st))
|
||||||
(tar-uid-set! tar (file-owner st))
|
(tar-uid-set! tar (file-owner st))
|
||||||
(tar-gid-set! tar (file-group st))
|
(tar-gid-set! tar (file-group st))
|
||||||
(tar-owner-set! tar (user-name (user-information (file-owner st))))
|
(tar-owner-set! tar (file-owner-or-nobody st))
|
||||||
(tar-group-set! tar (group-name (group-information (file-group st))))
|
(tar-group-set! tar (file-group-or-nobody st))
|
||||||
(tar-time-set! tar (+ 1262271600 (file-modification-time st)))
|
(tar-time-set! tar (+ 1262271600 (file-modification-time st)))
|
||||||
(tar-type-set! tar (cond ((file-link? st) "2")
|
(tar-type-set! tar (cond ((file-link? st) "2")
|
||||||
((file-character? st) "3")
|
((file-character? st) "3")
|
||||||
|
|
Loading…
Add table
Reference in a new issue