summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2016-09-24 14:36:15 -0400
committerJoey Hess2016-09-24 14:36:15 -0400
commitab2a1fb3c0422405a3bd1d5c991f5f28044a500e (patch)
treea0e12d9458b1fd7adf4765bbabec501440526a8f
parent19074b8c23c82bfb743d46c804cc70afae5d66ac (diff)
Simplify Debootstrap.sourceInstall since #770217 was fixed.
-rw-r--r--debian/changelog6
-rw-r--r--src/Propellor/Property/Debootstrap.hs39
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 <id@joeyh.name> 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 <http://bugs.debian.org/770217>
-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"