Permalink
Browse files

Allow to 'hackport status' by package name

  • Loading branch information...
1 parent eef57f0 commit fe415dfab9bea034e98f94aa27ec8fc0bc300202 @kolmodin kolmodin committed Oct 4, 2008
Showing with 10 additions and 5 deletions.
  1. +1 −1 Main.hs
  2. +9 −4 Status.hs
View
@@ -340,7 +340,7 @@ statusAction flags args globalFlags = do
toPortdir = fromFlag (statusToPortage flags)
portdir <- maybe getSystemPortdir return portdirM
overlayPath <- maybe (getOverlayPath verbosity) return overlayPathM
- runStatus verbosity portdir overlayPath toPortdir
+ runStatus verbosity portdir overlayPath toPortdir args
-----------------------------------------------------------------------
-- Merge
View
@@ -74,12 +74,17 @@ status verbosity portdir overlayPath = do
]
return meld
-runStatus :: Verbosity -> FilePath -> FilePath -> Bool -> IO ()
-runStatus verbosity portdir overlayPath toPortageFlag = do
+runStatus :: Verbosity -> FilePath -> FilePath -> Bool -> [String] -> IO ()
+runStatus verbosity portdir overlayPath toPortageFlag pkgs = do
let pkgFilter | toPortageFlag = toPortageFilter
| otherwise = id
- pkgs <- status verbosity portdir overlayPath
- statusPrinter (pkgFilter pkgs)
+ tree0 <- status verbosity portdir overlayPath
+ let tree = pkgFilter tree0
+ if (null pkgs)
+ then statusPrinter tree
+ else forM_ pkgs $ \pkg -> do
+ let filteredTree = Map.filterWithKey (\k _ -> pPackage k == pkg) tree
+ statusPrinter filteredTree
-- |Only return packages that seems interesting to sync to portage;
--

0 comments on commit fe415df

Please sign in to comment.