[pkg-haskell-tools] 01/01: Revert "Bind mount repository directly, by using sudo in sbuild startup commands."

Joachim Breitner nomeata at moszumanska.debian.org
Wed Aug 19 06:49:10 UTC 2015


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

nomeata pushed a commit to branch master
in repository pkg-haskell-tools.

commit daaf443c3d3feb0a9b8cbb96fe72716764b6443f
Author: Joachim Breitner <mail at joachim-breitner.de>
Date:   Wed Aug 19 00:13:13 2015 +0200

    Revert "Bind mount repository directly, by using sudo in sbuild startup commands."
    
    This reverts commit 44c4427da44f21f0f718ea143e5e216fe12285a9.
---
 src/make-all.hs | 66 ++++++++++++++++++++++++++++-----------------------------
 1 file changed, 33 insertions(+), 33 deletions(-)

diff --git a/src/make-all.hs b/src/make-all.hs
index 845841e..5f2f342 100644
--- a/src/make-all.hs
+++ b/src/make-all.hs
@@ -392,39 +392,39 @@ shakeMain conf@(Conf {..}) = do
             liftIO (listFiles targetDir)
         let localDepPkgs = map debFileNameToPackage localDebs
 
-        -- Now monkey-patch dependencies out of the package lists
-        let fixup = targetDir </> "fixup.sh"
-        liftIO $ writeFile fixup  $ fixupScript localDepPkgs
-
-        -- Create a dummy repository
-        let repoDir = "/var/dht-make-all-archive"
-        unit $ cmd (Cwd targetDir)  (EchoStderr False) (FileStdout (targetDir </> "Packages"))
-                 ["dpkg-scanpackages", "."]
-        mountPath <- liftIO $ System.Directory.canonicalizePath targetDir
-
-        -- Run sbuild
-        Exit c <- cmd (Cwd targetDir) (EchoStdout False)
-                  ["sbuild"
-                  , "-c", schrootName
-                  , "-A"
-                  , "--no-apt-update"
-                  , "--dist", distribution
-                  , "--pre-build-commands=sudo mkdir -p %SBUILD_CHROOT_DIR" ++ repoDir
-                  , "--pre-build-commands=sudo mount --bind " ++ mountPath ++ " %SBUILD_CHROOT_DIR" ++ repoDir
-                  , "--chroot-setup-commands=bash " ++ repoDir ++ "/fixup.sh"
-                  , "--extra-repository=deb [trusted=yes] file://" ++ repoDir ++ " ./"
-                  , dsc
-                  ]
-        if (c == ExitSuccess)
-        then do
-          -- Add the sources to the changes file. We do not simply pass
-          -- "-s" to sbuild, as it would make sbuild re-create and override the .dsc file
-          -- which confuses the build system.
-          unit $ cmd ["changestool", targetDir </> changes, "adddsc", targetDir </> dsc]
-        else do
-          putNormal $ "Failed to build " ++ source ++ "_" ++ version
-          ex <- liftIO $ System.Directory.doesFileExist out
-          putNormal $ "See " ++ out ++ " for details."
+        withTempDir $ \tmpdir -> do
+            -- Now monkey-patch dependencies out of the package lists
+            let fixup = tmpdir </> "fixup.sh"
+            liftIO $ writeFile fixup  $ fixupScript localDepPkgs
+
+            -- Create a dummy repository
+            let repoDir = tmpdir </> "repo"
+            liftIO $ createDirectory repoDir
+            forM_ localDebs $ \p -> liftIO $ copyFile ("lab" </> p) (repoDir </> p)
+            unit $ cmd (Cwd repoDir)  (EchoStderr False) (FileStdout (repoDir </> "Packages"))
+                ["dpkg-scanpackages", "."]
+
+            -- Run sbuild
+            Exit c <- cmd (Cwd targetDir) (EchoStdout False)
+                ["sbuild"
+                , "-c", schrootName
+                , "-A"
+                , "--no-apt-update"
+                , "--dist", distribution
+                , "--chroot-setup-commands=bash " ++ fixup
+                , "--extra-repository=deb [trusted=yes] file://" ++ repoDir ++ " ./"
+                , dsc
+                ]
+            if (c == ExitSuccess)
+            then do
+                -- Add the sources to the changes file. We do not simply pass
+                -- "-s" to sbuild, as it would make sbuild re-create and override the .dsc file
+                -- which confuses the build system.
+                unit $ cmd ["changestool", targetDir </> changes, "adddsc", targetDir </> dsc]
+            else do
+                putNormal $ "Failed to build " ++ source ++ "_" ++ version
+                ex <- liftIO $ System.Directory.doesFileExist out
+                putNormal $ "See " ++ out ++ " for details."
 
 
     -- Build log depends on the corresponding source, and the dependencies

-- 
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