[pkg-haskell-tools] 03/03: Added command line flag '--sbuild-option'.

Sven Bartscher svenb-guest at moszumanska.debian.org
Wed Aug 19 15:47:11 UTC 2015


This is an automated email from the git hooks/post-receive script.

svenb-guest pushed a commit to branch architectures
in repository pkg-haskell-tools.

commit eb8491666e8d4343b95c48a73844c1ede0ad339b
Author: Sven Bartscher <sven.bartscher at weltraumschlangen.de>
Date:   Wed Aug 19 17:30:37 2015 +0200

    Added command line flag '--sbuild-option'.
---
 src/make-all.hs | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/src/make-all.hs b/src/make-all.hs
index 64d1449..f3fdefd 100644
--- a/src/make-all.hs
+++ b/src/make-all.hs
@@ -43,6 +43,7 @@ data Conf = Conf
     , schrootName :: String
     , shakeVerbosity' :: Verbosity
     , keepGoing :: Bool
+    , sbuildArgs :: [String]
     , targets :: [String]
     }
 
@@ -106,7 +107,12 @@ confSpec = Conf
     help "keep going even if there are errors" <>
     showDefault
     )
-  <*> O.many (argument str (metavar "TARGET..."))
+ <*> O.many ( strOption (
+    long "sbuild-option" <>
+    metavar "OPTION" <>
+    help "An option to pass on to sbuilder (can be passed multiple times)"
+    ))
+ <*> O.many (argument str (metavar "TARGET..."))
 
 parseCommaOrSpace:: ReadM [String]
 parseCommaOrSpace = do
@@ -164,8 +170,8 @@ changesFileName s v a = s ++ "_" ++ v ++ "_" ++ a ++ ".changes"
 logFileName s v a = s ++ "_" ++ v ++ "_" ++ a ++ ".build"
 sourceFileName s v = s ++ "_" ++ v ++ ".dsc"
 
-binaryPackagesOfSource :: String -> Action [(String, String)]
-binaryPackagesOfSource s = do
+binaryPackagesOfSource :: String -> String -> Action [(String, String)]
+binaryPackagesOfSource s arch = do
     let controlFile = "p" </> s </> "debian" </> "control"
     need [controlFile]
     ret <- liftIO $ parseDebianControlFromFile controlFile
@@ -174,7 +180,7 @@ binaryPackagesOfSource s = do
         Right dc -> forM (debianBinaryParagraphs dc) $  \bp -> do
             p <- maybe (fail "No Package field") (return . T.unpack) $ fieldValue "Package" bp
             a <- maybe (fail "No Arch field") (return . T.unpack) $ fieldValue "Architecture" bp
-            return (p, if a == "all" then a else "amd64")
+            return (p, if a == "all" then a else arch)
 
 dependsOfDsc :: FilePath -> IO [String]
 dependsOfDsc f = do
@@ -351,7 +357,8 @@ shakeMain conf@(Conf {..}) = do
     targetDir </> "cache/binaries/*.txt" %> \out -> do
         let s = dropExtension $ takeFileName $ out
         putNormal $ "# enumerating binaries of " ++ show s
-        pkgs <- binaryPackagesOfSource s
+        Arch arch <- askOracle ()
+        pkgs <- binaryPackagesOfSource s arch
         v <- versionOfSource s
 
         writeFileChanged out $ unlines [ p ++ "_" ++ v ++ "_" ++ a ++ ".deb" | (p,a) <- pkgs]
@@ -437,7 +444,7 @@ shakeMain conf@(Conf {..}) = do
                 ["dpkg-scanpackages", "."]
 
             -- Run sbuild
-            Exit c <- cmd (Cwd targetDir) (EchoStdout False)
+            Exit c <- cmd (Cwd targetDir) (EchoStdout False) $
                 ["sbuild"
                 , "-c", schrootName
                 , "-A"
@@ -447,7 +454,7 @@ shakeMain conf@(Conf {..}) = do
                 , "--chroot-setup-commands=bash " ++ fixup
                 , "--extra-repository=deb [trusted=yes] file://" ++ repoDir ++ " ./"
                 , dsc
-                ]
+                ] ++ sbuildArgs
             if (c == ExitSuccess)
             then do
                 -- Add the sources to the changes file. We do not simply pass

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-haskell/pkg-haskell-tools.git



More information about the Pkg-haskell-commits mailing list