packetfence icon indicating copy to clipboard operation
packetfence copied to clipboard

Apply custom patch on installation after a package upgrade

Open nqb opened this issue 3 years ago • 4 comments

Is your feature request related to a problem? Please describe. If you apply a custom patch on an installation (for example in a Golang binary) and you install latest maintenance patches, you will loose your changes.

Describe the solution you'd like Add a mechanism to re-apply custom patches after package upgrades.

Additional context The best option I see is to rely on package managers to run some post-installation tasks. Patches can be put in a dedicated directory and package manager will have to apply each of them (in a specific order).

I'm not sure how we can handle that when we are doing a minor upgrade (X.X.X to X.Y.Y). In that case, I don't think it make sense to apply custom patches because code will have changed.

nqb avatar Nov 09 '21 07:11 nqb

IMO we shouldn't be officially supporting custom code in our codebase/packaging

Not because its hard to do or manage, but because its hard to support for the team

That's it for my 2 cents :)

julsemaan avatar Nov 09 '21 12:11 julsemaan

I agree with @julsemaan on this. I believe it will be hard to manage the edge cases.

jrouzierinverse avatar Nov 09 '21 14:11 jrouzierinverse

I discussed with @fdurand about this topic. The way I see this feature is just to provide a way to apply automatically custom patches during post-installation of maintenance packages. For example, using a basic loop with git apply on a list of patches in a dedicated directory.

Since v11 and new maintenance management, if you have custom code somwhere, this one is completely overwritten. That was not exactly the case with pf-maint.pl.

nqb avatar Nov 18 '21 06:11 nqb

It was the case with the Golang binaries and the admin interface which are taking more and more place in our codebase

IMO, custom should stay custom and should be avoided as much as we can by users, customers and especially us

Not that it can't exist, but it shouldn't be something our codebase/packaging attempts to support and in which we put efforts in

julsemaan avatar Nov 22 '21 12:11 julsemaan