raco pkg update: fix conflict checking vs. installed being updated
This commit is contained in:
parent
5fe0fa3f03
commit
edf562be5e
|
@ -7,13 +7,6 @@
|
|||
|
||||
(this-test-is-run-by-the-main-test)
|
||||
|
||||
(define (set-file path content)
|
||||
(make-parent-directory* path)
|
||||
(call-with-output-file*
|
||||
path
|
||||
#:exists 'truncate/replace
|
||||
(lambda (o) (displayln content o))))
|
||||
|
||||
(define (make-cat-entry #:name name
|
||||
#:source source
|
||||
#:deps [deps null]
|
||||
|
|
|
@ -9,12 +9,6 @@
|
|||
|
||||
(this-test-is-run-by-the-main-test)
|
||||
|
||||
(define (set-file path content)
|
||||
(call-with-output-file*
|
||||
path
|
||||
#:exists 'truncate/replace
|
||||
(lambda (o) (displayln content o))))
|
||||
|
||||
(pkg-tests
|
||||
(define git-exe (find-executable-path
|
||||
(if (eq? 'windows (system-type)) "git.exe" "git")))
|
||||
|
|
|
@ -78,6 +78,40 @@
|
|||
$ "racket -e '(require pkg-test1/conflict)'" =exit> 43
|
||||
$ "raco pkg remove pkg-test1-conflict"))
|
||||
|
||||
(with-fake-root
|
||||
(shelly-case
|
||||
"update succeeds when module is moved to dependency"
|
||||
(define tmp-dir (path->directory-path (make-temporary-file "pkg~a" 'directory)))
|
||||
|
||||
(shelly-wind
|
||||
(define a-dir (build-path tmp-dir "a"))
|
||||
(make-directory a-dir)
|
||||
(set-file (build-path a-dir "info.rkt") "#lang info\n(define collection \"a\")\n")
|
||||
(set-file (build-path a-dir "apple.rkt") "#lang racket/base\n")
|
||||
|
||||
(define b-dir (build-path tmp-dir "b"))
|
||||
(make-directory b-dir)
|
||||
(set-file (build-path b-dir "info.rkt") "#lang info\n(define collection \"a\")\n")
|
||||
(set-file (build-path b-dir "apple.rkt") "#lang racket/base\n")
|
||||
|
||||
$ (~a "raco pkg install --copy " a-dir " " b-dir)
|
||||
=exit> 1
|
||||
=stderr> #rx"packages conflict"
|
||||
|
||||
$ (~a "raco pkg install --copy " a-dir)
|
||||
(set-file (build-path a-dir "info.rkt")
|
||||
(~a "#lang info\n(define collection \"a\")\n"
|
||||
"(define deps '((" (~s (path->string b-dir)) ")))\n"))
|
||||
$ (~a "raco pkg update --auto --copy " a-dir)
|
||||
=exit> 1
|
||||
=stderr> #rx"packages conflict"
|
||||
|
||||
(delete-file (build-path a-dir "apple.rkt"))
|
||||
$ (~a "raco pkg update --auto --copy " a-dir)
|
||||
|
||||
(finally
|
||||
(delete-directory/files tmp-dir)))))
|
||||
|
||||
(shelly-case
|
||||
"conflict extra installs"
|
||||
(for ([c '("test-pkgs/pkg-add-a"
|
||||
|
|
|
@ -217,4 +217,10 @@
|
|||
'dependencies
|
||||
'("pkg-test1"))))
|
||||
|
||||
(define (set-file path content)
|
||||
(call-with-output-file*
|
||||
path
|
||||
#:exists 'truncate/replace
|
||||
(lambda (o) (displayln content o))))
|
||||
|
||||
(provide (all-defined-out))
|
||||
|
|
|
@ -261,7 +261,7 @@
|
|||
(file-exists? (get-compilation-bytecode-file f))
|
||||
(file-exists? (get-compilation-bytecode-file (path-replace-suffix f #".ss"))))
|
||||
(or (not updating?)
|
||||
(not (equal? pkg-name (path->pkg f #:cache path-pkg-cache)))))
|
||||
(not (hash-ref simultaneous-installs (path->pkg f #:cache path-pkg-cache)))))
|
||||
;; This module is already installed
|
||||
(cons (path->pkg f #:cache path-pkg-cache) mp)]
|
||||
[else
|
||||
|
|
Loading…
Reference in New Issue
Block a user