--- /home/metaxal/build/racket/collects/pkg/lib.rkt.matthew
+++ /home/metaxal/build/racket/collects/pkg/lib.rkt
@@ -888,6 +888,7 @@
         (eq? type 'link))
     (unless (directory-exists? pkg)
       (pkg-error "no such directory\n  path: ~a" pkg))
+    (correct-single-collection! pkg-name pkg)
     (let ([pkg (directory-path-no-slash pkg)])
       (cond
        [(eq? type 'link)
@@ -1241,11 +1242,30 @@
   (for-each (λ (t) (t)) do-its)
   setup-collects)
 
+(define (correct-single-collection! pkg-name dir 
+                                    #:namespace [metadata-ns (make-metadata-namespace)])
+  (define i (get-info/full dir #:namespace metadata-ns))
+  
+  (define info.rkt (build-path dir "info.rkt"))
+  (unless i
+    (display-to-file "#lang setup/infotab\n" info.rkt))
+  
+  (unless (and i (or (i 'multi-collection (λ()#f)) 
+                     (i 'collection-name (λ()#f))))
+    ; Add the info.rkt file if none is provided
+    ; and define the single-collection name as the package's name
+    (display-to-file (string-append "(define collection-name \""
+                                    pkg-name "\")\n")
+                     info.rkt
+                     #:exists 'append)))
+    
 (define (pkg-single-collection dir #:namespace [metadata-ns (make-metadata-namespace)])
   (define i (get-info/full dir #:namespace metadata-ns))
-  (and i (let ([s (i 'single-collection (lambda () #f))])
-           (and (string? s) 
-                s))))
+  (and i
+       (not (i 'multi-collection (lambda () #f)))
+       (let ([s (i 'collection-name (lambda () #f))])
+         (and (string? s) 
+              s))))
 
 (define (get-setup-collects pkg-directories metadata-ns)
   (maybe-append
