[Debian-med-packaging] r13405 - trunk/packages/gnuhealth/trunk/debian

Emilien Klein emilien+debian at klein.st
Wed Apr 24 20:53:40 UTC 2013


Hey Andreas,

2013/4/24 Andreas Tille <andreas at an3as.eu>:
> Hi Emilien,
>
> when watching your commits I was wondering whether you know and have
> considered using dbconfig-common to approach this.

Yes, as you had recommended it in a previous email.

Updating the database can't be handled by dbconfig-common, as it needs
to be handled by Tryton directly (which loops over all installed
modules and makes sure the database are updated/created accordingly)

I couldn't find the right way using dbconfig-common to verify that a
PostgreSQL role existed (I found how to create or remove it, but not
just verify if it exists), so for now I'm using a bash command.
If you or any other team member know how to do that, I'd be glad to use it.

I'm now learning about debconf to prompt the user if the default
database wasn't used, since it will need to be manually updated.

Cheers,
    +Emilien

> Kind regards
>
>         Andreas.
>
> On Wed, Apr 24, 2013 at 07:55:20PM +0000, Emilien Klein wrote:
>> Author: e2jk-guest
>> Date: 2013-04-24 19:55:19 +0000 (Wed, 24 Apr 2013)
>> New Revision: 13405
>>
>> Modified:
>>    trunk/packages/gnuhealth/trunk/debian/postinst
>> Log:
>> Update the gnuhealth database, if both the PostgreSQL role and the gnuhealth database exist
>>
>>
>> Modified: trunk/packages/gnuhealth/trunk/debian/postinst
>> ===================================================================
>> --- trunk/packages/gnuhealth/trunk/debian/postinst    2013-04-24 19:47:47 UTC (rev 13404)
>> +++ trunk/packages/gnuhealth/trunk/debian/postinst    2013-04-24 19:55:19 UTC (rev 13405)
>> @@ -29,9 +29,9 @@
>>              # Check if the gnuhealth database exists
>>              db=`psql -U postgres -l 2>/dev/null | grep gnuhealth | wc -l`
>>              if [ $db -eq 1 ]; then
>> -                echo "exists"
>>                  # Update the gnuhealth database
>> -                #trytond --database=gnuhealth --update=all
>> +                echo "Updating the gnuhealth database"
>> +                trytond --database=gnuhealth --update=all
>>              else
>>                  echo "doesn't exist"
>>                  # The user has probably set up it's own database, prompt her
>>
>>
>> _______________________________________________
>> debian-med-commit mailing list
>> debian-med-commit at lists.alioth.debian.org
>> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-med-commit
>>
>
> --
> http://fam-tille.de



More information about the Debian-med-packaging mailing list