summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fsmgr.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/fsmgr.hs b/fsmgr.hs
index 2a2d09c..b1ee647 100644
--- a/fsmgr.hs
+++ b/fsmgr.hs
@@ -53,8 +53,8 @@ uname = unsafePerformIO $ do
53 Stdout out <- cmd "uname -r" 53 Stdout out <- cmd "uname -r"
54 return $ last . wordsBy '-' . head . lines $ out 54 return $ last . wordsBy '-' . head . lines $ out
55 55
56aptListFiles :: [FilePath] 56aptListFiles :: String -> [FilePath]
57aptListFiles = ("/var/lib/apt/lists" </>) <$> observedCorrectListForStretch 57aptListFiles codename = ("/var/lib/apt/lists" </>) . (replace "stretch" codename) <$> observedCorrectListForStretch
58 where 58 where
59 observedCorrectListForStretch = 59 observedCorrectListForStretch =
60 [ "httpredir.debian.org_debian_dists_stretch_main_binary-amd64_Packages" 60 [ "httpredir.debian.org_debian_dists_stretch_main_binary-amd64_Packages"
@@ -95,7 +95,8 @@ buildRoot config@DiskImageConfig{..} finalOut = do
95 ["dpkg"] [if unpackOnly then "--unpack" else "--install"] (dynamicNames <$> debs) 95 ["dpkg"] [if unpackOnly then "--unpack" else "--install"] (dynamicNames <$> debs)
96 {- 2.5. install apt package cache -} 96 {- 2.5. install apt package cache -}
97 when installAptLists $ do 97 when installAptLists $ do
98 cmd_ "rsync -Ra" (("/./" ++) <$> aptListFiles) (mountpoint ++ "/") 98 (Stdout codename) <- cmd "sh -c" [". /etc/os-release && [ \"$VERSION_CODENAME\" ] && echo -n $VERSION_CODENAME"]
99 cmd_ "rsync -Ra" (("/./" ++) <$> aptListFiles codename) (mountpoint ++ "/")
99 {- 3. binaries -} 100 {- 3. binaries -}
100 let go b = do 101 let go b = do
101 p <- fromMaybe (fail $ "not found in ${PATH}: " ++ b) <$> liftIO (pathLocate b) 102 p <- fromMaybe (fail $ "not found in ${PATH}: " ++ b) <$> liftIO (pathLocate b)