raco pkg: fix conflict checking for a collection splice

Package updating also seems to have been broken by roughly
the same code (so maybe I ran the test suite incorrectly
before?).

Closes PR 13736
This commit is contained in:
Matthew Flatt 2013-05-07 16:42:08 -04:00
parent 89f9b860cd
commit 2841e873e1
3 changed files with 16 additions and 6 deletions

View File

@ -992,10 +992,12 @@
(or (file-exists? f)
(file-exists? (path-replace-suffix f #".ss"))
(let-values ([(base name dir?) (split-path f)])
(or (file-exists? (build-path base "compiled" (path-add-suffix f #".zo")))
(or (file-exists? (build-path base "compiled" (path-add-suffix name #".zo")))
(file-exists? (build-path base "compiled" (path-add-suffix
(path-replace-suffix f #".ss")
#".zo")))))))
(path-replace-suffix name #".ss")
#".zo"))))))
(or (not updating?)
(not (equal? pkg-name (path->pkg f)))))
;; This module is already installed
(cons (path->pkg f) mp)]
[else

View File

@ -33,9 +33,11 @@
(get-pkg-content (pkg-desc "http://localhost:9999/pkg-test1.zip" #f #f #f)))
(check-equal? cksum cksum1)
(check-equal? mods '((lib "pkg-test1/conflict.rkt")
(lib "pkg-test1/main.rkt")
(lib "pkg-test1/update.rkt")))
(check-equal? (sort mods string<? #:key cadr)
'((lib "data/empty-set.rkt")
(lib "pkg-test1/conflict.rkt")
(lib "pkg-test1/main.rkt")
(lib "pkg-test1/update.rkt")))
(check-equal? deps '())
(define-values (cksum2 mods2 deps2)

View File

@ -0,0 +1,6 @@
#lang racket/base
(define empty-set '())
;; This module tests splicing into an existing collection
;; (and the associated conflict checking).