You are not logged in.

#1 2015-11-08 04:54:27

spradlim
Member
Registered: 2015-11-08
Posts: 2

PKGBUILD how much

How much should the PKGBUILD script and the PKG.install script do for the user.

For example, my package depends on mysql and needs to create a database and tables.  Should the post_install take care of this or should I force the user to do it.

If I take care of it what is the standard practice if someone removes my package? Should I drop the database?
If I leave the database when installing next time I am in a bit of unknown state and would like to error.   It doesn't seem like post_install can revert.

Thanks.

Offline

#2 2015-11-08 11:58:53

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,855
Website

Re: PKGBUILD how much

Add a message to the post_install scriptlet telling them what they need to do to set up the database. Likewise, remind the user that they will need to clean up the database by themselves after removing the package by putting a message in post_remove.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2015-11-08 12:27:10

progandy
Member
Registered: 2012-05-17
Posts: 5,192

Re: PKGBUILD how much

Instead of describing the exact database tables required in post_install, you can add the database layout as an SQL file below /usr/shared/doc/, you can also add a small database creation script as an example.

Last edited by progandy (2015-11-08 12:27:51)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2015-11-08 14:47:18

spradlim
Member
Registered: 2015-11-08
Posts: 2

Re: PKGBUILD how much

Thanks,

Yep, I was never going to list the tables.  There is three commands that a user must run that creates the databases.  Or I may just print a llink to the bareos documentation that describes what to do.

http://doc.bareos.org/master/html/bareo … l#QQ2-1-42

Thanks.

Offline

Board footer

Powered by FluxBB