Refuse to register packages with unversioned dependencies; trac #1837
authorIan Lynagh <igloo@earth.li>
Fri, 31 Oct 2008 18:17:46 +0000 (18:17 +0000)
committerIan Lynagh <igloo@earth.li>
Fri, 31 Oct 2008 18:17:46 +0000 (18:17 +0000)
utils/ghc-pkg/Main.hs

index 8b33d7b..39f7eeb 100644 (file)
@@ -519,6 +519,11 @@ registerPackage input my_flags auto_ghci_libs update force = do
   pkg <- parsePackageInfo expanded
   putStrLn "done."
 
+  let unversioned_deps = filter (not . realVersion) (depends pkg)
+  unless (null unversioned_deps) $
+      die ("Unversioned dependencies found: " ++
+           unwords (map display unversioned_deps))
+
   let truncated_stack = dropWhile ((/= to_modify).fst) db_stack
   -- truncate the stack for validation, because we don't allow
   -- packages lower in the stack to refer to those higher up.