Skip to content

Commit a640086

Browse files
authored
Fix source-repo under Cabal 3.4 generated plans (input-output-hk#106)
They are no longer always local: haskell/cabal@2b6cd51 haskell/cabal#5586
1 parent c9c10ab commit a640086

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

plan2nix/Plan2Nix.hs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,17 +206,15 @@ value2plan plan = Plan { packages, extras, compilerVersion, compilerPackages }
206206
}
207207
_ -> Nothing
208208

209-
extras = fmap Just $ filterInstallPlan $ \pkg -> case ( pkg ^. key "type" . _String
210-
, pkg ^. key "style" . _String
211-
, pkg ^. key "pkg-src" . key "type" . _String
212-
, pkg ^. key "pkg-src" . _Object) of
213-
(_, "local", "local", _) -> Just $ Package
209+
extras = fmap Just $ filterInstallPlan $ \pkg -> case ( pkg ^. key "style" . _String
210+
, pkg ^. key "pkg-src" . key "type" . _String) of
211+
("local", "local") -> Just $ Package
214212
{ packageVersion = pkg ^. key "pkg-version" . _String
215213
, packageRevision = Nothing
216214
, packageFlags = Map.mapMaybe (^? _Bool) $ pkg ^. key "flags" . _Object
217215
, packageSrc = Just . LocalPath . Text.unpack $ pkg ^. key "pkg-src" . key "path" . _String
218216
}
219-
(_, "local", "source-repo", _) -> Just $ Package
217+
(_, "source-repo") -> Just $ Package
220218
{ packageVersion = pkg ^. key "pkg-version" . _String
221219
, packageRevision = Nothing
222220
, packageFlags = Map.mapMaybe (^? _Bool) $ pkg ^. key "flags" . _Object

0 commit comments

Comments
 (0)