🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: uk.comp.os.linux
Article #898

Re: How to make tarballs?

#898
From: Tim Haynes
Date: Fri, 24 Mar 2000 00:00
58 lines
3688 bytes
philh@vision25.demon.co.uk (phil hunt) writes:

> This is not as stupid a question as it sounds. I know the 'tar'
> command, and I know that for example:
>    tar czvf parrot-0.2.5.tgz parrot-0.2.5/
> will create a file 'parrot-0.2.5.tgz' which when untarred will
> put its contents in a subdirectory called 'parrot-0.2.5'.

Er, ITYM it'll tar+gzip the contents of parrot-0.2.5/ into the tarball
parrot-0.2.5.tgz. Close. :)

> The way i do this is that first I create a directory parrot-0.2.5/ which
> contains evereything I want to include from the parrot/ directory to go
> into the tarball. This is potentially error-prone, especially as it is a
> routine (& therefore boring) administrative task. Then I execute the tar
> command above.

It's a question of directory paths. If you want the contents of the tar
archive to be 
	blah-0.2
	blah-0.2/Minutes.doc
	blah-0.2/cd_b4.tar.gz
	blah-0.2/somefile.txt

then you must be in a directory containing blah-0.2/ underneath it; the
alternatives are either full directory paths (EVIL! [1]) or no directories
at all (  cd blah-0.2 ; tar cvzf ../blah-0.2.tar.gz * )  according to taste.

> Is there an easier way?

   -1) that IS easy!  ;8^]
    0) not really unless you do something graphically eg with kfm / whatever
    1) you are using tab-completion, aren't you?
    2) are you only copying certain files across from parrot/ each time? if
       so, why not live under parrot-0.2.5/ in the first place?
    3) can you automate the list of files you move across? If so, stick it
       in a shell script
    4) can you generate a list of files by a set of rules, eg "isn't a .o
       file and was modified in the last 4 days"? If so, use find like
       this:
	find parrot/ -mtime -4 ! -name \*.o -exec cp {} parrot-0.2.5/ \;

    5) if you want to create a tarball of a load of things under a
       directory where there's a similar set of rules for things to
       include/exclude, consider this:
	find parrot-0.2.5/ -mtime -4 ! -name \*.o | cpio -H tar -ov | \
	     gzip -9c > parrot-0.2.5.tar.gz
       it's cute and it works wonders... ;)

[1] I don't think you want a /mnt/reiserfs/piglet/stuff/blah-0.2/
directory, do you? ;)

~Tim
-- 
| Geek Code: GCS dpu s-:+ a-- C++++ UBLUAVHSC++++ P+++ L++ E--- W+++(--) N++ 
| w--- O- M-- V-- PS PGP++ t--- X+(-) b D+ G e++(*) h++(*) r--- y-	     
| The sun is melting over the hills,         | http://piglet.is.dreaming.org/
| All our roads are waiting / To be revealed | piglet@glutinous.custard.org
Technical Details
Message-ID: <m3og84e8ra.fsf@thyme.td.micromuse.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <slrn8dmspm.9sp.philh@vision25.demon.co.uk>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10c696,5ebef2ff092e0af0
X-Google-Attributes: gid10c696,public
X-Google-Thread: 1025b4,5ebef2ff092e0af0
X-Google-Attributes: gid1025b4,public
X-Google-Thread: 10d8ad,5ebef2ff092e0af0
X-Google-Attributes: gid10d8ad,public
From: "Tim Haynes" <piglet@glutinous.custard.org>
Subject: Re: How to make tarballs?
Date: 2000/03/24
Message-ID: <m3og84e8ra.fsf@thyme.td.micromuse.co.uk>
X-Deja-AN: 601771707
References: <slrn8dmspm.9sp.philh@vision25.demon.co.uk>
X-Complaints-To: abuse@insnet.net
X-Trace: starburst.uk.insnet.net 953908532 19398 194.205.97.75 (24 Mar 2000 14:35:32 GMT)
X-Face: #VSW`$W9VSODCMa|VI.*1#90p<]FLnir4eWO`ghu'4b:gu68ck)`W<%[7ICq;z:)zfCNK{" _EUd/*pI~zb6cF-Gwd|).]EDMyx9!"_a)oyL6+<+F5u!N8%fBkn'}Ahx84(qUmtPr[/~:<8X+ZA%fU }n\aBfWy/pD04j0e6,%[yB(ZUE0Sd\9D<SNb!*QRRB#wZBiz(83OQUt}$J5H4~m)_QTUXTBDKa/
Organization: What's Organization?
X-Caffeine: Penguin mints!
Reply-To: "Tim Haynes" <piglet@glutinous.custard.org>
NNTP-Posting-Date: 24 Mar 2000 14:35:32 GMT
Newsgroups: uk.comp.os.linux,comp.os.linux.development.apps,gnu.misc.discuss