You are not logged in.

#1 2011-01-15 00:31:45

Piotr
Banned
Registered: 2010-10-04
Posts: 125

localpatch - patch package without modifing ebuild.

Let me introduce 'localpatch' portage's feature (upcomming).

Basically, from now on you will be able add your extra patches to packages without editing ebuild.

if 'localpatch' is present in FEATURES variable, portage will run localpatch function on the beginning of src_prepare function.

Default source for patches is /etc/portage/patches, can be changed by LOCALPATCH_OVERLAY variable.

First, localpatch will check if ${LOCALPATCH_OVERLAY}/${CATEGORY}/${PN}-${PV}-${PR} exist, if not, then it will check if ${LOCALPATCH_OVERLAY}/${CATEGORY}/${PN}-${PV} exist and on the end it will check for ${LOCALPATCH_OVERLAY}/${CATEGORY}/${PN} and set it as source.

Next localpatch will search for all *.patch and *.diff files there, recursively, so you can have there subdirs like bugfixes, features, whatever.

After it, localpatch will sort patches by `sort -n`, so best would be prefix patches with numbers if they have to be applied in right order.

Example:
We want patch www-servers/nginx with 01_bugfix.patch and www-servers/nginx-1.0-r1 with 01_new_feature.patch, all what we have to do is create /etc/portage/patches/www-servers/nginx and put ther 01_bugfix.patch and create /etc/portage/patches/www-servers/nginx-1.0-r1 and put there 01_new_features.patch. With it if we emerge nginx-1.0-r1 it will apply only 01_new_feature.patch, but if we emerge any other www-server/nginx version, it will apply only content of /etc/portage/patches/www-servers/nginx.

Any ideas, comments?


Work smart not hard.

Offline

#2 2011-01-28 14:13:10

404_Error
Core Team Member
From: Quebec city, Quebec, Canada
Registered: 2010-10-08
Posts: 458

Re: localpatch - patch package without modifing ebuild.

Very nice feature, gain of productivity.

Offline

#3 2012-07-21 17:29:12

PaddyMac
Member
From: Alabama, USA
Registered: 2011-08-20
Posts: 110

Re: localpatch - patch package without modifing ebuild.

I only recently discovered/became interested in this feature recently, and I have been trying it out. Is there a way to have better control over which versions of a package a patch is applied to? For example, the current 3.4 ck patch can be applied to all 3.4.x versions of the kernel sources. Will I have to put a copy of the patch in /etc/portage/patches/sys-kernel/gentoo-sources-3.4.4/, /etc/portage/patches/sys-kernel/gentoo-sources-3.4.5/, /etc/portage/patches/sys-kernel/gentoo-sources-3.4.6/ for every time I upgrade the kernel, or is there a single location I can place the patch in so it is automatically applied to every 3.4.x version of gentoo-sources without it being applied to say 3.5.x versions?

Offline

#4 2012-07-21 18:50:25

sitquietly
Member
Registered: 2012-07-14
Posts: 30

Re: localpatch - patch package without modifing ebuild.

Piotr wrote:

Let me introduce 'localpatch' portage's feature.....
Any ideas, comments?

Sweet!

Offline

Board footer

Powered by FluxBB