From 6e79877174b164194fe9a62eec6b55ef3e20ec9e Mon Sep 17 00:00:00 2001 From: picca Date: Fri, 2 Oct 2015 14:15:23 +0000 Subject: Added a comment --- ...ent_6_9a0b4cce3a9cac8504358d6a280c24bb._comment | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 doc/forum/chroot_for_sbuild/comment_6_9a0b4cce3a9cac8504358d6a280c24bb._comment (limited to 'doc') diff --git a/doc/forum/chroot_for_sbuild/comment_6_9a0b4cce3a9cac8504358d6a280c24bb._comment b/doc/forum/chroot_for_sbuild/comment_6_9a0b4cce3a9cac8504358d6a280c24bb._comment new file mode 100644 index 00000000..b2196f8a --- /dev/null +++ b/doc/forum/chroot_for_sbuild/comment_6_9a0b4cce3a9cac8504358d6a280c24bb._comment @@ -0,0 +1,48 @@ +[[!comment format=mdwn + username="picca" + subject="comment 6" + date="2015-10-02T14:15:23Z" + content=""" +Just for information, here my solution. It is not perfect but it works :) +thanks a lot for your help + + sbuild :: System -> RevertableProperty + sbuild system = sbuild' chroot + where + chroot = Chroot.debootstrapped system Debootstrap.BuilddD \"/var/lib/sbuild\" + & \"/etc/apt/apt.conf.d/01proxy\" `File.hasContent` [\"Acquire::http::Proxy \\"http://w.x.y.z:8080\\";\"] + & Apt.installed [\"apt-transport-https\"] + + + sbuild' :: Chroot -> RevertableProperty + sbuild' chroot@(Chroot basedir system _ _) = setup cleanup + where + setup = toProp (Chroot.provisioned chroot) `onChange` setup' + + setup' = property (\"sbuild-creatchroot \" ++ chrootdir) $ do + -- unmount helper filesystems such as proc from the chroot + -- before getting sizes + liftIO $ Mount.unmountBelow chrootdir + -- use the chroot for sbuild + ensureProperty $ + scriptProperty (rmconfig chrootdir ++ + [ \"sbuild-createchroot --setup-only --keep-sbuild-chroot-dir --make-sbuild-tarball=\" ++ tarball ++ \" \" ++ name ++ \" \" ++ chrootdir ++ \" http://httpredir.debian.org/debian\" + ]) + + cleanup = scriptProperty (rmconfig chrootname ++ [\"rm -f -v \" ++ tarball]) + `onChange` toProp (revert (Chroot.provisioned chroot)) + + (name, arch) = case system of + (System (Debian (Stable suite)) a) -> (suite, a) + + chrootname = name ++ \"-\" ++ arch + + chrootdir = basedir chrootname + + tarball = chrootdir ++ \".tar.gz\" + + rmconfig c = [ \"rm -f -v \" ++ \"/etc/schroot/chroot.d\" (c ++ \"-sbuild-*\") + , \"rm -f -v \" ++ \"/etc/sbuild/chroot\" (c ++ \"-sbuild\") + ] + +"""]] -- cgit v1.2.3