1 |
On Fri, Oct 29, 2010 at 21:18, Alan McKinnon <alan.mckinnon@×××××.com> wrote: |
2 |
> Apparently, though unproven, at 18:46 on Friday 29 October 2010, Fatih Tümen |
3 |
> did opine thusly: |
4 |
> |
5 |
>> Hi, |
6 |
>> |
7 |
>> Is there a way tell portage to build binary package before removing it |
8 |
>> from the system? |
9 |
>> |
10 |
>> man emerge says: |
11 |
>> --buildpkg (-b) |
12 |
>> Tells emerge to build binary packages for all ebuilds |
13 |
>> processed in addition to actually **merging** the packages. |
14 |
>> [...] |
15 |
>> An alternative for already-merged packages is to use |
16 |
>> quickpkg(1) which creates a tbz2 from the live filesystem. |
17 |
>> |
18 |
>> I have about 20 packages to unmerge or remerge with new use flags. But |
19 |
>> I want to keep binary copies (with old use settings) before unmerging |
20 |
>> them. Unfortunately I did not have buildpkg in FEATURES at the time of |
21 |
>> emerging them. Doing this now by hand sounds kinda fatigue unless... |
22 |
>> the output of --pretend was parsable so I do what I want by.. |
23 |
>> |
24 |
>> for pkg in ${PKGS}; do quickpkg --include-config\=y $pkg; done |
25 |
>> |
26 |
>> or by something better? |
27 |
>> |
28 |
>> Thanks for ideas in advance. |
29 |
>> -- |
30 |
>> Fatih |
31 |
> |
32 |
> |
33 |
> Write a wrapper script around quickpkg and emerge. |
34 |
> |
35 |
> And set buildpkg in FEATURES so this doesn't happen again :-) |
36 |
|
37 |
|
38 |
'wrapper' rang the bell. Thanks. |
39 |
|
40 |
The only one I recalled was post_src_install from lafilefixer thing. |
41 |
So I grepped /usr/lib/portage/ for it and found the list of others at |
42 |
/usr/lib/portage/bin/isolated-functions.sh +521 and wrote this inside |
43 |
/etc/portage/bashrc |
44 |
|
45 |
pkg_prerm() { |
46 |
echo ">>> Building binary package before unmerging ;)" |
47 |
if [[ -f /var/db/.pkg.portage_lockfile ]]; then |
48 |
rm -f /var/db/.pkg.portage_lockfile #2>/dev/null |
49 |
fi |
50 |
quickpkg --include-config\=y "=$CATEGORY/$P" |
51 |
touch /var/db/.pkg.portage_lockfile |
52 |
} |
53 |
|
54 |
Voila! :) |
55 |
|
56 |
-- |
57 |
Fatih |