Re: BUG #7823: PGDG packaged pgadmin3_92 removes its /usr/bin/pgadmin3 link

From: Georgi Georgiev <georgi-georgiev-pgsql(at)japannext(dot)co(dot)jp>
To: Devrim GÜNDÜZ <devrim(at)gunduz(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #7823: PGDG packaged pgadmin3_92 removes its /usr/bin/pgadmin3 link
Date: 2013-02-03 04:36:54
Message-ID: 20130203043654.GF14929@jnext-0060.corp.japannext.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Quoting Georgi Georgiev at 03/02/2013-13:19:52(+0900):
> Quoting Georgi Georgiev at 24/01/2013-12:55:31(+0900):
> > Quoting Devrim GÜNDÜZ at 23/01/2013-21:11:09(+0200):
> ...
> > >
> > > Should be fixed with 1.16.1-2. Please check.
> >
> > Thanks for the quick turnaround. But there seems to be a typo now, so
> > the %post is not working:
> ....
>
> 1.16.1-3 does not throw errors, but it still reliably wipes out the
> symlink on an upgrade. A fresh install or a reinstall would create the
> symlink, but that is only because the %preun does not run in that case
> (there is no old version to "uninstall" in this case).
>
> This can be fixed with a 'if [ "$1" = 0 ]; then' in the %preun.
>
> To test all these cases, I used rpmrebuild to create different releases of this
> package.
>
> I made a "-2.5" which is identical to -3.
> And I made a "-2.8" with the %preun modified like this:
>
> $ rpm -q pgadmin3_92-1.16.1-2.8.rhel6.x86_64 --scripts
> postinstall scriptlet (using /bin/sh):
> /usr/sbin/update-alternatives --install /usr/bin/pgadmin3 pgadmin3 /usr/pgsql-9.2/bin/pgadmin3 920
> preuninstall scriptlet (using /bin/sh):
> if [ "$1" = 0 ]; then
> /usr/sbin/update-alternatives --remove pgadmin3 /usr/pgsql-9.2/bin/pgadmin3
> fi
>
> Test results:
>
> - Upgrade from 2.5 - symlink missing (wrong)
> - Upgrade from 2.8 - symlink present (correct)
> - Fresh install of any version - symlink present (correct)
> - Uninstall any version - symlink missing (correct)
>
> So, please, if you can fix the %preun as above, that should solve all pending
> issues.

By the way, I see that the postgresql92 packages do the
"update-alternatives" cleanup in "%postun". I am not sure why
pgadmin3_92 does it in "%preun", nor does it seem to make much of a
difference, but it may be a good idea to consistently do it in the same
scriptlet - either %preun or %postun.

--
( Georgi Georgiev ( Despite all appearances, your boss is a (
) Sysadmin Head ) thinking, feeling, human being. )
( -SBI Japannext- ( (

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Dean Rasheed 2013-02-03 09:16:51 Re: postgres 9.2.2 point conversion from polygon doesn't always give accurate center
Previous Message Georgi Georgiev 2013-02-03 04:19:52 Re: BUG #7823: PGDG packaged pgadmin3_92 removes its /usr/bin/pgadmin3 link