Gentoo Archives: gentoo-dev

From: "Bo Ørsted Andresen" <bo.andresen@××××.dk>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] portage idea - auto embed user patches
Date: Thu, 21 Dec 2006 19:03:01
Message-Id: 200612212000.04085.bo.andresen@zlin.dk
In Reply to: [gentoo-dev] portage idea - auto embed user patches by Alexander Zubkov
1 On Thursday 21 December 2006 15:32, Alexander Zubkov wrote:
2 > I have some idea on extending portage building system (ebuild?).
3 > Sometimes I'm (for example) want to apply custom patch to some package.
4 > This patch can do something unusual, that can not be accepted by
5 > maintainers and I know this. But I like features in my patch and want it
6 > to apply automatically when updating the package. Not to do it like this:
7 > $ ebuild /usr/portage/pkg-categoty/some-package/some-package-1.0 unpack
8 > $ cd /var/tmp/portage/pkg-categoty/some-package/work/...
9 > $ patch -p1 < ~/my-patch-for-some-package
10 > $ cd
11 > $ ebuild /usr/portage/pkg-categoty/some-package/some-package-1.0 merge
12 >
13 > It is lot of manual work. The idea is having an file, for example
14 > /etc/portage/package.patch with contents like this:
15 > =pkg-category/some-package-1* /path/to/my-patch-for-some-package
16 >
17 > Of course, patches could fail in newer versions. But when I'll use that
18 > feature - I'll understand why it can be and it'll be more convenient to
19 > maintain it.
20
21 You can also use the post_src_unpack() user hook and the profile.bashrc in the
22 base profile for this. E.g.:
23
24 # mkdir -p /etc/portage/env/$category
25 # cat << END > /etc/portage/env/$category/$name
26 post_src_unpack() {
27 epatch foo.patch
28 }
29 END
30
31 --
32 Bo Andresen