From owner-freebsd-questions@freebsd.org Sat Apr 21 02:34:58 2018 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A32B4F8ADA9 for ; Sat, 21 Apr 2018 02:34:58 +0000 (UTC) (envelope-from freebsd@dreamchaser.org) Received: from nightmare.dreamchaser.org (ns.dreamchaser.org [66.109.141.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "dreamchaser.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 101C884002 for ; Sat, 21 Apr 2018 02:34:57 +0000 (UTC) (envelope-from freebsd@dreamchaser.org) Received: from breakaway.dreamchaser.org (breakaway [192.168.151.122]) by nightmare.dreamchaser.org (8.15.2/8.15.2) with ESMTP id w3L2YsJZ045361 for ; Fri, 20 Apr 2018 20:34:55 -0600 (MDT) (envelope-from freebsd@dreamchaser.org) Reply-To: freebsd@dreamchaser.org Subject: Re: tar xf foo -- how to restore symlink? To: FreeBSD Mailing List References: <5ff313cf-6148-be90-0195-7d21f1f836ac@dreamchaser.org> <20180418063005.056e321d.freebsd@edvax.de> <9902b54d-4684-6ba6-a08b-f3d9504c1273@dreamchaser.org> <20180419160503.38e1aa75.freebsd@edvax.de> <9e435ffd-8997-74c7-9502-854a004ac5cc@dreamchaser.org> <44sh7qvwly.fsf@be-well.ilk.org> From: Gary Aitken Message-ID: <039392da-f614-fc89-bd5a-d70e88ad4706@dreamchaser.org> Date: Fri, 20 Apr 2018 20:34:14 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <44sh7qvwly.fsf@be-well.ilk.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.6.2 (nightmare.dreamchaser.org [192.168.151.101]); Fri, 20 Apr 2018 20:34:55 -0600 (MDT) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 21 Apr 2018 02:34:58 -0000 On 04/20/18 07:24, Lowell Gilbert wrote: > Gary Aitken writes: > >> Unfortunately, I'm not in control of generating the archive or the >> way it's fetched. It's fetched via the ports system. I'm going >> to punt on the project for now as I've got a better alternative. > > Sounds like you aren't aware that our cpio(1) can extract tar files. Not anymore :-) Thanks. It's still not clear to me it would help. Polytropon's comment indicated using cpio to create the file being transferred, and I don't have control of that; or at least I don't think I do. In terms of extracting from the given tar file, are you suggesting cpio can do the following in a general manner: Tarball: drwxrwxr-x 0 ml ml 0 May 26 2017 nufraw-0.41/doc/ -rw-rw-r-- 0 ml ml 6195 May 26 2017 nufraw-0.41/doc/ChangeLog lrwxrwxrwx 0 ml ml 0 May 26 2017 nufraw-0.41/doc-pak -> doc/ -rw-rw-r-- 0 ml ml 6195 May 26 2017 nufraw-0.41/doc-pak/ChangeLog restore doc-pak as a symlink ignore the entry doc-pak/ChangeLog I've tried cpio -i creates top level directory only cpio -id doc-pak not restored as a symlink; hierarchies duplicated cpio -id -f doc-pak/[a-z,A-Z]* gets the symlink properly requires detailed knowledge of the file hierarchy cpio -id --insecure "Can't replace existing directory with non-directory" duplicate hierarchies, no symlink cpio -idu "Can't replace existing directory with non-directory" duplicate hierarchies, no symlink Gary