HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux vmi1674223.contaboserver.net 5.4.0-182-generic #202-Ubuntu SMP Fri Apr 26 12:29:36 UTC 2024 x86_64
User: root (0)
PHP: 7.4.3-4ubuntu2.22
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //usr/share/postgresql-common/t/003_alternatives.t
# Check that alternatives symlinks point to the correct locations

use warnings;
use strict;

use lib 't';
use TestLib;

use Test::More tests => $PgCommon::rpm ? 1 : 9;

if ($PgCommon::rpm) {
    ok "No alternatives test on RedHat";
    exit;
}

# server/client link group
my $newest_version = $ALL_MAJORS[-1];
note "Newest PG version installed is $newest_version";
program_ok 0, 'update-alternatives --list psql.1.gz', 0, 'psql.1.gz link group';
program_ok 0, 'update-alternatives --list postmaster.1.gz', 2, 'postmaster.1.gz link group does not exist'; # removed in pg-common 248
for my $name (qw(psql pg_dump postgres pg_ctl)) {
    is readlink "/etc/alternatives/$name.1.gz", "/usr/share/postgresql/$newest_version/man/man1/$name.1.gz", "$name.1.gz alternative";
}

# doc link group
my $newest_doc_version = `dpkg -l 'postgresql-doc-[1-9]*' | sed -ne 's/^ii  postgresql-doc-\\([0-9.]*\\).*/\\1/p' | sort -g | tail -n 1`;
note "Newest PG doc version installed is $newest_doc_version";
SKIP: {
    skip "No SPI_connect.3.gz link group on 8.x", 3 if ($newest_doc_version < 9.0);
    chomp $newest_doc_version;
    program_ok 0, 'update-alternatives --list SPI_connect.3.gz', 0, 'SPI_connect.3.gz link group';
    for my $name (qw(SPI_connect SPI_exec)) {
        is readlink "/etc/alternatives/$name.3.gz", "/usr/share/postgresql/$newest_doc_version/man/man3/$name.3.gz", "$name.3.gz alternative";
    }
}

# vim: filetype=perl