Thread View: uk.comp.os.linux
3 messages
3 total messages
Started by phil hunt
Fri, 24 Mar 2000 00:00
How to make tarballs?
Author: phil hunt
Date: Fri, 24 Mar 2000 00:00
Date: Fri, 24 Mar 2000 00:00
22 lines
1612 bytes
1612 bytes
How do people make tarballs? 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'. 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. Is there an easier way? -- ***** 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
Re: How to make tarballs?
Author: Tim Haynes
Date: Fri, 24 Mar 2000 00:00
Date: Fri, 24 Mar 2000 00:00
58 lines
3688 bytes
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
Re: How to make tarballs?
Author: Dave Pearson
Date: Fri, 24 Mar 2000 00:00
Date: Fri, 24 Mar 2000 00:00
76 lines
3320 bytes
3320 bytes
On Fri, 24 Mar 2000 13:52:54 +0000, phil hunt <philh@vision25.demon.co.uk> wrote: > 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. > > Is there an easier way? I do what you say above but I automate it. For example, here's a shell script I use to built the source tarball of my Linux oriented Norton Guide reader: ,----[ mktarfile ] | #!/bin/sh | | EGVER="`cat eg.h | grep EG_VERSION | sed -n 's/.*\"\([0-9.]*\)\".*/\1/gp'`" | EGDIR="eg-$EGVER" | | ./mkmanfile $EGDIR | | rm -f eg-*.spec | cat eg.spec | sed -e "s/\\\$VERSION\\$/$EGVER/g" > eg-$EGVER.spec | | mkdir $EGDIR | mkdir $EGDIR/default-guide | | cp *.[ch] $EGDIR | cp Makefile $EGDIR | cp mktarfile $EGDIR | cp mklsmfile $EGDIR | cp mkmanfile $EGDIR | cp README $EGDIR | cp COPYING $EGDIR | cp Changes $EGDIR | cp TODO $EGDIR | cp BUGS $EGDIR | cp eg.spec $EGDIR | cp eg-$EGVER.spec $EGDIR | cp eg $EGDIR | cp eg.lsm $EGDIR | cp eg.1 $EGDIR | cp eg.man.1 $EGDIR | cp default-guide/* $EGDIR/default-guide | | tar czvf $EGDIR.tar.gz $EGDIR | | rm -Rf $EGDIR/* | rmdir $EGDIR | | mkdir -p release | mv $EGDIR.tar.gz release/ | | ./mklsmfile $EGDIR `---- I have a "release" directory under the work directory and the tarball gets dropped into there. mkmanfile and mklsmfile, as the names suggest, build the man and lsm files. The above is fired with "make tarfile": ,----[ Excerpt from Makefile ] | tarfile: veryclean | ./mktarfile `---- When anything becomes a "routine (& therefore boring) administrative task" it's time to automate it. -- Take a look in Hagbard's World: | w3ng - The WWW Norton Guide reader. http://www.hagbard.demon.co.uk/ | eg - Norton Guide reader for Linux. http://www.acemake.com/hagbard/ | weg - Norton Guide reader for Windows. Free software, including........| dgscan - DGROUP scanner for Clipper.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads