10216 adding check on pre to skip install if not Thread::Semaphore >= 2.13

This commit is contained in:
rafael 2023-02-15 10:36:49 +01:00
parent afad252a5c
commit 368f5499a5
2 changed files with 23 additions and 1 deletions

View File

@ -109,6 +109,12 @@ rm -fr $RPM_BUILD_ROOT
getent passwd pandora >/dev/null || \
/usr/sbin/useradd -d %{prefix}/pandora_server -s /sbin/nologin -M -g 0 pandora
current_ver=$(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null | cut -d '.' -f 2)
if [ $((current_ver)) -lt 13 ] ; then
echo 'perl Thread::Semaphore should be installed on the system and shold be ver >= 2.13 '
exit 1
fi
exit 0
%post
@ -176,6 +182,12 @@ if [ "$1" = "1" ]; then
exit 0
fi
current_ver=$(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null | cut -d '.' -f 2)
if [ $((current_ver)) -lt 13 ] ; then
echo 'perl Thread::Semaphore should be installed on the system and shold be ver >= 2.13 '
exit 1
fi
/sbin/service pandora_server stop >/dev/null 2>&1 || :
/sbin/service tentacle_serverd stop >/dev/null 2>&1 || :
/sbin/chkconfig --del pandora_server

View File

@ -100,7 +100,11 @@ if [ "`id pandora | grep uid | wc -l`" = 0 ]
then
/usr/sbin/useradd -d %{prefix}/pandora -s /bin/false -M -g 0 pandora
fi
exit 0
current_ver=$(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null | cut -d '.' -f 2)
if [ $((current_ver)) -lt 13 ] ; then
echo 'perl Thread::Semaphore should be installed on the system and shold be ver >= 2.13 '
exit 1
fi
%post
if [ `command -v systemctl` ];
@ -172,6 +176,12 @@ if [ "$1" = "1" ]; then
exit 0
fi
current_ver=$(perl -le 'eval "require $ARGV[0]" and print $ARGV[0]->VERSION' Thread::Semaphore 2> /dev/null | cut -d '.' -f 2)
if [ $((current_ver)) -lt 13 ] ; then
echo 'perl Thread::Semaphore should be installed on the system and shold be ver >= 2.13 '
exit 1
fi
/etc/init.d/pandora_server stop &>/dev/null
/etc/init.d/tentacle_serverd stop &>/dev/null
chkconfig --del pandora_server