Merge pull request #3417 from enolan/3397
Fix #3397
commit6b90f7bc5c7cc93ec695163a562ed8251ec77a8b
authorJan de Muijnck-Hughes <jfdm@users.noreply.github.com>
dateSat 10 Sep 2016, 08:32 (10 years ago)
parent3ca2d2b55e72e4
src/Idris/Imports.hs+1−1
@@ -48,7 +48,7 @@ ibcPath :: FilePath -> Bool -> FilePath -> FilePath
4848ibcPath ibcsd use_ibcsd fp = let (d_fp, n_fp) = splitFileName fp
4949 d = if (not use_ibcsd) || ibcsd == ""
5050 then d_fp
51− else d_fp </> ibcsd
51+ else ibcsd </> d_fp
5252 n = dropExtension n_fp
5353 in d </> n <.> "ibc"
5454
src/Idris/Package.hs+4−1
@@ -64,7 +64,10 @@ buildPkg :: [Opt] -- ^ Command line options
6464buildPkg copts warnonly (install, fp) = do
6565 pkgdesc <- parseDesc fp
6666 dir <- getCurrentDirectory
67− let idx = PkgIndex (pkgIndex (pkgname pkgdesc))
67+ let idx' = pkgIndex $ pkgname pkgdesc
68+ idx = PkgIndex $ case opt getIBCSubDir copts of
69+ (ibcsubdir:_) -> ibcsubdir </> idx'
70+ [] -> idx'
6871 oks <- mapM (testLib warnonly (pkgname pkgdesc)) (libdeps pkgdesc)
6972 when (and oks) $ do
7073 m_ist <- inPkgDir pkgdesc $ do
test/TestData.hs+2−1
@@ -174,7 +174,8 @@ testFamiliesData = [
174174 ( 3, ANY ),
175175 ( 4, ANY ),
176176 ( 5, ANY ),
177− ( 6, ANY )]),
177+ ( 6, ANY ),
178+ ( 7, ANY )]),
178179 ("prelude", "Prelude",
179180 [ ( 1, ANY )]),
180181 ("primitives", "Primitive types",
test/pkg007/expectednew file+1
@@ -0,0 +1 @@
1+(True, "VROOOOM", Pedal) : (Bool, String, CarPart)
test/pkg007/inputnew file+4
@@ -0,0 +1,4 @@
1+:module Toy
2+:module Toy.Vehicle
3+:module Toy.Vehicle.Car
4+(toysAreGreat, carNoise, Pedal)
test/pkg007/runnew file+7
@@ -0,0 +1,7 @@
1+#!/usr/bin/env bash
2+cd toy
3+${IDRIS:-idris} $@ --build toy.ipkg --ibcsubdir ../ibcout
4+cd ../ibcout
5+${IDRIS:-idris} $@ --quiet < ../input
6+cd ..
7+rm -rf ibcout
test/pkg007/toy/Toy.idrnew file+4
@@ -0,0 +1,4 @@
1+module Toy
2+
3+toysAreGreat : Bool
4+toysAreGreat = True
test/pkg007/toy/Toy/Vehicle.idrnew file+4
@@ -0,0 +1,4 @@
1+module Toy.Vehicle
2+
3+carNoise : String
4+carNoise = "VROOOOM"
test/pkg007/toy/Toy/Vehicle/Car.idrnew file+3
@@ -0,0 +1,3 @@
1+module Toy.Vehicle.Car
2+
3+data CarPart = Wheel | Pedal | Window
test/pkg007/toy/toy.ipkgnew file+7
@@ -0,0 +1,7 @@
1+package toy
2+
3+modules = Toy,
4+ Toy.Vehicle,
5+ Toy.Vehicle.Car
6+
7+opts = "--quiet"