Skip to content

Commit

Permalink
raco pkg catalog-archive: avoid writing non-changed information
Browse files Browse the repository at this point in the history
  • Loading branch information
mflatt committed Apr 12, 2020
1 parent 803f235 commit 3d9d12a
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions racket/collects/pkg/private/catalog-archive.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -121,29 +121,31 @@
(when clean? (delete-directory/files staged-dir))
(values staged-checksum)]))
;; Record packed result:
(define new-checksum (file->string pkg-checksum-file))
(parameterize ([db:current-pkg-catalog-file temp-catalog-file])
(db:call-with-pkgs-transaction
(lambda ()
(define modules (db:get-pkg-modules name (db:pkg-catalog pkg) (db:pkg-checksum pkg)))
(define dependencies (db:get-pkg-dependencies name (db:pkg-catalog pkg) (db:pkg-checksum pkg)))
(db:set-pkg! name (db:pkg-catalog pkg)
(db:pkg-author pkg)
(path->string (path->complete-path pkg-file))
new-checksum
(db:pkg-desc pkg))
(db:set-pkg-modules! name (db:pkg-catalog pkg)
new-checksum
modules)
(db:set-pkg-dependencies! name (db:pkg-catalog pkg)
new-checksum
dependencies))))
;; Record packed result in state catalog:
(when state-catalog
(parameterize ([db:current-pkg-catalog-file state-catalog])
(db:set-pkg! name "local"
(db:pkg-author pkg)
(db:pkg-source pkg)
staged-checksum
(db:pkg-desc pkg)))))
;; Record packed result:
(define new-checksum (file->string pkg-checksum-file))
(parameterize ([db:current-pkg-catalog-file temp-catalog-file])
(define modules (db:get-pkg-modules name (db:pkg-catalog pkg) (db:pkg-checksum pkg)))
(define dependencies (db:get-pkg-dependencies name (db:pkg-catalog pkg) (db:pkg-checksum pkg)))
(db:set-pkg! name (db:pkg-catalog pkg)
(db:pkg-author pkg)
(path->string (path->complete-path pkg-file))
new-checksum
(db:pkg-desc pkg))
(db:set-pkg-modules! name (db:pkg-catalog pkg)
new-checksum
modules)
(db:set-pkg-dependencies! name (db:pkg-catalog pkg)
new-checksum
dependencies))))
(db:pkg-desc pkg)))))))
(define dest-catalog (build-path dest-dir "catalog"))
(unless quiet?
(printf/flush "Creating catalog ~a\n" dest-catalog))
Expand Down

0 comments on commit 3d9d12a

Please sign in to comment.