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

2008-07-15 Thread Thomas Goirand
Don Armstrong wrote:
 The right way to do this is to test the SQL database itself if it
 needs to be updated. [Indeed, ideally the module itself would handle
 upgrading itself if it was running an earlier version.]
 
 
 Don Armstrong

Yes, mod_log_sql should be able to upgrade itself, we know that and this
has been discussed with the upstream maintainer. The only problem is
that the upstream is currently quite busy... with his first child! :)

Anyway, thanks for all the good remarks, I think the last one from Don
is the best answer (eg: check for the database format itself, and see if
it needs upgrade).

Thomas


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



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

2008-07-15 Thread Vincent Bernat
OoO En  ce doux début de matinée  du mardi 15 juillet  2008, vers 08:18,
Thomas Goirand [EMAIL PROTECTED] disait :

 Anyway, thanks for all the good remarks, I think the last one from Don
 is the best answer (eg: check for the database format itself, and see if
 it needs upgrade).

Another solution  is to use dbconfig-common.  You get for free  a lot of
things, including:
 - automatic upgrade of database (but it relies on package versions)
 - debconf questions already written (and already translated)
-- 
printk(ufs_read_super: fucking Sun blows me\n);
2.0.38 /usr/src/linux/fs/ufs/ufs_super.c


pgp09Fb4dOOMP.pgp
Description: PGP signature


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

2008-07-15 Thread Thomas Goirand
Vincent Bernat wrote:
 Another solution  is to use dbconfig-common.  You get for free  a lot of
 things, including:
  - automatic upgrade of database (but it relies on package versions)
  - debconf questions already written (and already translated)

Wrong. dbconfig-common is for apps, not for something like mod_log_sql
that you are supposed to configure yourself (with maybe a remote
database). More over, I didn't find any documentation that let you get
the root on MySQL. In a more general way, the documentation of
dbconfig-common is very poor, and it's maintainer (to my experience)
doesn't reply to emails...

My idea is just to check the local mysql apachelogs database, picking up
the root password from /etc/mysql/debian.cnf and nothing more, prompting
the user about it with debconf in a critical question, with default to
do nothing. Any other configuration (postgresql, dbi, etc.) can be
processed by hand, by the user. I wanted to test the version I'm
upgrading from to avoid to ask any question if it's not needed.

Thomas


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



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

2008-07-15 Thread Vincent Bernat
OoO Peu  avant le début de  l'après-midi du mardi 15  juillet 2008, vers
13:11, Thomas Goirand [EMAIL PROTECTED] disait :

 Another solution  is to use dbconfig-common.  You get for free  a lot of
 things, including:
 - automatic upgrade of database (but it relies on package versions)
 - debconf questions already written (and already translated)

 Wrong. dbconfig-common is for apps, not for something like mod_log_sql
 that you are supposed to configure yourself (with maybe a remote
 database).

There  is no  database schema?  dbconfig-common handles  remote database
without any problem.
-- 
I WILL NOT WASTE CHALK
I WILL NOT WASTE CHALK
I WILL NOT WASTE CHALK
-+- Bart Simpson on chalkboard in episode 7G02


pgpe8BvKlQTuA.pgp
Description: PGP signature


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

2008-07-14 Thread Thomas Goirand
Hi,

I want to make an update to libapache-mod-log-sql that needs some
maintenances in it's SQL databases if we need to upgrade. Namely, it
needs some table structure upgrades.

I know many hacks to know that I'm upgrading (like doing dpkg -l,
etc.), but what is the correct/policy way to know from what version my
package is upgrading, so my postinst can run smoothly?

Thomas Goirand


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



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

2008-07-14 Thread Eugene V. Lyubimkin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thomas Goirand wrote:
 Hi,
 
 I want to make an update to libapache-mod-log-sql that needs some
 maintenances in it's SQL databases if we need to upgrade. Namely, it
 needs some table structure upgrades.
 
 I know many hacks to know that I'm upgrading (like doing dpkg -l,
 etc.), but what is the correct/policy way to know from what version my
 package is upgrading, so my postinst can run smoothly?
 
 Thomas Goirand
 
 
IANADD.

Policy 6.6.3 says

If the package is being upgraded, call:

  new-preinst upgrade old-version

Is it what you are seeking?
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkh7TwEACgkQchorMMFUmYycHgCeL+5NcXoAwmX3Rgfaifk5Hk+g
JmsAoK0vZo2RIMjBOF+iyYkqGb3EezIR
=QZHh
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



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

2008-07-14 Thread Patrick Schoenfeld
Hi,

On Mon, Jul 14, 2008 at 04:05:05PM +0300, Eugene V. Lyubimkin wrote:
  I know many hacks to know that I'm upgrading (like doing dpkg -l,
  etc.), but what is the correct/policy way to know from what version my
  package is upgrading, so my postinst can run smoothly?
 Policy 6.6.3 says
 
 If the package is being upgraded, call:
 
   new-preinst upgrade old-version
 
 Is it what you are seeking?
 

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


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



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

2008-07-14 Thread Thomas Goirand
Eugene V. Lyubimkin wrote:
 IANADD.
 
 Policy 6.6.3 says
 
 If the package is being upgraded, call:
 
   new-preinst upgrade old-version
 
 Is it what you are seeking?

That wont give me the version number from which I'm upgrading from, will it?

Thomas


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



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

2008-07-14 Thread Thomas Goirand
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 ???

Thomas


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



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

2008-07-14 Thread Eugene V. Lyubimkin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Thomas Goirand wrote:
 Eugene V. Lyubimkin wrote:
 IANADD.

 Policy 6.6.3 says

 If the package is being upgraded, call:

   new-preinst upgrade old-version
 
 Is it what you are seeking?
 
 That wont give me the version number from which I'm upgrading from, will it?
 
 Thomas
 
 
old-version is the version which package is upgraded from, isn't it? :)

- --
Eugene V. Lyubimkin aka JackYF, Ukrainian C++ developer.
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIe6zrchorMMFUmYwRAtNTAKCS83jaPtzQ/c6KfYl1E2iSOpWF+ACfVWbg
jTCuGxhRiyZLH9zdGozsy4w=
=iBFG
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



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

2008-07-14 Thread Justin Pryzby
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


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



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

2008-07-14 Thread Don Armstrong
On Mon, 14 Jul 2008, Thomas Goirand wrote:
 I want to make an update to libapache-mod-log-sql that needs some
 maintenances in it's SQL databases if we need to upgrade. Namely, it
 needs some table structure upgrades.

The right way to do this is to test the SQL database itself if it
needs to be updated. [Indeed, ideally the module itself would handle
upgrading itself if it was running an earlier version.]


Don Armstrong

-- 
America was far better suited to be the World's Movie Star. The
world's tequila-addled pro-league bowler. The world's acerbic bi-polar
stand-up comedian. Anything but a somber and tedious nation of
socially responsible centurions.
 -- Bruce Sterling, _Distraction_ p122

http://www.donarmstrong.com  http://rzlab.ucr.edu


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]