install-yarn: Use test -ef in case /srv is a symlink.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-12-28 11:57:15 -08:00 committed by Alex Vandiver
parent c6d9029dfc
commit 82748d45d8
2 changed files with 2 additions and 3 deletions

View File

@ -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":

View File

@ -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" ]
}