[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to detect an upgrade from an older version of a package



On Tue, Jul 15, 2008 at 03:26:53AM +0800, Thomas Goirand wrote:
> Patrick Schoenfeld wrote:
> > Additional (might be more to his interest, because he talked about his
> > postinst) it says:
> > 
> > "
> > postinst configure most-recently-configured-version
> > "
> > 
> > If a package is upgraded the most-recently-configured-version is usually
> > identical to old-version. It isn't if the configuration of the package
> > already took place but the installation hasn't finished (half-installed
> > state). That is as far as I understand it. Anyways using $2 as
> > oldversion worked for me in every case so far.
> > 
> > Regards,
> > Patrick
> 
> In fact, I was being stupid in my question, so I'm asking again.
> 
> I think it's best option for me to know from what version I'm upgrading
> from at the configure stage, so I can prompt a nice debconf dialog and ask:
> 
> "Do you want libapache2-mod-log-sql-mysql to upgrade your apachelogs
> database tables?"
> 
> I think it's best this way, right? Then, how do I know that I'm
> upgrading from version < 1.101 and that the upgraded is needed ???
Read /var/lib/dpkg/info/dpkg.postinst, which, when called with $1 =
"configure", also is passed the most-recently configure version, if
any, in $2.

justin


Reply to: