raco pkg update: fix --update-deps
and cross-scope deps
When `--update-deps` (which is implied by `--all`) was used on user-scope packages that depend on installation-scope packages, the installation-scope dependencies were treated as missing, which forced an update of the user-scope packages. Check both scopes for dependencies. Closes #1730
This commit is contained in:
parent
cfa1d7c54c
commit
a7d161cfac
|
@ -43,4 +43,4 @@
|
||||||
|
|
||||||
(define-values (cksum2 mods2 deps2)
|
(define-values (cksum2 mods2 deps2)
|
||||||
(get-pkg-content (pkg-desc "pkg-test2" 'name #f #f #f)))
|
(get-pkg-content (pkg-desc "pkg-test2" 'name #f #f #f)))
|
||||||
(check-equal? deps2 '("pkg-test1")))
|
(check-equal? (sort deps2 string<?) '("base" "pkg-test1")))
|
||||||
|
|
|
@ -2,4 +2,5 @@
|
||||||
|
|
||||||
(define collection 'multi)
|
(define collection 'multi)
|
||||||
|
|
||||||
(define deps (list "pkg-test1"))
|
(define deps (list "pkg-test1"
|
||||||
|
"base"))
|
||||||
|
|
|
@ -434,7 +434,8 @@
|
||||||
(set-member? implies name))
|
(set-member? implies name))
|
||||||
(not (hash-ref simultaneous-installs name #f))
|
(not (hash-ref simultaneous-installs name #f))
|
||||||
(let ([updater
|
(let ([updater
|
||||||
(packages-to-update download-printf current-scope-db
|
(packages-to-update download-printf current-scope-db
|
||||||
|
#:all-db all-db
|
||||||
#:must-update? #f
|
#:must-update? #f
|
||||||
#:deps? do-update-deps?
|
#:deps? do-update-deps?
|
||||||
#:implies? update-implies?
|
#:implies? update-implies?
|
||||||
|
@ -546,8 +547,8 @@
|
||||||
;; Try updates:
|
;; Try updates:
|
||||||
(define update-pkgs (map car update-deps))
|
(define update-pkgs (map car update-deps))
|
||||||
(define (make-pre-succeed)
|
(define (make-pre-succeed)
|
||||||
(define db current-scope-db)
|
(let ([to-update (let ([updater (packages-to-update download-printf current-scope-db
|
||||||
(let ([to-update (let ([updater (packages-to-update download-printf db
|
#:all-db all-db
|
||||||
#:deps? update-deps?
|
#:deps? update-deps?
|
||||||
#:implies? update-implies?
|
#:implies? update-implies?
|
||||||
#:update-cache update-cache
|
#:update-cache update-cache
|
||||||
|
@ -1010,6 +1011,7 @@
|
||||||
;; it maps a package name to a checksum, and a box of the package
|
;; it maps a package name to a checksum, and a box of the package
|
||||||
;; name to #t (to avoid multiple update attempts).
|
;; name to #t (to avoid multiple update attempts).
|
||||||
(define ((packages-to-update download-printf db
|
(define ((packages-to-update download-printf db
|
||||||
|
#:all-db all-db
|
||||||
#:must-update? [must-update? #t]
|
#:must-update? [must-update? #t]
|
||||||
#:deps? deps?
|
#:deps? deps?
|
||||||
#:implies? implies?
|
#:implies? implies?
|
||||||
|
@ -1135,7 +1137,7 @@
|
||||||
(define missing-deps
|
(define missing-deps
|
||||||
(for/list ([dep (in-list deps)]
|
(for/list ([dep (in-list deps)]
|
||||||
#:unless (equal? dep "racket")
|
#:unless (equal? dep "racket")
|
||||||
#:unless (package-info dep #:db db #f))
|
#:unless (package-info dep #:db all-db #f))
|
||||||
dep))
|
dep))
|
||||||
(cond
|
(cond
|
||||||
[(pair? missing-deps)
|
[(pair? missing-deps)
|
||||||
|
@ -1262,6 +1264,7 @@
|
||||||
(define download-printf (if quiet? void printf/flush))
|
(define download-printf (if quiet? void printf/flush))
|
||||||
(define metadata-ns (make-metadata-namespace))
|
(define metadata-ns (make-metadata-namespace))
|
||||||
(define db (read-pkg-db))
|
(define db (read-pkg-db))
|
||||||
|
(define all-db (merge-pkg-dbs))
|
||||||
(define all-mode? (and all? (empty? in-pkgs)))
|
(define all-mode? (and all? (empty? in-pkgs)))
|
||||||
(define pkgs (cond
|
(define pkgs (cond
|
||||||
[all-mode? (hash-keys db)]
|
[all-mode? (hash-keys db)]
|
||||||
|
@ -1278,6 +1281,7 @@
|
||||||
prefetch-group
|
prefetch-group
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(define to-updat* (let ([updater (packages-to-update download-printf db
|
(define to-updat* (let ([updater (packages-to-update download-printf db
|
||||||
|
#:all-db all-db
|
||||||
#:must-update? (and (not all-mode?)
|
#:must-update? (and (not all-mode?)
|
||||||
(not update-deps?))
|
(not update-deps?))
|
||||||
#:deps? (or update-deps?
|
#:deps? (or update-deps?
|
||||||
|
|
Loading…
Reference in New Issue
Block a user