git: 43b82d69b252 - main - nuageinit: add a function to bootstrap pkg if needed
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 06 Jun 2025 16:27:00 UTC
The branch main has been updated by bapt:
URL: https://cgit.FreeBSD.org/src/commit/?id=43b82d69b252ddd50ac82e54481f2184b8212869
commit 43b82d69b252ddd50ac82e54481f2184b8212869
Author: Sebastien Baylocq <sebastien.baylocq@ovhcloud.com>
AuthorDate: 2025-06-06 10:20:46 +0000
Commit: Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2025-06-06 16:26:38 +0000
nuageinit: add a function to bootstrap pkg if needed
Sponsored by: OVHCloud
---
libexec/nuageinit/nuage.lua | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/libexec/nuageinit/nuage.lua b/libexec/nuageinit/nuage.lua
index 15af5afbd9f0..addab5419193 100644
--- a/libexec/nuageinit/nuage.lua
+++ b/libexec/nuageinit/nuage.lua
@@ -361,6 +361,15 @@ local function chpasswd(obj)
end
end
+local function pkg_bootstrap()
+ if os.execute("pkg -N 2>/dev/null") then
+ return true
+ end
+ print("Bootstrapping pkg")
+ return os.execute("env ASSUME_ALWAYS_YES=YES pkg bootstrap")
+end
+
+
local n = {
warn = warnmsg,
err = errmsg,
@@ -371,7 +380,8 @@ local n = {
addgroup = addgroup,
addsshkey = addsshkey,
update_sshd_config = update_sshd_config,
- chpasswd = chpasswd
+ chpasswd = chpasswd,
+ pkg_bootstrap = pkg_bootstrap
}
return n