Article View: uk.comp.os.linux
Article #893Re: How to make tarballs?
From: phil hunt
Date: Fri, 24 Mar 2000 00:00
Date: Fri, 24 Mar 2000 00:00
75 lines
3848 bytes
3848 bytes
On 24 Mar 2000 14:35:21 +0000, Tim Haynes <piglet@glutinous.custard.org> wrote:
>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.
Yes, I know. And when parrot-0.2.5.tgz is untarred, it'll create a directory
parrot-0.2.5/ under the cwd to put the contents in.
>> 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;
That's as I understood 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.
Isn't writing tar files so they untar into the current directory considered
a no-no?
>> 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?
Because parrot/ contains my working version of the Parrot program. If the
last release was 0.2.5, and i make changes, the current version isn't
0.2.5 any more (I use the notation "0.2.5+"). So I'd have to continually
keep mv'ing my directory names. I suppose i could, but I don't really
want to.
In any case, having separate directory structure for each release as they
are made works as a primitive form of version control (CVS is a bit over
the top for a one-programmer project IMO).
> 3) can you automate the list of files you move across? If so, stick it
> in a shell script
This is sensible.
> 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/ \;
Sort of. For example, for parrot I want to copy all *.py files but
no *.pyc ones.
--
***** Phil Hunt ***** send email to phil@comuno.com *****
Moore's Law: hardware speed doubles every 18 months
Gates' Law: software speed halves every 18 months
Technical Details
Message-ID:
<slrn8dntu2.dbj.philh@vision25.demon.co.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<slrn8dmspm.9sp.philh@vision25.demon.co.uk> <m3og84e8ra.fsf@thyme.td.micromuse.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: 10d8ad,5ebef2ff092e0af0 X-Google-Attributes: gid10d8ad,public X-Google-Thread: 1025b4,5ebef2ff092e0af0 X-Google-Attributes: gid1025b4,public From: philh@vision25.demon.co.uk (phil hunt) Subject: Re: How to make tarballs? Date: 2000/03/24 Message-ID: <slrn8dntu2.dbj.philh@vision25.demon.co.uk> X-Deja-AN: 601961770 X-NNTP-Posting-Host: vision25.demon.co.uk:194.222.41.126 References: <slrn8dmspm.9sp.philh@vision25.demon.co.uk> <m3og84e8ra.fsf@thyme.td.micromuse.co.uk> X-Complaints-To: abuse@demon.net X-Trace: news.demon.co.uk 953939595 nnrp-06:2961 NO-IDENT vision25.demon.co.uk:194.222.41.126 Organization: Comuno Reply-To: phil@comuno.com Newsgroups: uk.comp.os.linux,comp.os.linux.development.apps,gnu.misc.discuss