From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mauricio Silveira Subject: Re: Compressed Tar : stop on first occurrence Date: Fri, 20 Oct 2006 16:31:07 -0200 Message-ID: <453915EB.6090008@linuxbr.com> References: <4538C4B8.8020707@linuxbr.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070201050704070303060207" Return-path: In-Reply-To: Sender: linux-admin-owner@vger.kernel.org List-Id: To: terry white Cc: linux-admin This is a multi-part message in MIME format. --------------070201050704070303060207 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit terry white wrote: > ... ciao: > > : on "10-20-2006" "Mauricio Silveira" writ: > : I'm wondering if there's any way to get tar to stop immediately after > : the extraction of a file on compressed tar files. eg: I pack a big tgz > > 'man tar' offers: > > -T, --files-from F > get names to extract or create from file F > > > : when I run "tar xf file.tgz --occurrence index.txt" > > HOWEVER , i'm using a gnu flavour 'tar', which does "not" list > '--occurrence' as an option, so, the suggestion above may not apply .. I know 1.13 doesn't have this option (at least on command line help). I did some research on the source code for tar 1.15.1 and found a place to insert a simple exit() when using "--occurrence filename" to force tar to quit on a "match". I think this is the way tar should behave... compressed or non compressed files, tar actions behavior should be the same. I think I should send tar this issue as a bug... as far as tar waits for its child "compress program" pipe to end. Attached file "tar-1.15.1-compressed-archive-quit-on-ocurrence.diff" (such a long name huh?). Thanks, Mauricio --------------070201050704070303060207 Content-Type: text/plain; name="tar-1.15.1-compressed-archive-quit-on-ocurrence.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0="tar-1.15.1-compressed-archive-quit-on-ocurrence.diff" --- list.c.org 2006-10-20 15:09:17.000000000 -0200 +++ list.c 2006-10-20 15:07:51.000000000 -0200 @@ -199,6 +199,7 @@ } while (!all_names_found (¤t_stat_info)); + exit(EXIT_SUCCESS); close_archive (); names_notfound (); /* print names not found */ } --------------070201050704070303060207 Content-Type: text/x-vcard; charset=utf-8; name="msilveira.vcf" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="msilveira.vcf" begin:vcard fn:Mauricio Silveira n:Silveira;Mauricio org;quoted-printable:FSN do Brasil - Consultoria em Inform=C3=A1tica;Software Development / Networking adr:;;;;;;Brazil email;internet:msilveira@linuxbr.com title:Linux Consultant / Developer tel;cell:11-9949-1040 url:http://www.fsndobrasil.com version:2.1 end:vcard --------------070201050704070303060207--