You are not logged in.

#1 2023-11-19 20:23:16

blero
Member
From: New York
Registered: 2023-08-29
Posts: 18

Optimal place to print post-install message

I am updating a PKGBUILD which I also plan to add a message about a recommended configuration (namely, using system python instead of integrated). Is the best way really to bundle a whole .install script just to put an echo inside the post_install() function? Or should I put the echo inside package()?


Cheers,
Aᴀʀᴏɴ

Offline

#2 2023-11-19 20:42:01

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,548
Website

Re: Optimal place to print post-install message

If you want the message to be echoed after a package is installed, that's precisely what post_install is for.  If you put an echo command in package(), it will - as the name of the function implies - only print out when the software is packaged ... not when built packages are installed.

Facetiousness aside: this question only comes from an assumption that others will build/install in one fell swoop (i.e., use makepkg -i).  That is neither a safe assumption, or one that should be made in writing PKGBUILDs.

Last edited by Trilby (2023-11-19 20:43:04)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2023-11-19 20:42:54

blero
Member
From: New York
Registered: 2023-08-29
Posts: 18

Re: Optimal place to print post-install message

Do I need to package in a separate .install file just for the post_install function?


Cheers,
Aᴀʀᴏɴ

Offline

#4 2023-11-19 20:43:55

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,548
Website

Re: Optimal place to print post-install message

Yes.  This file is bundled with the package itself and will be sourced by pacman later.  It is not sourced by makepkg.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2023-11-19 20:44:43

blero
Member
From: New York
Registered: 2023-08-29
Posts: 18

Re: Optimal place to print post-install message

Ah, that makes a lot of sense. Thanks.


Cheers,
Aᴀʀᴏɴ

Offline

Board footer

Powered by FluxBB