Changeset 20270 in project


Ignore:
Timestamp:
09/12/10 22:01:12 (8 years ago)
Author:
alaric
Message:

ugarit: Fixed all the silly errors, and got mtime caching working!

Location:
release/4/ugarit/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/ugarit/trunk/ugarit-core.scm

    r20269 r20270  
    22        (open-archive
    33         archive?
     4         archive-global-directory-rules
    45         archive-writable?
    56         archive-unlinkable?
     
    579580          (if cache-result
    580581              (if (= cached-mtime mtime)
    581                   (values cached-hash #t) ; Found in cache! Woot!
     582                  (begin
     583                    #;(printf "Found ~a/~a in cache: ~a\n" file-path mtime cached-hash)
     584                    (values cached-hash #t)) ; Found in cache! Woot!
    582585                  (store-file-and-cache! mtime)) ; in cache, but mtime differs
    583586              (store-file-and-cache! mtime))) ; not in cache
     
    768771;; Returns the usual key and reused? values
    769772(define (store-directory! archive path)
    770   (printf "TEST 1\n")
    771773  (call-with-context
    772774   (read-local-rules archive path)
    773775   path
    774776   (lambda ()
    775      (printf "TEST 2\n")
    776777     (check-archive-writable archive)
    777778
     
    837838                                        ; WTF?
    838839                           (printf "ERROR: I can't ascertain the type of ~A. Skipping it...\n" file-path))))))
    839                  (directory path #t))
     840                 (sort! (directory path #t) string<?))
    840841
    841842       ((sexpr-stream-writer-finish! ssw))))))
  • release/4/ugarit/trunk/ugarit.scm

    r15242 r20270  
    11(use ugarit-core)
     2(use directory-rules)
    23
    34(use srfi-37)
     
    133134 
    134135         (match result
    135             (("")
     136            (()
    136137               (explore-archive archive directory-key path quit-continuation))
    137138            (("help")
     
    251252(match command-line
    252253   (("snapshot" confpath tag fspath)
    253       (let ((archive (open-archive
    254          (with-input-from-file confpath read-file) *store-atime?* *store-ctime?*)))
     254      (let* ((configuration (with-input-from-file confpath read-file))
     255             (archive (open-archive configuration *store-atime?* *store-ctime?*)))
    255256         
    256257         (printf "Archiving ~A to tag ~A...\n" fspath tag)
    257258         (define-values (dir-key dir-reused?)
    258             (store-directory! archive fspath))
     259            (call-with-context-support
     260             (archive-global-directory-rules archive)
     261             (lambda () (store-directory! archive fspath))))
    259262         (printf "Root hash: ~A\n" dir-key)
    260263         (let ((snapshot-key (tag-snapshot! archive tag dir-key dir-reused? (list
     
    287290         (let ((type (archive-exists? archive key))
    288291               (block (archive-get archive key)))
    289                (printf "BLock with key ~A (type ~A) is ~A bytes:\n" key type (u8vector-length block))
     292               (printf "Block with key ~A (type ~A) is ~A bytes:\n" key type (u8vector-length block))
    290293               (write-u8vector block))
    291294           
Note: See TracChangeset for help on using the changeset viewer.