Skip to content

Commit f8dc7fe

Browse files
committed
Use only one --ipid flag for batched package unregistraton
1 parent 5725faa commit f8dc7fe

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/Stack/GhcPkg.hs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,10 @@ unregisterGhcPkgIds pkgexe pkgDb epgids = do
146146
Left e -> logWarn $ displayShow e
147147
Right _ -> return ()
148148
where
149+
(idents, gids) = partitionEithers $ toList epgids
149150
args = "unregister" : "--user" : "--force" :
150-
concatMap (either
151-
(\ident -> [packageIdentifierString ident])
152-
(\gid -> ["--ipid", ghcPkgIdString gid]))
153-
epgids
151+
map packageIdentifierString idents ++
152+
if null gids then [] else "--ipid" : map ghcPkgIdString gids
154153

155154
-- | Get the value for GHC_PACKAGE_PATH
156155
mkGhcPackagePath :: Bool -> Path Abs Dir -> Path Abs Dir -> [Path Abs Dir] -> Path Abs Dir -> Text

0 commit comments

Comments
 (0)