From 82748d45d842cc0e7dfcd1080379a58a61805556 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 28 Dec 2021 11:57:15 -0800 Subject: [PATCH] install-yarn: Use test -ef in case /srv is a symlink. Signed-off-by: Anders Kaseorg --- puppet/zulip_ops/manifests/profile/postgresql.pp | 2 +- scripts/lib/install-yarn | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/puppet/zulip_ops/manifests/profile/postgresql.pp b/puppet/zulip_ops/manifests/profile/postgresql.pp index 8c60a2bca6..d578f9889c 100644 --- a/puppet/zulip_ops/manifests/profile/postgresql.pp +++ b/puppet/zulip_ops/manifests/profile/postgresql.pp @@ -31,7 +31,7 @@ class zulip_ops::profile::postgresql { exec { 'setup_disks': command => '/root/setup_disks.sh', require => Package["postgresql-${zulip::postgresql_common::version}", 'xfsprogs'], - unless => 'test $(readlink /var/lib/postgresql) = "/srv/postgresql/" -a -d /srv/postgresql', + unless => 'test /var/lib/postgresql/ -ef /srv/postgresql/', } file { "${zulip::postgresql_base::postgresql_confdir}/pg_hba.conf": diff --git a/scripts/lib/install-yarn b/scripts/lib/install-yarn index 2aa8fd81f8..c28dc12cf6 100755 --- a/scripts/lib/install-yarn +++ b/scripts/lib/install-yarn @@ -9,8 +9,7 @@ check_version() { # Reading the version of Yarn from its package.json is much faster # than running yarn --version. link="$(command -v yarn)" \ - && bin="$(readlink -f "$link")" \ - && [ "$bin" = /srv/zulip-yarn/bin/yarn ] \ + && [ "$link" -ef /srv/zulip-yarn/bin/yarn ] \ && current_version="$(jq -r '.version' /srv/zulip-yarn/package.json)" \ && [ "$current_version" = "$version" ] }