#15 Only run postun for headless package if package is being removed (BZ 1200302)
Closed 5 years ago by jerboaa. Opened 5 years ago by jgu.
Unknown source master  into  master

file modified
+10 -5
@@ -368,10 +368,12 @@

  

  

  %define postun_headless() %{expand:

-   alternatives --remove java %{jrebindir -- %{?1}}/java

-   alternatives --remove jre_%{origin} %{_jvmdir}/%{jredir -- %{?1}}

-   alternatives --remove jre_%{javaver} %{_jvmdir}/%{jredir -- %{?1}}

-   alternatives --remove jre_%{javaver}_%{origin} %{_jvmdir}/%{jrelnk -- %{?1}}

+ if [ $1 -eq 0 ] ; then

+     alternatives --remove java %{jrebindir -- %{?1}}/java

+     alternatives --remove jre_%{origin} %{_jvmdir}/%{jredir -- %{?1}}

+     alternatives --remove jre_%{javaver} %{_jvmdir}/%{jredir -- %{?1}}

+     alternatives --remove jre_%{javaver}_%{origin} %{_jvmdir}/%{jrelnk -- %{?1}}

+ fi

  }

  

  %define posttrans_script() %{expand:
@@ -961,7 +963,7 @@

  

  Name:    java-%{javaver}-%{origin}

  Version: %{javaver}.%{updatever}.%{buildver}

- Release: 7%{?dist}

+ Release: 8%{?dist}

  # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons

  # and this change was brought into RHEL-4. java-1.5.0-ibm packages

  # also included the epoch in their virtual provides. This created a
@@ -2296,6 +2298,9 @@

  %endif

  

  %changelog

+ * Sat Aug 25 2018 Jonathan Underwood <jonathan.underwood@gmail.com> - 1:1.8.0.181.b13-8

+ - Only run postun for headless package if package is being removed (BZ 1200302)

+ 

  * Wed Aug 01 2018 Jiri Vanek <jvanek@redhat.com> - 1:1.8.0.181.b13-7

  - build number moved from release to version

  

I think this should fix BZ 1200302.

rebased onto 2766319

5 years ago

Thanks for the PR. We need to perform some extensive testing on this before we can merge. @jvanek is the domain expert on how this works exactly.

FWIW, the build failures of simple-koji-ci are due to this bug:
https://bugzilla.redhat.com/show_bug.cgi?id=1622186

Thanks. Note that the other postun scripts should also have a $1 == 0 guarding conditional too, but I wanted to keep the first PR simple.

Yeh. This hunk was originally here for non-paralle-installable packages. It had to be removed. Tbh I do not remember exactly why. It is some 5 years ago. I guess that one paralle installation remoed alternatives of another one. BUt this is long time ago; Both packlages and alternatvies evolved.

A lot of testing will be done with this pull request. to se eif my concerns are still valid.

Tyvm for digging those stalled waters!

We need to keep the remove unconditionally, since this would otherwise break upgrades of packages. See https://bugzilla.redhat.com/show_bug.cgi?id=1200302#c57. It might be possible, though to update the path or the main alternative in case $1 != 0. I'll do some experiments.

Pull-Request has been closed by jerboaa

5 years ago