[pkg-haskell-tools] 02/03: make-all: Clean invocation of dpkg --print-architecture
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 977914105c86354ac90083be26a9bdb262045ce8
Author: Joachim Breitner <mail at joachim-breitner.de>
Date: Wed Aug 19 20:44:17 2015 +0200
make-all: Clean invocation of dpkg --print-architecture
---
dht.cabal | 3 +--
src/make-all.hs | 19 +++++++++++--------
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/dht.cabal b/dht.cabal
index 31ab870..24ab27d 100644
--- a/dht.cabal
+++ b/dht.cabal
@@ -27,7 +27,6 @@ executable make-all
extra >= 1.1,
debian == 3.87.*,
optparse-applicative == 0.11.*,
- split == 0.2.*,
- MissingH >= 1.3.0.1 && < 1.4
+ split == 0.2.*
hs-source-dirs: src
default-language: Haskell2010
diff --git a/src/make-all.hs b/src/make-all.hs
index 1d0a29e..d1d6d92 100644
--- a/src/make-all.hs
+++ b/src/make-all.hs
@@ -5,7 +5,6 @@ import Control.Applicative hiding (many)
import qualified Data.Text as T
import Data.List
import Data.List.Split
-import Data.String.Utils (strip)
import Data.Maybe
import Data.Monoid
import Control.Monad
@@ -285,13 +284,17 @@ shakeMain conf@(Conf {..}) = do
getExcludedSources <- addOracle $ \GetExcludedSources{} ->
return $ excludedPackages
- 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
- ]
+ getArch' <- addOracle $ \GetArch{} -> do
+ Stdout archString <- cmd
+ [ "schroot"
+ , "-d", "/"
+ , "-c", schrootName
+ , "--"
+ , "dpkg", "--print-architecture"
+ ]
+ case lines archString of
+ [a] -> return a
+ _ -> fail $ "Unexpected output from dpkg --print-architecture: \""++ archString ++"\""
let getArch = getArch' (GetArch ())
--
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