[Gambas-user] Pre-/Post-install scripts

BB adamnt42 at gmail.com
Wed Jan 18 10:25:48 CET 2023


On 11/1/23 6:31 am, T Lee Davidson wrote:
> On 1/6/23 09:09, Benoit Minisini wrote:
> > Le 06/01/2023 à 14:24, T Lee Davidson a écrit :
> >>
> >> (Side note: I think it would be quite useful to have pre- and post- 
> install shell script options for packaging.)
> >>
> >
> > This must be done for Rpm, Deb, ArchLinux and Slackware packages 
> then. Is it possible? Any volunteer?
> >
>
> There seems to be no exact common denominator between those four 
> systems in regards to pre-/post-install commands/scripts.
>
> It appears that ArchLinux supports only post-install commands which 
> the rest also do. However, RPMs support only commands contained in 
> "scriptlets" which are multi-line strings embedded in the SPEC file, 
> while the others support inclusion of actual shell script files.
>
> So, providing for post-install commands is possible. But, the Make 
> Installation Package Wizard would have to either:
> 1) accept the commands as text (for RPMs) and then prepend the shebang 
> line (#!/usr/bin/sh) to create a real script file (for the others), or
> 2) accept the commands as an additional file (identified as a 
> post-install script) and then, for RPMs, strip the shebang line if it 
> exists.
>
> It's probably no matter either way at the moment, as I do not have the 
> time to tackle it. I just wanted to report back in case anyone else 
> has interest and time.
>
>
It would seem to me that this is something that could be implemented at 
the wizard level, rather than inside the actual packager concerned. In 
that, I mean that the pre- and post- processing of the project packaging 
are one thing and pre- and post- processing of the whole packaging 
mechanism are slightly different things. It is quite important that the 
internal packaging process, i.e. the stuff inside the repo specific 
packaging code, should not be "normally" disturbed unless there is 
something specific that could be needed for that apparatus. However, 
there is nothing wrong with adding some value in the case of 
post-processing at the wizard level to allow the developer to do some 
stuff with the result.

Who knows, maybe generating some documentation, adding to a log file, 
publishing the generated package somewhere, playing a piece of music etc 
etc.

As long as it is intended to operate outside of the internal packaging 
code then I think this may be possible.

Or maybe I have misunderstood the original use-case?

I am looking at "the usual suspect"s code for the compile post-op 
options with the hope that it could be adapted.

Any thoughts

b



More information about the User mailing list