-
Notifications
You must be signed in to change notification settings - Fork 22
hackage status: --updates option to show atoms that present both in overlay and hackage #147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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" | ||||||
| <> Opt.help "Print only packages that present in both overlay and tree (overlay)." | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| , pure PortagePlusOverlay | ||||||
| ] | ||||||
|
|
||||||
|
|
||||||
| 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 #-} | ||
|
|
||
|
|
@@ -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") | ||
|
|
@@ -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 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Something else I thought of: does matching on (This really depends on how the |
||
| 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 -> | ||
|
|
||
There was a problem hiding this comment.
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.