From 93b22a886a12cde2886616298446fcc3eee1bd4d Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Tue, 12 Mar 2024 23:23:10 +0100 Subject: feat(files): support creating intermediate directories --- stdlib/os/debian/apt.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'stdlib/os/debian/apt.go') diff --git a/stdlib/os/debian/apt.go b/stdlib/os/debian/apt.go index 5ece696..aad8b65 100644 --- a/stdlib/os/debian/apt.go +++ b/stdlib/os/debian/apt.go @@ -26,12 +26,21 @@ var apt_norecommends []byte var sources_list []byte func Promise() { + rootDir := gonf.ModeUserGroup(0755, "root", "root") rootRO := gonf.ModeUserGroup(0444, "root", "root") gonf.Default("debian-release", "stable") gonf.AppendVariable("debian-extra-sources", "# Extra sources") apt_update := gonf.Command("apt-get", "update", "-qq") - gonf.File("/etc/apt/sources.list").Permissions(rootRO).Template(sources_list).Promise().IfRepaired(apt_update) - gonf.File("/etc/apt/apt.conf.d/99_norecommends").Permissions(rootRO).Template(apt_norecommends).Promise() + gonf.File("/etc/apt/sources.list"). + Permissions(rootRO). + Template(sources_list). + Promise(). + IfRepaired(apt_update) + gonf.File("/etc/apt/apt.conf.d/99_norecommends"). + DirectoriesPermissions(rootDir). + Permissions(rootRO). + Template(apt_norecommends). + Promise() gonf.SetPackagesConfiguration(packages_install, packages_list, apt_update) gonf.Service("opensmtpd").State("enabled", "started").Promise() systemd.Promise() -- cgit v1.2.3