Commits

Colin Woodbury committed b99697f

Real 1.0.3.0 release - lots of fixes

See the changelog!

  • Participants
  • Parent commits c1c782c

Comments (0)

Files changed (4)

File Aura/AurConnection.hs

 makeRPCUrl :: RPCType -> [String] -> String
 makeRPCUrl t args = rpcBaseUrl ++ t' ++ args'
     where t'    = rpcAddType t
-          args' = if t == MultiInfo
-                  then rpcAddMultiInfoArgs args
-                  else rpcAddArg args
+          args' | t == MultiInfo = rpcAddMultiInfoArgs args
+                | otherwise      = rpcAddArg args
 
 aurPkgUrl :: String -> String
 aurPkgUrl n = "https://aur.archlinux.org/packages.php?ID=" ++ n
   na <- valFromObj "Name" pkgJSON
   ve <- valFromObj "Version" pkgJSON
   li <- valFromObj "License" pkgJSON
-  vo <- valFromObj "NumVotes" pkgJSON
+  vo <- valFromObj "NumVotes" pkgJSON >>= return . show . extractRat
   de <- valFromObj "Description" pkgJSON
-  au <- valFromObj "ID" pkgJSON >>= return . aurPkgUrl
-  ou <- valFromObj "OutOfDate" pkgJSON >>= return . (/= "0")
+  au <- valFromObj "ID" pkgJSON >>= return . aurPkgUrl . show . extractRat
+  ou <- valFromObj "OutOfDate" pkgJSON >>= return . (/= 0) . extractRat
   return $ PkgInfo na ve ou ur au li vo de
-{-
-makePkgInfo pkgJSON = makePkgInfo' (\x -> PkgInfo x) pkgJSON fields
-    where fields = [ "Name","Version","URL","License"
-                   , "NumVotes","OutOfDate","Description" ]
-
-makePkgInfo' acc pkgJSON []     = return acc
-makePkgInfo' acc pkgJSON (f:fs) = do
-  x <- valFromObj f pkgJSON
-  makePkgInfo' (acc x) pkgJSON fs
--}
-{- Is this possible?
-  return $ foldl PkgInfo `liftM` mapM (flip valFromObj pkgJSON) fields
-  where fields = [ "Name","Version","URL","License"
-                 , "NumVotes","OutOfDate","Description" ]
--}
+
+-- Temporary fix.
+extractRat :: JSValue -> Int
+extractRat (JSRational _ r) = round $ fromRational r
+extractRat _                = error "THE SYSTEM IS DOWN"
 
 ------------
 -- PKGBUILDS
 downloadPkgbuild :: String -> IO Pkgbuild
 downloadPkgbuild = getUrlContents . getPkgbuildUrl
 
+-- This is more work than it needs to be.
 getTrueVerViaPkgbuild :: Pkgbuild -> String
 getTrueVerViaPkgbuild pkgb = pkgver ++ "-" ++ pkgrel
     where globals = getGlobalVars pkgb
           pkgver  = fromJust $ referenceValue globals "pkgver"
           pkgrel  = fromJust $ referenceValue globals "pkgrel"
 
---getPkgbuildField :: String -> Pkgbuild -> [String]
---getPkgbuildField = getField
-
 ------------------
 -- SOURCE TARBALLS
 ------------------
 
 Move aura to haskell-http.
 
-In `divideByPkgType`, change order to get for Repo packages first.
-
 OPTIONS TO IMPLEMENT
 --------------------
 -Ci -> `--info` Gives some stats about the package cache.
 optdepends=('pacman-color: For coloured pacman output in Aura.')
 options=('strip')
 source=(https://github.com/downloads/fosskers/aura/${_hkgname}-${pkgver}.tar.gz)
-md5sums=('0ec9ee4b634904481f14062c05cdc4f7')
+md5sums=('54632514b5844a48f7f2f513d79a8c7d')
 build() {
     cd ${srcdir}/${_hkgname}-${pkgver}
     runhaskell Setup configure --prefix=/usr --docdir=/usr/share/doc/${pkgname} -O

File changelog.txt

 
 1.0.3.0
 -------
+- Compatibility with AUR 2.0 added.
 - Portuguese translation added. Thanks to Henry "Ingvij" Kupty!
 - Support for `pacman-color` added. Run sudo with `-E` a la:
     sudo -E aura -Ayu