Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

zulip-puppet-apply: Work around broken Puppet on Ubuntu 22.04.

Anders Kaseorg25c87cc7da80
diff --git a/scripts/lib/ruby3hack.rb b/scripts/lib/ruby3hack.rb
new file mode 100644
index 00000000000..7b78b52706d
--- /dev/null
+++ b/scripts/lib/ruby3hack.rb
@@ -0,0 +1,7 @@
+# Work around https://bugs.launchpad.net/ubuntu/+source/puppet/+bug/1969939.
+
+require 'fileutils'
+
+def FileUtils.symlink(src, dest, options = {}, **kwargs)
+ FileUtils.ln_s(src, dest, **options, **kwargs)
+end
diff --git a/scripts/zulip-puppet-apply b/scripts/zulip-puppet-apply
index 26c97e82a62..d0b9de3622e 100755
--- a/scripts/zulip-puppet-apply
+++ b/scripts/zulip-puppet-apply
@@ -65,6 +65,8 @@ puppet_env["FACTER_zulip_scripts_path"] = scripts_path
# This is to suppress Puppet warnings with ruby 2.7.
if (distro_info["ID"], distro_info["VERSION_ID"]) in [("ubuntu", "20.04")]:
puppet_env["RUBYOPT"] = "-W0"
+if (distro_info["ID"], distro_info["VERSION_ID"]) in [("ubuntu", "22.04")]:
+ puppet_env["RUBYOPT"] = "-r " + os.path.join(scripts_path, "lib", "ruby3hack.rb")
if not args.noop and not args.force:
# --noop does not work with --detailed-exitcodes; see https://tickets.puppetlabs.com/browse/PUP-686