1 |
Have you read the developer docs? |
2 |
|
3 |
Emerge is working exactly as it is supposed to. When you |
4 |
emerge a package, it is first installed into an "image" |
5 |
directory under /var/tmp/portage. Only if this install |
6 |
proceeds without error does portage then merge this |
7 |
image into the actual system, i.e. the "real" dirs. |
8 |
|
9 |
It is up to the ebuild writer to make sure that the |
10 |
respects this. If an ebuild tries to install anything |
11 |
outside of the image directory, it will cause an access |
12 |
violation like the one you saw. Portage sandboxes ebuilds |
13 |
so that even though you are running as root, nothing can |
14 |
be changed outside of the image dir until the final "merge" |
15 |
step. This keeps broken ebuilds from fscking up your system. |
16 |
|
17 |
Read the developer docs thoroughly, and check out |
18 |
/usr/lib/portage/bin/ebuild.sh for the gritty details. |
19 |
|
20 |
Ryan |
21 |
|
22 |
On Wed, 2002-06-05 at 20:20, Dan Naumov wrote: |
23 |
> Hello. |
24 |
> |
25 |
> I decided to do an ebuild for "WebDownloader for X" and ran into a bizarre permission problem when the compiled package is being installed. For reference, here's the .ebuild itself: |
26 |
> |
27 |
> ===================================================================== |
28 |
> # Copyright 1999-2002 Gentoo Technologies, Inc. |
29 |
> # Distributed under the terms of the GNU General Public License v2 |
30 |
> # $Header: $ |
31 |
> |
32 |
> DESCRIPTION="A GUI program for downloading files using FTP/HTTP." |
33 |
> |
34 |
> NAME="d4x" |
35 |
> |
36 |
> SRC_URI="http://www.krasu.ru/soft/chuchelo/files/${NAME}-${PV}.tar.gz |
37 |
> ftp://ftp.chg.ru/pub/X11/applications/${NAME}-${PV}.tar.gz" |
38 |
> HOMEPAGE="http://www.krasu.ru/soft/chuchelo/" |
39 |
> |
40 |
> LICENSE="Artistic" |
41 |
> |
42 |
> DEPEND="=dev-libs/glib-1.2* |
43 |
> =x11-libs/gtk+-1.2* |
44 |
> nls? ( sys-devel/gettext )" |
45 |
> |
46 |
> S=${WORKDIR}/${NAME}-${PV} |
47 |
> |
48 |
> src_compile() { |
49 |
> |
50 |
> local myconf |
51 |
> use nls || myconf="--disable-nls" |
52 |
> use oss || myconf="${myconf} --disable-oss" |
53 |
> use esd || myconf="${myconf} --disable-esd" |
54 |
> |
55 |
> ./configure ${myconf} \ |
56 |
> --prefix=/usr \ |
57 |
> --datadir=/usr/share \ |
58 |
> --infodir=/usr/share/info \ |
59 |
> --mandir=/usr/share/man \ |
60 |
> --enable-release || die "./configure failed" |
61 |
> |
62 |
> emake || die |
63 |
> |
64 |
> } |
65 |
> |
66 |
> src_install () { |
67 |
> |
68 |
> make DESTDIR=${D} install || die "install failed" |
69 |
> |
70 |
> dodoc AUTHORS COPYING ChangeLog NEWS PLANS README TODO |
71 |
> |
72 |
> } |
73 |
> ===================================================================== |
74 |
> |
75 |
> The package compiles without errors, but during the installation, it aborts with the following error: |
76 |
> |
77 |
> ===================================================================== |
78 |
> /bin/sh ../admin/mkinstalldirs /usr/share/d4x |
79 |
> mkdir /usr/share/d4x |
80 |
> ACCESS DENIED mkdir: /usr/share/d4x |
81 |
> mkdir: cannot create directory `/usr/share/d4x': Permission denied |
82 |
> make[2]: *** [install-data-local] Error 1 |
83 |
> make[2]: Leaving directory `/var/tmp/portage/webdownloader-2.0/work/d4x-2.0/share' |
84 |
> make[1]: *** [install-am] Error 2 |
85 |
> make[1]: Leaving directory `/var/tmp/portage/webdownloader-2.0/work/d4x-2.0/share' |
86 |
> make: *** [install-recursive] Error 1 |
87 |
> |
88 |
> !!! ERROR: The ebuild did not complete successfully. |
89 |
> !!! Function src_install, Line 2, Exitcode 2 |
90 |
> !!! install failed |
91 |
> |
92 |
> --------------------------- ACCESS VIOLATION SUMMARY --------------------------- |
93 |
> LOG FILE = "/tmp/sandbox-webdownloader-2.0-7385.log" |
94 |
> |
95 |
> mkdir: /usr/share/d4x |
96 |
> -------------------------------------------------------------------------------- |
97 |
> !!! emerge aborting on /usr/portage/net-misc/webdownloader/webdownloader-2.0.ebuild . |
98 |
> ===================================================================== |
99 |
> |
100 |
> I can see that other packages have their subdirectories under /usr/share and that /usr/share itself is drwxr-xr-x and owned by root. I am (obviously) running emerge as root and for the life of me cannot figure out what prevents the ebuild from installing the package completely, any ideas ? |
101 |
> |
102 |
> Sincerely, |
103 |
> Dan Naumov |
104 |
> _______________________________________________ |
105 |
> gentoo-dev mailing list |
106 |
> gentoo-dev@g.o |
107 |
> http://lists.gentoo.org/mailman/listinfo/gentoo-dev |