From ab2a1fb3c0422405a3bd1d5c991f5f28044a500e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 24 Sep 2016 14:36:15 -0400 Subject: Simplify Debootstrap.sourceInstall since #770217 was fixed. --- debian/changelog | 6 ++++++ src/Propellor/Property/Debootstrap.hs | 39 +---------------------------------- 2 files changed, 7 insertions(+), 38 deletions(-) diff --git a/debian/changelog b/debian/changelog index 55d071ea..cc402065 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +propellor (3.2.1) UNRELEASED; urgency=medium + + * Simplify Debootstrap.sourceInstall since #770217 was fixed. + + -- Joey Hess Sat, 24 Sep 2016 14:34:39 -0400 + propellor (3.2.0) unstable; urgency=medium [ Sean Whitton ] diff --git a/src/Propellor/Property/Debootstrap.hs b/src/Propellor/Property/Debootstrap.hs index c0226b7e..59850c4c 100644 --- a/src/Propellor/Property/Debootstrap.hs +++ b/src/Propellor/Property/Debootstrap.hs @@ -74,9 +74,7 @@ built' installprop target system@(System _ arch) config = cmd <- fromMaybe "debootstrap" <$> programPath de <- standardPathEnv ifM (boolSystemEnv cmd params (Just de)) - ( do - fixForeignDev target - return MadeChange + ( return MadeChange , return FailedChange ) @@ -165,7 +163,6 @@ sourceInstall' = withTmpDir "debootstrap" $ \tmpd -> do case l of (subdir:[]) -> do changeWorkingDirectory subdir - makeDevicesTarball makeWrapperScript (localInstallDir subdir) return MadeChange _ -> errorMessage "debootstrap tar file did not contain exactly one directory" @@ -206,40 +203,6 @@ makeWrapperScript dir = do ] modifyFileMode wrapperScript (addModes $ readModes ++ executeModes) --- Work around for -makeDevicesTarball :: IO () -makeDevicesTarball = do - -- TODO append to tarball; avoid writing to /dev - writeFile foreignDevFlag "1" - ok <- boolSystem "sh" [Param "-c", Param tarcmd] - nukeFile foreignDevFlag - unless ok $ - errorMessage "Failed to tar up /dev to generate devices.tar.gz" - where - tarcmd = "(cd / && tar cf - dev) | gzip > devices.tar.gz" - -fixForeignDev :: FilePath -> IO () -fixForeignDev target = whenM (doesFileExist (target ++ foreignDevFlag)) $ do - de <- standardPathEnv - void $ boolSystemEnv "chroot" - [ File target - , Param "sh" - , Param "-c" - , Param $ intercalate " && " - [ "apt-get update" - , "apt-get -y install makedev" - , "rm -rf /dev" - , "mkdir /dev" - , "cd /dev" - , "mount -t proc proc /proc" - , "/sbin/MAKEDEV std ptmx fd consoleonly" - ] - ] - (Just de) - -foreignDevFlag :: FilePath -foreignDevFlag = "/dev/.propellor-foreign-dev" - localInstallDir :: FilePath localInstallDir = "/usr/local/debootstrap" -- cgit v1.2.3