propellor spin
This commit is contained in:
parent
bf4840f341
commit
31cf8e0c24
|
@ -75,8 +75,8 @@ cleanInstallOnce confirmation = check (not <$> doesFileExist flagfile) $
|
||||||
debootstrap targetos = ensureProperty $ toProp $
|
debootstrap targetos = ensureProperty $ toProp $
|
||||||
Debootstrap.built newOSDir targetos Debootstrap.DefaultConfig
|
Debootstrap.built newOSDir targetos Debootstrap.DefaultConfig
|
||||||
|
|
||||||
umountall = property "all mount points unmounted" $ liftIO $ do
|
umountall = property "mount points unmounted" $ liftIO $ do
|
||||||
mnts <- filter (/= "/") <$> mountPoints
|
mnts <- filter (`notElem` ["/", "/proc"]) <$> mountPoints
|
||||||
forM_ mnts umountLazy
|
forM_ mnts umountLazy
|
||||||
return $ if null mnts then NoChange else MadeChange
|
return $ if null mnts then NoChange else MadeChange
|
||||||
|
|
||||||
|
@ -84,11 +84,13 @@ cleanInstallOnce confirmation = check (not <$> doesFileExist flagfile) $
|
||||||
createDirectoryIfMissing True oldOSDir
|
createDirectoryIfMissing True oldOSDir
|
||||||
rootcontents <- dirContents "/"
|
rootcontents <- dirContents "/"
|
||||||
forM_ rootcontents $ \d ->
|
forM_ rootcontents $ \d ->
|
||||||
when (d /= oldOSDir && d /= newOSDir) $
|
when (d `notElem` [oldOSDir, newOSDir, "/proc"]) $
|
||||||
renameDirectory d (oldOSDir ++ d)
|
renameDirectory d (oldOSDir ++ d)
|
||||||
newrootcontents <- dirContents newOSDir
|
newrootcontents <- dirContents newOSDir
|
||||||
forM_ newrootcontents $ \d ->
|
forM_ newrootcontents $ \d -> do
|
||||||
renameDirectory d ("/" ++ takeFileName d)
|
let dest = "/" ++ takeFileName d
|
||||||
|
whenM (not <$> doesDirectoryExist dest) $
|
||||||
|
renameDirectory d dest
|
||||||
removeDirectory newOSDir
|
removeDirectory newOSDir
|
||||||
return MadeChange
|
return MadeChange
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue