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