summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cady <d@jerkface.net>2021-03-13 19:52:35 -0500
committerAndrew Cady <d@jerkface.net>2021-03-13 19:52:35 -0500
commit4b4de008b197db29496e71bf6d6aee9562928467 (patch)
tree4ec92eee2055696267c1b8aa1cc5772071e5efe3
parent0910fb8c9a3e579ccb26f7a4f15365471fa09a64 (diff)
Ensure apt is updated before dpkg tries to install our deb packages
(When option 'apt-update' is true.) This with other changes being committed today allows .deb files to depend on packages from sid.
-rw-r--r--fsmgr.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/fsmgr.hs b/fsmgr.hs
index 948ef8b..834ab4a 100644
--- a/fsmgr.hs
+++ b/fsmgr.hs
@@ -147,6 +147,10 @@ buildRoot config@DiskImageConfig{..} finalOut = do
147 {- 1. debconf -} 147 {- 1. debconf -}
148 forM_ debconfConfig $ 148 forM_ debconfConfig $
149 readFile' >=> liftIO . appendFile (mountpoint </> "var/cache/debconf/config.dat") 149 readFile' >=> liftIO . appendFile (mountpoint </> "var/cache/debconf/config.dat")
150 {- 1.5. install apt package cache -}
151 when installAptLists $ do
152 cmd_ "rsync -Ra" (("/./" ++) <$> aptListFiles aptListCfg) (mountpoint ++ "/")
153 cmd_ "chroot" [mountpoint] "/bin/sh -c" ["apt-cache dumpavail | dpkg --update-avail -"]
150 {- 2. dpkg installs -} 154 {- 2. dpkg installs -}
151 let (fmap dynamicNames -> debs, packageNames) = partitionPackages $ unpack . coerce <$> toList packages 155 let (fmap dynamicNames -> debs, packageNames) = partitionPackages $ unpack . coerce <$> toList packages
152 when (noParent initialImage || not (null packageNames)) $ 156 when (noParent initialImage || not (null packageNames)) $
@@ -158,9 +162,6 @@ buildRoot config@DiskImageConfig{..} finalOut = do
158 need debs 162 need debs
159 cmd_ (AddEnv "DEBIAN_FRONTEND" "noninteractive") 163 cmd_ (AddEnv "DEBIAN_FRONTEND" "noninteractive")
160 ["dpkg"] [if unpackOnly then "--unpack" else "--install"] ["--root", mountpoint] debs 164 ["dpkg"] [if unpackOnly then "--unpack" else "--install"] ["--root", mountpoint] debs
161 {- 2.5. install apt package cache -}
162 when installAptLists $ do
163 cmd_ "rsync -Ra" (("/./" ++) <$> aptListFiles aptListCfg) (mountpoint ++ "/")
164 {- 3. binaries -} 165 {- 3. binaries -}
165 let go b = do 166 let go b = do
166 p <- fromMaybe (fail $ "not found in ${PATH}: " ++ b) <$> liftIO (pathLocate b) 167 p <- fromMaybe (fail $ "not found in ${PATH}: " ++ b) <$> liftIO (pathLocate b)