Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions exe/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ statusParser = Opt.info parser infoMod
, Opt.flag' HackageToOverlay
$ Opt.long "from-hackage"
<> Opt.help "Print only packages likely to be interesting to move from hackage tree."
, Opt.flag' OverlayAndHackage
$ Opt.long "updates"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider changing the option to --repo-updates, or anything that implies these are only updates for the local Haskell repo, not ::gentoo/portage.

<> Opt.help "Print only packages that present in both overlay and tree (overlay)."

@hololeap hololeap Mar 20, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<> Opt.help "Print only packages that present in both overlay and tree (overlay)."
<> Opt.help "Print only packages that are present in the local Haskell repo (overlay) and have new versions on Hackage."

, pure PortagePlusOverlay
]

Expand Down
9 changes: 8 additions & 1 deletion src/Status.hs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

-- TODO: Rearrange things so we don't have to disable this warning
{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}

Expand Down Expand Up @@ -122,6 +121,7 @@ runStatus repoContext =
OverlayToPortage -> toPortageFilter
PortagePlusOverlay -> id
HackageToOverlay -> fromHackageFilter
OverlayAndHackage -> overlayAndHackageFilter
pkgs' <- forM pkgs $ \p ->
case simpleParsec p of
Nothing -> die ("Could not parse package name: " ++ p ++ ". Format cat/pkg")
Expand Down Expand Up @@ -155,6 +155,13 @@ toPortageFilter = Map.mapMaybe $ \ sts ->
then Just sts
else Nothing

-- |Only return packages that exist in both the overlay and on hackage
overlayAndHackageFilter :: Map PackageName [FileStatus ExistingEbuild] -> Map PackageName [FileStatus ExistingEbuild]
overlayAndHackageFilter = Map.filter $ \sts ->
let hasOverlay = any (\st -> case st of { OverlayOnly _ -> True; Same _ -> True; Differs _ _ -> True; _ -> False }) sts
hasHackage = any (\st -> case st of { HackageOnly _ -> True; _ -> False }) sts

@hololeap hololeap Mar 20, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something else I thought of: does matching on HackageOnly only match newer versions or will it also match older versions that are not in our local Haskell repo? This is something we can address later if it turns out to be a problem.

(This really depends on how the Map was generated, which I am not familiar with.)

in hasOverlay && hasHackage

-- |Only return packages that exist in overlay or portage but look outdated
fromHackageFilter :: Map PackageName [FileStatus ExistingEbuild] -> Map PackageName [FileStatus ExistingEbuild]
fromHackageFilter = Map.mapMaybe $ \ sts ->
Expand Down
1 change: 1 addition & 0 deletions src/Status/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ data StatusDirection
= PortagePlusOverlay
| OverlayToPortage
| HackageToOverlay
| OverlayAndHackage
deriving Eq

data FileStatus a
Expand Down