module SimpleCmd.Rpm (
rpmspec
) where
import SimpleCmd (cmdLines)
rpmspec :: [String] -> Maybe String -> FilePath -> IO [String]
rpmspec :: [String] -> Maybe String -> String -> IO [String]
rpmspec args :: [String]
args mqf :: Maybe String
mqf spec :: String
spec = do
let qf :: [String]
qf = [String] -> (String -> [String]) -> Maybe String -> [String]
forall b a. b -> (a -> b) -> Maybe a -> b
maybe [] (\ q :: String
q -> ["--queryformat", String
q String -> String -> String
forall a. [a] -> [a] -> [a]
++ "\n"]) Maybe String
mqf
String -> [String] -> IO [String]
cmdLines "rpmspec" (["-q"] [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ [String]
args [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ [String]
qf [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ [String
spec])