From owner-cvs-all@FreeBSD.ORG Sat Apr 14 18:51:26 2007 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1258416A403; Sat, 14 Apr 2007 18:51:26 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from kientzle.com (h-66-166-149-50.snvacaid.covad.net [66.166.149.50]) by mx1.freebsd.org (Postfix) with ESMTP id DD17A13C44C; Sat, 14 Apr 2007 18:51:25 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from [10.0.0.222] (p54.kientzle.com [66.166.149.54]) by kientzle.com (8.12.9/8.12.9) with ESMTP id l3EIpJH7021566; Sat, 14 Apr 2007 11:51:20 -0700 (PDT) (envelope-from kientzle@freebsd.org) Message-ID: <462122A7.7080102@freebsd.org> Date: Sat, 14 Apr 2007 11:51:19 -0700 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.12) Gecko/20060422 X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?Dag-Erling_Sm=F8rgrav?= References: <200704140820.l3E8KVqP092404@repoman.freebsd.org> <86ejmnz10n.fsf@dwp.des.no> In-Reply-To: <86ejmnz10n.fsf@dwp.des.no> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/lib/libarchive Makefile archive_write_set_format_pax.c archive_write_set_format_ustar.c src/lib/libarchive/test Makefile test_tar_filenames.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2007 18:51:26 -0000 >> Conventionally, tar archives have always included a trailing '/' >> for directories. bsdtar used to add this, but that recently got >> lost somehow. So now I'm adding it back in libarchive. > > Is that really a good idea? Shouldn't this just be fixed in bsdtar's > display code? It's not a display problem, it's an archive creation problem. Very old tar implementations didn't recognize dirs stored in archives, but could actually extract them correctly as long as the name ended in '/'. >> The only odd part of doing this in libarchive: Adding a directory to >> a tar archive and then reading it back again can yield a different name. > > I can imagine how this might trip up other (hypothetical) libarchive > consumers... You may be right. But not all archive formats necessarily require trailing '/' on directories and I've (so far) done pretty well at keeping format-specific knowledge out of bsdtar. I could force trailing '/' when creating archives from bsdtar or ensure the trailing '/' in libarchive for those formats that require it. Neither solution is ideal. I think I'll stick with it in libarchive, though I'll change it so that libarchive actually edits the name in the entry; that way, the client will see the changed name immediately after writing the header. (There's precedent for this; some libarchive formats edit the file size field to indicate how much data they expect; this allows clients to function efficiently with formats that do or don't store duplicate bodies for hard links.) Thanks for the comments. Tim