Gentoo Archives: gentoo-science

From: "François Bissey" <frp.bissey@×××××.com>
To: gentoo-science@l.g.o
Subject: Re: [gentoo-science] tip for installing files from tarballs
Date: Mon, 08 Feb 2021 23:05:45
Message-Id: BB57500C-E051-4714-B544-68A2F3A41004@gmail.com
In Reply to: Re: [gentoo-science] tip for installing files from tarballs by "François Bissey"
1 Just for the record so that some root cause of the issue are more clear.
2 From “man tar”
3 --no-same-owner
4 Extract files as yourself (default for ordinary users).
5
6
7 --same-owner
8 Try extracting files with the same ownership as exists in the archive (default for superuser).
9
10 ======
11
12 So, by default, when you emerge with root, tar will try to preserve ownership
13 as stated inside the tarball. I was hoping that inserting “—no-same-owner”
14 in the tar command would changes things a little bit. But for some reasons
15 it didn’t have any effect when I inserted it inside the makefile.
16
17 > On 9/02/2021, at 11:55, François Bissey <frp.bissey@×××××.com> wrote:
18 >
19 > Nope, just plain emerge as root.
20 >
21 >> On 9/02/2021, at 11:55, Aisha Tammy <gentoo.science@×××××.cc> wrote:
22 >>
23 >> Are you installing/building with the ebuild command and then merging with sudo or
24 >> something similar?
25 >> That may be one reason something like this is happening.
26 >>
27 >> On 2/8/21 5:28 PM, François Bissey wrote:
28 >>> Hi all,
29 >>>
30 >>> I discovered an issue in a couple of packages for which sage-on-gentoo
31 >>> provides ebuilds.
32 >>> Some packages install data directly from a tar command. By that I mean
33 >>> Makefile.am will a line like
34 >>> cd $(DESTDIR)$(dbdir) && tar xf $(dist_db_DATA) && rm $(dist_db_DATA)
35 >>>
36 >>> From a real Makefile at
37 >>> https://github.com/sagemath/p_group_cohomology/blob/master/present/Makefile.am
38 >>>
39 >>> I looks innocuous until you realise it has some funny effects on ownership.
40 >>> fbissey@moonloop ~ $ ll /usr/share/pGroupCohomology/
41 >>> total 1.1M
42 >>> drwxr-xr-x 270 root root 12K Feb 3 21:55 .
43 >>> drwxr-xr-x 319 root root 12K Feb 3 21:55 ..
44 >>> drwxr-xr-x 3 fbissey fbissey 4.0K Feb 9 10:46 64gp1
45 >>> drwxr-xr-x 4 fbissey fbissey 4.0K Feb 9 10:46 64gp10
46 >>> drwxr-xr-x 4 fbissey fbissey 4.0K Feb 9 10:46 64gp100
47 >>> drwxr-xr-x 4 fbissey fbissey 4.0K Feb 9 10:46 64gp101
48 >>> drwxr-xr-x 4 fbissey fbissey 4.0K Feb 9 10:46 64gp102
49 >>>
50 >>> the files in the tarball are owned by user/group 1001:1001
51 >>> and on my system it is my personal user.
52 >>> sci-mathematics/singular and that may include the version in the main tree,
53 >>> would have to check, install its documentation from a tarball as well
54 >>> fbissey@moonloop ~ $ ll /usr/share/doc/singular-4.1.1_p2-r3/
55 >>> total 216K
56 >>> drwxr-xr-x 3 2345 uucp 4.0K Nov 10 10:49 .
57 >>> drwxr-xr-x 1361 root root 64K Feb 9 10:39 ..
58 >>> drwxr-xr-x 2 2345 uucp 128K Nov 10 10:49 html
59 >>> -rw-r--r-- 1 root root 497 Nov 10 10:48 README.bz2
60 >>> -rw-r--r-- 1 root root 517 Nov 10 10:48 README.md.bz2
61 >>> -rw-r--r-- 1 root root 585 Nov 10 10:48 README.pkg.bz2
62 >>> fbissey@moonloop ~ $ ll /usr/share/doc/singular-4.1.1_p2-r3/html
63 >>> total 30M
64 >>> drwxr-xr-x 2 2345 uucp 128K Nov 10 10:49 .
65 >>> drwxr-xr-x 3 2345 uucp 4.0K Nov 10 10:49 ..
66 >>> -rwxr-xr-x 1 2345 uucp 915 Feb 14 2018 a_begin.gif
67 >>> -rwxr-xr-x 1 2345 uucp 909 Feb 14 2018 a_begin_na.gif
68 >>> -rwxr-xr-x 1 2345 uucp 927 Feb 14 2018 a_document.gif
69 >>>
70 >>> I tried to use fowners inside the ebuild, but it only fixes file ownership,
71 >>> folders are not touched. I tried to insert “—no-same-owner” in the call to tar
72 >>> and that didn’t really help either. At best, I am expecting ownership to change
73 >>> to portage:portage.
74 >>>
75 >>> Has anyone dealt with something like this before? Apart from “recursively”
76 >>> scripting install in the make file is there anything simple I could do?
77 >>>
78 >>> Cheers,
79 >>> François
80 >>
81 >>
82 >
83 >

Replies

Subject Author
Re: [gentoo-science] tip for installing files from tarballs "François Bissey" <frp.bissey@×××××.com>