From owner-freebsd-ports@FreeBSD.ORG Mon Apr 9 11:43:44 2007 Return-Path: X-Original-To: ports@freebsd.org Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 490EA16A401 for ; Mon, 9 Apr 2007 11:43:44 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.184]) by mx1.freebsd.org (Postfix) with ESMTP id BBB5E13C465 for ; Mon, 9 Apr 2007 11:43:43 +0000 (UTC) (envelope-from uspoerlein@gmail.com) Received: by mu-out-0910.google.com with SMTP id g7so2055777muf for ; Mon, 09 Apr 2007 04:43:42 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:received:received:date:from:to:cc:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to; b=hbghfYXk1+WvYh9vQZ9+FAfgGfPtXglhkmEevBsrRWtPl09jZSW4FgR5XEJf/V+X9ICsiH80KU2bJ/rYjdq9lba1XbrCsRdpFRGTXq854EIV+5OQ9HWbb43hLQ+ycSo7tXBRKW+H8zAyY3nZxI4l9g1+luiKkVxL/Anxxrp+IGA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:from:to:cc:subject:message-id:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to; b=uevCdoaUbGQSOAjjeFOE/2G+EQJZHDogqKqR45ijDS85PzG/4tnphhvCFFl+tQ+Y6viBDBLC/IO4eej01DeB8oMc9Bb5uwOcHkStMOnluoydEmWYP6tL7PffVgPokijg5mBmxwkhWL9WIY/IiR7FHPaYBPn2C5TkqMpvVXgl1e4= Received: by 10.82.153.5 with SMTP id a5mr7517410bue.1176119022414; Mon, 09 Apr 2007 04:43:42 -0700 (PDT) Received: from roadrunner.q.local ( [217.185.119.140]) by mx.google.com with ESMTP id j2sm18483959mue.2007.04.09.04.43.37; Mon, 09 Apr 2007 04:43:41 -0700 (PDT) Received: from roadrunner.q.local (localhost [127.0.0.1]) by roadrunner.q.local (8.13.8/8.13.8) with ESMTP id l39BhZTG017613; Mon, 9 Apr 2007 13:43:35 +0200 (CEST) (envelope-from uspoerlein@gmail.com) Received: (from q@localhost) by roadrunner.q.local (8.13.8/8.13.8/Submit) id l39AqKr1017397; Mon, 9 Apr 2007 12:52:20 +0200 (CEST) (envelope-from uspoerlein@gmail.com) Date: Mon, 9 Apr 2007 12:52:20 +0200 From: Ulrich Spoerlein To: Tim Kientzle Message-ID: <20070409105220.GA1347@roadrunner.q.local> Mail-Followup-To: Tim Kientzle , ports@freebsd.org References: <20070407174756.GA46385@roadrunner.q.local> <4617F67B.7050304@freebsd.org> <20070408075917.GA40103@roadrunner.q.local> <46194018.8030102@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <46194018.8030102@freebsd.org> Cc: ports@freebsd.org Subject: bsdtar and packages vs. unionfs (was: Re: Cannot package converters/libiconv inside clean chroot) X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Apr 2007 11:43:44 -0000 Tim Kientzle wrote: > >There are at least two issues here, one is pkg_add refusing a valid > >(AFAICS) tbz file, the other is bsdtar(1) choosing a different tar > >format based on unionfs(!). > > Those two symlink entries have an "opaque" file flag. > This explains the format change (bsdtar uses the extended > pax format when it sees a file with flags set, since > ustar can't store those). > > I would guess that pkg_add is invoking bsdtar with > -p (restore permissions), bsdtar is restoring the > 'opaque' flag, and then pkg_add is tripping over > those symlinks for some reason when it tries to > move them. /usr/src/usr.sbin/pkg_install/add/extract.c:37: strcat(where_args, "|/usr/bin/tar --unlink -xpf - -C "); \ > To test this hypothesis, try stripping those flags > with: > > tar -cjf new-libiconv-1.9.2_2.tbz --format=ustar @libiconv-1.9.2_2.tbz > > The "new-libiconv" tarfile should be identical except > it won't have the file flags stored. If pkg_add > likes new-libiconv but not libiconv, then it must > be those opaque flags. Yes, using the trick above, pkg_add no longer complains. I can use this as a temporary workaround. I think the real problem lies with bsdtar(1), though. See below. > I don't know if this is a bug in unionfs, in pkg_add, > or in bsdtar. I think we need someone who understands > the 'opaque' flag to chime in here. I was certain, that I tried to extract the "broken" package with the exact same flags as pkg_add uses (--unlink -xpf) but it looks like I messed something up, as _now_ I do see the same errors with bsdtar itself. roadrunner# rm -rf foo ; mkdir foo ; tar --unlink -xpvf libiconv-1.9.2_2.tbz -C foo x +CONTENTS x +COMMENT x +DESC x +MTREE_DIRS x man/man1/iconv.1.gz x man/man3/iconv.3.gz x man/man3/iconv_open.3.gz x man/man3/iconv_close.3.gz x bin/iconv x include/iconv.h x include/libcharset.h x include/localcharset.h x lib/libcharset.a x lib/libcharset.la x lib/libcharset.so: Couldn't stat file: No such file or directory x lib/libcharset.so.1 x lib/libiconv.a x lib/libiconv.la x lib/libiconv.so: Couldn't stat file: No such file or directory x lib/libiconv.so.3 x libdata/charset.alias x share/doc/libiconv/iconv.1.html x share/doc/libiconv/iconv.3.html x share/doc/libiconv/iconv_close.3.html x share/doc/libiconv/iconv_open.3.html roadrunner# echo $? 1 roadrunner# find foo -exec ls -dlo {} \+ drwxr-xr-x 8 root wheel opaque 512 Apr 9 10:34 foo -rw-r--r-- 1 root wheel - 35 Apr 9 09:47 foo/+COMMENT -rw-r--r-- 1 root wheel - 2427 Apr 9 09:47 foo/+CONTENTS -rw-r--r-- 1 root wheel - 676 Apr 9 09:47 foo/+DESC -rwxr-xr-x 1 root wheel - 15305 Apr 9 09:47 foo/+MTREE_DIRS drwxr-xr-x 2 root wheel opaque 512 Apr 9 10:34 foo/bin -r-xr-xr-x 1 root wheel - 7724 Apr 9 09:47 foo/bin/iconv drwxr-xr-x 2 root wheel opaque 512 Apr 9 10:34 foo/include -r--r--r-- 1 root wheel - 4760 Apr 9 09:47 foo/include/iconv.h -r--r--r-- 1 root wheel - 1546 Apr 9 09:47 foo/include/libcharset.h -r--r--r-- 1 root wheel - 1391 Apr 9 09:47 foo/include/localcharset.h drwxr-xr-x 2 root wheel opaque 512 Apr 9 10:34 foo/lib -rw-r--r-- 1 root wheel - 4256 Apr 9 09:47 foo/lib/libcharset.a -r--r--r-- 1 root wheel - 807 Apr 9 09:47 foo/lib/libcharset.la lrwxr-xr-x 1 root wheel - 15 Apr 9 09:47 foo/lib/libcharset.so -> libcharset.so.1 -r--r--r-- 1 root wheel - 8464 Apr 9 09:47 foo/lib/libcharset.so.1 -rw-r--r-- 1 root wheel - 998722 Apr 9 09:47 foo/lib/libiconv.a -r--r--r-- 1 root wheel - 793 Apr 9 09:47 foo/lib/libiconv.la lrwxr-xr-x 1 root wheel - 13 Apr 9 09:47 foo/lib/libiconv.so -> libiconv.so.3 -r--r--r-- 1 root wheel - 1002230 Apr 9 09:47 foo/lib/libiconv.so.3 drwxr-xr-x 2 root wheel opaque 512 Apr 9 10:34 foo/libdata -r--r--r-- 1 root wheel - 641 Apr 9 09:47 foo/libdata/charset.alias drwxr-xr-x 4 root wheel opaque 512 Apr 9 10:34 foo/man drwxr-xr-x 2 root wheel opaque 512 Apr 9 10:34 foo/man/man1 -r--r--r-- 1 root wheel - 976 Apr 9 09:47 foo/man/man1/iconv.1.gz drwxr-xr-x 2 root wheel opaque 512 Apr 9 10:34 foo/man/man3 -r--r--r-- 1 root wheel - 1457 Apr 9 09:47 foo/man/man3/iconv.3.gz -r--r--r-- 1 root wheel - 653 Apr 9 09:47 foo/man/man3/iconv_close.3.gz -r--r--r-- 1 root wheel - 2103 Apr 9 09:47 foo/man/man3/iconv_open.3.gz drwxr-xr-x 3 root wheel opaque 512 Apr 9 10:34 foo/share drwxr-xr-x 3 root wheel opaque 512 Apr 9 10:34 foo/share/doc drwxr-xr-x 2 root wheel opaque 512 Apr 9 10:34 foo/share/doc/libiconv -r--r--r-- 1 root wheel - 3473 Apr 9 09:47 foo/share/doc/libiconv/iconv.1.html -r--r--r-- 1 root wheel - 8223 Apr 9 09:47 foo/share/doc/libiconv/iconv.3.html -r--r--r-- 1 root wheel - 2384 Apr 9 09:47 foo/share/doc/libiconv/iconv_close.3.html -r--r--r-- 1 root wheel - 16401 Apr 9 09:47 foo/share/doc/libiconv/iconv_open.3.html The way I see it, bsdtar(1) extracts the symlink libcharset.so, and then tries to stat(2) instead of lstat(2) it, before libcharset.so.1 is extracted. The questions is: why? Ulrich Spoerlein -- "The trouble with the dictionary is you have to know how the word is spelled before you can look it up to see how it is spelled." -- Will Cuppy