🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to make tarballs?

#892
From: phil hunt
Date: Fri, 24 Mar 2000 00:00
97 lines
4102 bytes
On 24 Mar 2000 16:09:21 GMT, Dave Pearson <davep.news@davep.org> wrote:
>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'`"

Ah yes, shell scripts. What a wonderfully intuitive programming language.
BTW, has anyone ever seen a JavaCC regular expression for Java comments?

>| 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.

That's what I thought too. I'm currently experimenting with a system to
do just that. The way it'll work is that in your package you'll have
a configuration file that declares which files get copied (the default is
all of them) -- much like your list of ``cp'' commands above. Then, to
create the tarball you'll just run the autotar executable, something
like:

   autotar parrot 0.2.4

Things like where it looks for parrot/, and where it puts the resulting
parrot-0.2.4/ directory and parrot-0.2.4.tgz file will be controlled by
environment variables, with optional command-line options and sensible
defaults (I realize this is hand-waving; I haven't worked out the details
yet).

Is this a sensible way to do things? Has it been done already?

-- 
***** 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: <slrn8dntgs.dbj.philh@vision25.demon.co.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <slrn8dmspm.9sp.philh@vision25.demon.co.uk> <slrn8dn4ph.rfd.davep.news@hagbard.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: 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: <slrn8dntgs.dbj.philh@vision25.demon.co.uk>
X-Deja-AN: 601961765
X-NNTP-Posting-Host: vision25.demon.co.uk:194.222.41.126
References: <slrn8dmspm.9sp.philh@vision25.demon.co.uk>  <slrn8dn4ph.rfd.davep.news@hagbard.demon.co.uk>
X-Complaints-To: abuse@demon.net
X-Trace: news.demon.co.uk 953939593 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