public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] wwwoffle ebuild problem with tar commmand on symbolic links
@ 2003-12-31 11:10 Torsten Veller
  2004-01-02 16:37 ` Torsten Veller
  2004-01-04  5:15 ` Daniel
  0 siblings, 2 replies; 5+ messages in thread
From: Torsten Veller @ 2003-12-31 11:10 UTC (permalink / raw
  To: gentoo-dev

Hi,

i hope this list is okay, if not,....

i am trying to write a wwwoffle ebuild. At the moment i am having
problems with src_install. src_install calls 
"make DESTDIR=${D} install || die"

# ebuild wwwoffle-2.8a.ebuild install
stops at the tar command with the following output:

tar cf /var/tmp/portage/wwwoffle-2.8a/image//var/spool/wwwoffle/html.tar html && cd /var/tmp/portage/wwwoffle-2.8a/image//var/spool/wwwoffle && tar xpf html.tar && rm html.tar
tar: html/de/search/htdig/index.html: Cannot change ownership to uid 0, gid 0: No such file or directory
tar: html/en/search/htdig/index.html: Cannot change ownership to uid 0, gid 0: No such file or directory
[...]
tar: Error exit delayed from previous errors
make[1]: *** [install-html] Error 2
make[1]: Leaving directory `/var/tmp/portage/wwwoffle-2.8a/work/wwwoffle-2.8a/cache'


All these files are symbolic links to other files in the same directory. These
symbolic links come before the destination file in the html.tar archive.  There
are other linked files in this html.tar where it's vice versa with no problem.

If i run 
# ebuild wwwoffle-2.8a.ebuild compile
# "cd ${S}"
# make DESTDIR=/var/tmp/portage/wwwoffle-2.8a/image install
there is *no* error.

So what's the problem here? Is this a portage problem?



Versions:
sys-apps/portage-2.0.49-r19, app-arch/tar-1.13.92
ebuild can be found in bug #35275.

-- 
.:     Torsten     |      One man's constant is another man's variable.      :.

--
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-dev] wwwoffle ebuild problem with tar commmand on symbolic links
  2003-12-31 11:10 [gentoo-dev] wwwoffle ebuild problem with tar commmand on symbolic links Torsten Veller
@ 2004-01-02 16:37 ` Torsten Veller
  2004-01-04  5:15 ` Daniel
  1 sibling, 0 replies; 5+ messages in thread
From: Torsten Veller @ 2004-01-02 16:37 UTC (permalink / raw
  To: gentoo-dev

* Torsten Veller <ml-en@veller.net>:

> Is this a portage problem?

Yes, it is. Let's see what happens:

- Generate a tar with symbolic links older and younger than the target.

# mkdir test && cd test && touch 1 && ln -s 1 2 && ln -s 3 4 && touch 3 && cd ..
# tar -cf test.tar test

- Write an ebuild script:

# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: $
DESCRIPTION=""
HOMEPAGE=""
SRC_URI=""
LICENSE=""
SLOT="0"
KEYWORDS="~x86"
IUSE=""
DEPEND=""

src_install() {
cd ${D} && tar -xpf ${FILESDIR}/test.tar && touch uiuiui 
}

- see that no uiuiui is generated.

-- 
.:     Torsten Veller     |         A sine curve goes off to infinity        :.
.:     PGP 0x9C67CD96     |       or at least the end of the blackboard      :.

--
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-dev] wwwoffle ebuild problem with tar commmand on symbolic links
  2003-12-31 11:10 [gentoo-dev] wwwoffle ebuild problem with tar commmand on symbolic links Torsten Veller
  2004-01-02 16:37 ` Torsten Veller
@ 2004-01-04  5:15 ` Daniel
  2004-01-06 14:16   ` Torsten Veller
  1 sibling, 1 reply; 5+ messages in thread
From: Daniel @ 2004-01-04  5:15 UTC (permalink / raw
  To: Torsten Veller; +Cc: gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Wed, 31 Dec 2003 08:40 pm, Torsten Veller wrote:
> Hi,
>
> i hope this list is okay, if not,....
>
> i am trying to write a wwwoffle ebuild. At the moment i am having
> problems with src_install. src_install calls
> "make DESTDIR=${D} install || die"
>
> # ebuild wwwoffle-2.8a.ebuild install
> stops at the tar command with the following output:
>
> tar cf /var/tmp/portage/wwwoffle-2.8a/image//var/spool/wwwoffle/html.tar
> html && cd /var/tmp/portage/wwwoffle-2.8a/image//var/spool/wwwoffle && tar
> xpf html.tar && rm html.tar tar: html/de/search/htdig/index.html: Cannot
> change ownership to uid 0, gid 0: No such file or directory tar:
> html/en/search/htdig/index.html: Cannot change ownership to uid 0, gid 0:
> No such file or directory [...]
>
> So what's the problem here? Is this a portage problem?
>

Portage is being run as the portage user (FEATURES userpriv) and cannot create 
uid 0 files. Options to fix this are:

1. Unpack the tar before the make does using the 'unpack' directive and hope 
that the make process detects that it is unpacked.
2. Hack the make process to change the tar command to "tar 
- --no-same-owner" ...
Could use:
sed -i -e 's#tar #tar --no-same-owner #' Makefile
or some variation of it.

- --

Daniel Black
- --
Proudly a Gentoo Linux User.
GnuPG/PGP signed and encrypted email preferred
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x32A64DC8
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/96FkTDSbtjKmTcgRAmZEAKDEdb51ryuxiO+Sam+u1ZuNqzKLwACg3D66
1m1PNpRV/Wi8Lwd3keLOUoo=
=IeNE
-----END PGP SIGNATURE-----


--
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-dev] wwwoffle ebuild problem with tar commmand on symbolic links
  2004-01-04  5:15 ` Daniel
@ 2004-01-06 14:16   ` Torsten Veller
  2004-01-09  3:18     ` Daniel
  0 siblings, 1 reply; 5+ messages in thread
From: Torsten Veller @ 2004-01-06 14:16 UTC (permalink / raw
  To: gentoo-dev

* Daniel <dragonheart@tpg.com.au>:

| tar cf /var/tmp/portage/wwwoffle-2.8a/image//var/spool/wwwoffle/html.tar html && cd
  +/var/tmp/portage/wwwoffle-2.8a/image//var/spool/wwwoffle && tar xpf html.tar && rm html.tar
| tar: html/de/search/htdig/index.html: Cannot change ownership to uid 0, gid 0: No such file or directory
| tar: html/en/search/htdig/index.html: Cannot change ownership to uid 0, gid 0: No such file or directory
| [...]


> 1. Unpack the tar before the make does using the 'unpack' directive and hope 
> that the make process detects that it is unpacked.

Same problem.

> 2. Hack the make process to change the tar command to "tar 
> - --no-same-owner" ...

Yes :)


| All these files are symbolic links to other files in the same directory. These
| symbolic links come before the destination file in the html.tar archive.  There
| are other linked files in this html.tar where it's vice versa with no problem.

But if the problem is only a change ownership problem, why is there no error
message when the destination already exists?

For example 'html/de/search/htdig/index.html' is a link to search.html which
does not exist at the point when index.html is extracted (i think it's the same
time when the owner should be changed), so i says 'file not found'. If the file
would exist, there won't be an error. (See my other mail.)

-- 
.:      Torsten Veller       |       1 + 1 = 3, for large values of 1.       :.
.:      PGP 0x9C67CD96       |                                               :.

--
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [gentoo-dev] wwwoffle ebuild problem with tar commmand on symbolic links
  2004-01-06 14:16   ` Torsten Veller
@ 2004-01-09  3:18     ` Daniel
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel @ 2004-01-09  3:18 UTC (permalink / raw
  To: Torsten Veller, gentoo-dev

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


> > 1. Unpack the tar before the make does using the 'unpack' directive and
> > hope that the make process detects that it is unpacked.
>
> Same problem.

"hope" should of been emphasied ;-)

>
> > 2. Hack the make process to change the tar command to "tar
> > - --no-same-owner" ...
>
> Yes :)

;-)

>
> | All these files are symbolic links to other files in the same directory.
> | These symbolic links come before the destination file in the html.tar
> | archive.  There are other linked files in this html.tar where it's vice
> | versa with no problem.
>
> But if the problem is only a change ownership problem, why is there no
> error message when the destination already exists?

I assume chmod (system call) checks the file permission before a change 
occurs. The permission denyed is a permission denyed for changing ownership 
as the portage user.

>
> For example 'html/de/search/htdig/index.html' is a link to search.html
> which does not exist at the point when index.html is extracted (i think
> it's the same time when the owner should be changed), so i says 'file not
> found'. If the file would exist, there won't be an error. (See my other
> mail.)

Symbolic links can exist without their target existing.

Permissions and ownership on symbolic links is ignored by most application 
unless a specific attempt is made to check them. Accessing a symlink pointing 
to a file uses the permissions on the file rather than the symlink.

I hope this answers your question

- -- 

Daniel Black
- --
Proudly a Gentoo Linux User.
GnuPG/PGP signed and encrypted email preferred
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x32A64DC8
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE//h2WTDSbtjKmTcgRAmBPAJ949ox9TMyjycZNc/1BFcd75nwAYQCgqJc4
WOChM699u4HdXyl3FMoy4dY=
=41WG
-----END PGP SIGNATURE-----


--
gentoo-dev@gentoo.org mailing list


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-01-09  4:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-31 11:10 [gentoo-dev] wwwoffle ebuild problem with tar commmand on symbolic links Torsten Veller
2004-01-02 16:37 ` Torsten Veller
2004-01-04  5:15 ` Daniel
2004-01-06 14:16   ` Torsten Veller
2004-01-09  3:18     ` Daniel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox