g-npm 0.0.1 → 0.0.2
raw patch · 3 files changed
+12/−4 lines, 3 files
Files
- g-npm.cabal +1/−1
- src/Main.hs +2/−1
- src/Npm.hs +9/−2
g-npm.cabal view
@@ -1,5 +1,5 @@ Name: g-npm-Version: 0.0.1+Version: 0.0.2 Description: Generate Gentoo ebuilds from NodeJS/npm packages. License: MIT License-file: LICENSE
src/Main.hs view
@@ -53,6 +53,7 @@ pkg <- doGetNpm (optPkgName opts') (optPkgVersion opts') case pkg of- Nothing -> ioError (userError ("Package " ++ (optPkgName opts') ++ " not found."))+ Nothing -> ioError (userError ("Package " ++ (optPkgName opts') ++ + " not found.")) Just pkg -> putStrLn $ (showNpmEbuild pkg)
src/Npm.hs view
@@ -12,6 +12,7 @@ import Text.JSON import Network.HTTP+import Data.List -- Test Data jsStr :: String@@ -48,13 +49,14 @@ --} --+{-- makeEbuild :: IO (Maybe Npm) -> IO (String) makeEbuild n = fmap doEbuild n where doEbuild :: Maybe Npm -> String doEbuild (Just n) = show $ (name n) ++ (version n) doEbuild Nothing = ""-+--} makeEbuildS :: Maybe Npm -> String makeEbuildS n = doEbuildS n where@@ -78,8 +80,13 @@ "KEYWORDS=\"~amd64 ~x86\"" ++ "\n" ++ "IUSE=\"\"" ++ "\n" ++ "DEPEND=\">=net-libs/nodejs-0.8.10\"" ++ "\n" ++- "RDEPEND=\"${DEPEND}\"" ++ "\n"+ "RDEPEND=\"" ++ depStrings n +++ "\n\t${DEPEND}\"" ++ "\n" +depStrings :: Npm -> String+depStrings pkg = concat $ + intersperse "\n\t" $ + map (\(x, y) -> ">=dev-nodejs/" ++ x ++ "-" ++ (tail y)) $ dependencies pkg -- -- Converts the resulting JSON from querying the NPM Registry,