summaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorJulien Dessaux2024-03-12 23:23:10 +0100
committerJulien Dessaux2024-03-12 23:23:10 +0100
commit93b22a886a12cde2886616298446fcc3eee1bd4d (patch)
treee5147ae2968abb7922a4885332f9e8c9601271d5 /stdlib
parentchore(variables): support integer interpolation for all values (diff)
downloadgonf-93b22a886a12cde2886616298446fcc3eee1bd4d.tar.gz
gonf-93b22a886a12cde2886616298446fcc3eee1bd4d.tar.bz2
gonf-93b22a886a12cde2886616298446fcc3eee1bd4d.zip
feat(files): support creating intermediate directories
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/os/debian/apt.go13
1 files changed, 11 insertions, 2 deletions
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()