packages feed

packdeps 0.1.0.1 → 0.2.0

raw patch · 3 files changed

+37/−15 lines, 3 filesdep ~yesodPVP ok

version bump matches the API change (PVP)

Dependency ranges changed: yesod

API changes (from Hackage documentation)

Files

packdeps.cabal view
@@ -1,5 +1,5 @@ name:            packdeps-version:         0.1.0.1+version:         0.2.0 license:         BSD3 license-file:    LICENSE author:          Michael Snoyman <michael@snoyman.com>@@ -61,7 +61,7 @@                        , packdeps                        , hamlet                        , yesod-newsfeed-                       , yesod+                       , yesod >= 0.10     else         Buildable: False 
tools/packdeps-cli.hs view
@@ -1,13 +1,22 @@ import Distribution.PackDeps-import System.Environment (getArgs)+import Control.Monad (forM_)+import System.Environment (getArgs, getProgName) import System.Exit (exitFailure, exitSuccess) import Distribution.Text (display) import Distribution.Package (PackageName (PackageName))  main :: IO () main = do+    args <- getArgs+    case args of+        [] -> usageExit+        ["help"] -> usageExit+        _ -> run args++run :: [String] -> IO ()+run args = do     newest <- loadNewest-    getArgs >>= mapM_ (go newest)+    mapM_ (go newest) args   where     go newest fp = do         mdi <- loadPackage fp@@ -31,7 +40,7 @@                     , display v                     , ": Cannot accept the following packages"                     ]-                flip mapM_ p $ \(x, y) -> putStrLn $ x ++ " " ++ y+                forM_ p $ \(x, y) -> putStrLn $ x ++ " " ++ y                 return False         putStrLn ""         if allGood@@ -40,3 +49,14 @@  unPackageName :: PackageName -> String unPackageName (PackageName n) = n+++usageExit :: IO a+usageExit = do+    pname <- getProgName+    putStrLn $ "\n"+        ++ "Usage: " ++ pname ++ " pkgname.cabal\n\n"+        ++ "Check the given cabal file's dependency list to make sure that it does not exclude\n"+        ++ "the newest package available. Its probably worth running the 'cabal update' command\n"+        ++ "immediately before running this program.\n"+    exitSuccess
tools/packdeps-yesod.hs view
@@ -13,8 +13,7 @@ import Control.Arrow import Distribution.Version (withinRange) import qualified Data.Map as Map-import qualified Data.ByteString.Char8 as S8-import Data.Text (Text, pack, unpack)+import Data.Text (Text, pack, unpack, append) import Text.Hamlet (shamlet) import System.Environment (getArgs) import Data.List (sort)@@ -201,9 +200,8 @@  getFeed3R :: Text -> Text -> Text -> Text -> Handler () getFeed3R _ package _ _ =-    redirectText RedirectPermanent-  $ pack-  $ "http://hackage.haskell.org/package/" ++ unpack package+    redirect+  $ "http://hackage.haskell.org/package/" `append` package  main = do     args <- getArgs@@ -335,11 +333,11 @@         setTitle [shamlet|Reverse dependencies for #{dep}|]         addCassius mainCassius         addHamlet [hamlet|-<h1>#{show $ length rels} reverse dependencies for #{dep}&nbsp;#{display version}+<h1><a href="http://hackage.haskell.org/package/#{dep}">#{dep}</a> #{display version} <table>     <tr>-        <th>Package-        <th>Uses current version?+        <th>#{show $ length rels} Reverse #{plural (length rels) "dep" "deps"}+        <th>Accepted versions     $forall rel <- rels         <tr>             $if Map.member (fst rel) reverse@@ -347,7 +345,11 @@             $else                 <td>#{fst rel}             $if withinRange version (snd rel)-                <td>#{display (snd rel)}+                <td><a href="http://hackage.haskell.org/package/#{fst rel}">#{display (snd rel)}             $else-                <td style="background-color:#fbb">#{display (snd rel)}+                <td style="background-color:#fbb"><a href="http://hackage.haskell.org/package/#{fst rel}">#{display (snd rel)} |]+  where+    plural :: Int -> String -> String -> String+    plural 1 s _ = s+    plural _ _ pl = pl