1 |
On Sun, 2002-06-02 at 15:22, Per Wigren wrote: |
2 |
> I'm making an ebuild for BitTorrent which is a P2P "download-helper".. If |
3 |
> clicking a link in a browser that has "content-type: |
4 |
> application/x-bittorrent", the download will be handled by BitTorrent |
5 |
> instead, and the download will be distributed among everyone who is |
6 |
> downloading the same file at the time, so it doesn't load the server... |
7 |
> |
8 |
> The problem is that I have to make the ebuild add a line to /etc/mailcap.. Is |
9 |
> there a standard way to do this? |
10 |
> |
11 |
|
12 |
Havent really done this, but try something like: |
13 |
|
14 |
src_install() { |
15 |
# if the user have a mailcap, and it do not |
16 |
# have the entry added, put his copy into ${D}/etc |
17 |
if [ -f ${ROOT}/etc/mailcap ] |
18 |
then |
19 |
insinto /etc |
20 |
# install the users real mailcap into ${D} |
21 |
doins ${ROOT}/etc/mailcap |
22 |
else |
23 |
touch ${D}/etc/mailcap |
24 |
fi |
25 |
|
26 |
# now add the entry if not already there |
27 |
if [ -z "$(grep x-bittorrent ${D}/etc/mailcap)" ] |
28 |
then |
29 |
# add the needed line |
30 |
echo "application/x-bittorrent...." >> \ |
31 |
${D}/etc/mailcap |
32 |
fi |
33 |
} |
34 |
|
35 |
|
36 |
Greetings, |
37 |
|
38 |
-- |
39 |
|
40 |
Martin Schlemmer |
41 |
Gentoo Linux Developer, Desktop Team Developer |
42 |
Cape Town, South Africa |