Commit 182c165d authored by bjorn@bringert.net's avatar bjorn@bringert.net
Browse files

Check that there is a sanely named .cabal file after unpacking a code tarball.

parent 080b210d
......@@ -36,7 +36,7 @@ import Distribution.Simple.Compiler (Compiler(..))
import Distribution.Simple.InstallDirs (InstallDirs(..), absoluteInstallDirs)
import Distribution.Simple.SetupWrapper (setupWrapper)
import Distribution.Simple.Setup (CopyDest(..))
import Distribution.Package (showPackageId, PackageIdentifier)
import Distribution.Package (showPackageId, PackageIdentifier(..))
import Distribution.Verbosity
......@@ -133,6 +133,9 @@ installPkg cfg comp globalArgs (pkg,ops,repo)
(removeDirectoryRecursive tmpDirPath)
(do message cfg deafening (printf "Extracting %s..." pkgPath)
extractTarGzFile (Just tmpDirPath) pkgPath
let descFilePath = tmpDirPath </> showPackageId pkg </> pkgName pkg <.> "cabal"
e <- doesFileExist descFilePath
when (not e) $ fail $ "Package .cabal file not found: " ++ show descFilePath
installUnpackedPkg cfg pkg setup
return ())
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment