Skip to content

Commit 29b1881

Browse files
hamishmackangerman
authored andcommitted
Fix subdir on source repos in cabal.project (input-output-hk#55)
* Fix subdir on source repos in cabal.project * Update build.sh
1 parent 4122da1 commit 29b1881

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

nix-tools/plan2nix/Plan2Nix.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import Data.HashMap.Strict ( HashMap )
1212
import qualified Data.HashMap.Strict as Map
1313
import Data.Maybe ( mapMaybe
1414
, isJust
15+
, fromMaybe
1516
)
1617
import Data.List.NonEmpty ( NonEmpty (..) )
1718
import qualified Data.Text as Text
@@ -201,7 +202,7 @@ value2plan plan = Plan { packages, extras, compilerVersion, compilerPackages }
201202
{ packageVersion = pkg ^. key "pkg-version" . _String
202203
, packageRevision = Nothing
203204
, packageFlags = Map.mapMaybe (^? _Bool) $ pkg ^. key "flags" . _Object
204-
, packageSrc = Just . flip DVCS ["."] $
205+
, packageSrc = Just . flip DVCS [ Text.unpack $ fromMaybe "." $ pkg ^? key "pkg-src" . key "source-repo" . key "subdir" . _String ] $
205206
Git ( Text.unpack $ pkg ^. key "pkg-src" . key "source-repo" . key "location" . _String )
206207
( Text.unpack $ pkg ^. key "pkg-src" . key "source-repo" . key "tag" . _String )
207208
}

0 commit comments

Comments
 (0)