Skip to content

Commit

Permalink
Merge: Remove exitSuccess from diffEbuilds
Browse files Browse the repository at this point in the history
The diffEbuilds function calls exitSuccess which terminates the program
and prevents any more output from being displayed. This seems like a
mistake, and in any event it prevents warnings from being displayed at
the end of the output.

Signed-off-by: hololeap <[email protected]>
  • Loading branch information
hololeap committed Mar 23, 2024
1 parent 2934996 commit 15b0922
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/Merge.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import System.Directory ( getCurrentDirectory
)
import System.Process
import System.FilePath ((</>),(<.>))
import System.Exit (ExitCode(ExitSuccess), exitSuccess)
import System.Exit (ExitCode(ExitSuccess))

-- hackport
import qualified AnsiColor as A
Expand Down Expand Up @@ -89,11 +89,10 @@ Requested features:
-}

-- | Call @diff@ between two ebuilds.
diffEbuilds :: FilePath -> Portage.PackageId -> Portage.PackageId -> IO ()
diffEbuilds fp a b = do _ <- system $ "diff -u --color=auto "
++ fp </> Portage.packageIdToFilePath a ++ " "
++ fp </> Portage.packageIdToFilePath b
exitSuccess
diffEbuilds :: FilePath -> Portage.PackageId -> Portage.PackageId -> IO ExitCode
diffEbuilds fp a b = system $ "diff -u --color=auto "
++ fp </> Portage.packageIdToFilePath a ++ " "
++ fp </> Portage.packageIdToFilePath b

-- | Given a list of available packages, and maybe a preferred version,
-- return the available package with that version. Latest version is chosen
Expand Down Expand Up @@ -196,8 +195,11 @@ merge repoContext packageString users_cabal_flags
newPkgId = Portage.fromCabalPackageId cat cabal_pkgId
pkgDir <- liftIO $ listDirectory pkgPath
case Merge.getPreviousPackageId pkgDir newPkgId of
Just validPkg -> do info "Generating a diff..."
liftIO $ diffEbuilds overlayPath validPkg newPkgId
Just validPkg -> do
info "Generating a diff..."
-- Ignore the ExitCode generated by diff
_ <- liftIO $ diffEbuilds overlayPath validPkg newPkgId
pure ()
_ -> info "Nothing to diff!"

-- used to be FlagAssignment in Cabal but now it's an opaque type
Expand Down

0 comments on commit 15b0922

Please sign in to comment.