From 2fc9076281ec129c07e48d6c63b64cc32aac75e595c82793a6991742d144648e Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Mon, 21 Mar 2022 10:32:34 +0000 Subject: [PATCH] Fix number check of test (builtin) in %pre scriptlet (boo#1197317) OBS-URL: https://build.opensuse.org/package/show/server:mail/mailx?expand=0&rev=71 --- mailx.changes | 5 +++++ mailx.spec | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/mailx.changes b/mailx.changes index 3b82cbd..1d4699d 100644 --- a/mailx.changes +++ b/mailx.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Mar 21 10:31:05 UTC 2022 - Dr. Werner Fink + +- Fix number check of test (builtin) in %pre scriptlet (boo#1197317) + ------------------------------------------------------------------- Thu Feb 17 21:22:49 UTC 2022 - Stefan Schubert diff --git a/mailx.spec b/mailx.spec index e96098d..14ac146 100644 --- a/mailx.spec +++ b/mailx.spec @@ -114,7 +114,7 @@ minor enhancements like the ability to set a "From:" address. rm -rf %{buildroot}/bin mkdir %{buildroot}/bin %if ! %{with libalternatives} - # create symlinks for update-alternatives + # create symlinks for update-alternatives mkdir -p %{buildroot}%{_sysconfdir}/alternatives %if !0%{?usrmerged} ln -sf %{_sysconfdir}/alternatives/binmail %{buildroot}/bin/mail @@ -152,11 +152,11 @@ binary=%{_bindir}/mailx man=mailx.1 group=mail, Mail EOF -%endif +%endif install -m 0644 mail.rc %{buildroot}/etc mkdir -p %{buildroot}%{_defaultdocdir}/%{name} -%if ! %{with libalternatives} +%if ! %{with libalternatives} %post %{_sbindir}/update-alternatives --quiet --force \ --install %{_bindir}/mail mail %{_bindir}/mailx 20 \ @@ -172,10 +172,11 @@ if test ! -e %{_bindir}/mailx; then %{_sbindir}/update-alternatives --quiet --force --remove mail %{_bindir}/mailx fi %else + %pre # removing old update-alternatives entries -if [ "$1" > 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then - %{_sbindir}/update-alternatives --quiet --force --remove mail %{_bindir}/mailx +if [ "$1" -gt 0 ] && [ -f %{_sbindir}/update-alternatives ] ; then + %{_sbindir}/update-alternatives --quiet --force --remove mail %{_bindir}/mailx fi %endif