[pkg-haskell-tools] 01/03: make-all: Fix use of getArch shake oracle
Joachim Breitner
nomeata at moszumanska.debian.org
Wed Aug 19 18:56:53 UTC 2015
This is an automated email from the git hooks/post-receive script.
nomeata pushed a commit to branch architectures
in repository pkg-haskell-tools.
commit 5b1be32a275df6a3ee8b066b49206a9578bdd116
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Wed Aug 19 20:41:47 2015 +0200
make-all: Fix use of getArch shake oracle
---
src/make-all.hs | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/make-all.hs b/src/make-all.hs
index f3fdefd..1d0a29e 100644
--- a/src/make-all.hs
+++ b/src/make-all.hs
@@ -243,7 +243,7 @@ newtype GetExcludedSources = GetExcludedSources () deriving (Show,Typeable,Eq,Ha
newtype GetDebBuiltBy = GetDebBuiltBy String deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
newtype GetBinToDeb = GetBinToDeb String deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
-newtype Architecture = Arch String deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
+newtype GetArch = GetArch () deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
checkArch :: (Monad m) => String -> String -> String -> m ()
checkArch should is full = unless ( (should `isPrefixOf` is)
@@ -285,13 +285,15 @@ shakeMain conf@(Conf {..}) = do
getExcludedSources <- addOracle $ \GetExcludedSources{} ->
return $ excludedPackages
- getArch <- addOracle $ \a -> let fix = a `asTypeOf` () in
- fmap (Arch . strip . fromStdout) $
+ getArch' <- addOracle $ \GetArch{} ->
+ fmap (strip . fromStdout) $
cmd (Stdin "dpkg --print-architecture; exit")
(Cwd "/") -- To avoid warings about the current directory not existing in the schroot.
[ "schroot"
, "-c", schrootName
]
+ let getArch = getArch' (GetArch ())
+
targetDir </> "cache/sources.txt" %> \out -> do
sources <- getDirectoryDirs "p"
@@ -346,7 +348,7 @@ shakeMain conf@(Conf {..}) = do
binToDeb = getBinToDeb . GetBinToDeb
targetDir </> "cache/all-changes-files.txt" %> \out -> do
- Arch arch <- askOracle ()
+ arch <- getArch
putNormal "# enumerating all changes files..."
sources <- readFileLines $ targetDir </> "cache/sources.txt"
versioned <- forM sources $ \s -> do
@@ -357,7 +359,7 @@ shakeMain conf@(Conf {..}) = do
targetDir </> "cache/binaries/*.txt" %> \out -> do
let s = dropExtension $ takeFileName $ out
putNormal $ "# enumerating binaries of " ++ show s
- Arch arch <- askOracle ()
+ arch <- getArch
pkgs <- binaryPackagesOfSource s arch
v <- versionOfSource s
@@ -371,7 +373,7 @@ shakeMain conf@(Conf {..}) = do
targetDir </> "*.deb" %> \out -> do
let filename = takeFileName out
let [_pkgname,version,end] = splitOn "_" filename
- Arch arch <- askOracle ()
+ arch <- getArch
checkArch arch end filename
sourceMB <- debBuiltBy filename
case sourceMB of
@@ -382,7 +384,7 @@ shakeMain conf@(Conf {..}) = do
targetDir </> "*.changes" %> \out -> do
let filename = takeFileName out
let [source,version,end] = splitOn "_" filename
- Arch arch <- askOracle ()
+ arch <- getArch
checkArch arch end filename
let logfile = targetDir </> logFileName source version arch
need [logfile]
@@ -396,7 +398,7 @@ shakeMain conf@(Conf {..}) = do
targetDir </> "*.build" %> \out -> do
let filename = takeFileName out
let [source,version,end] = splitOn "_" filename
- Arch arch <- askOracle ()
+ arch <- getArch
checkArch arch end filename
let changes = changesFileName source version arch
--
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