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

Sven Bartscher svenb-guest at moszumanska.debian.org
Tue Aug 18 15:00:14 UTC 2015


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

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

commit 44c4427da44f21f0f718ea143e5e216fe12285a9
Author: Sven Bartscher <sven.bartscher at weltraumschlangen.de>
Date:   Tue Aug 18 16:58:24 2015 +0200

    Bind mount repository directly, by using sudo in sbuild startup commands.
---
 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 19f2275..682e675 100644
--- a/src/make-all.hs
+++ b/src/make-all.hs
@@ -382,39 +382,39 @@ shakeMain conf@(Conf {..}) = do
             liftIO (listFiles targetDir)
         let localDepPkgs = map debFileNameToPackage localDebs
 
-        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."
+        -- 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."
 
 
     -- 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