From: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
To: "Joshua T. Corbin" <jcorbin@wunjo.org>
Cc: git@vger.kernel.org, Petr Baudis <pasky@ucw.cz>
Subject: Re: [PATCH] make cg-export use tar-tree
Date: Wed, 27 Apr 2005 03:16:25 +0200 [thread overview]
Message-ID: <426EE7E9.5010108@lsrfire.ath.cx> (raw)
In-Reply-To: <200504261928.44538.jcorbin@wunjo.org>
Joshua T. Corbin schrieb:
> Here it is (this time with real tabs instead of two spaces ;) ), requires
> Rene's tar-tree patch. Works quite speedily too I might add.
Maybe it's just Thunderbird, but I see single spaces instead of tabs
there.
> + tar=$(mktemp -t cg-export.tar.XXXXXX)
> + tar-tree $id "$base" > $tar
> + case $ext in
> + .tar.gz|.tgz)
> + gzip -c9 $tar > $dest
> + rm -f $tar
> + ;;
> + .tar.bz2)
> + bzip2 -c $tar > $dest
> + rm -f $tar
> + ;;
> + .tar)
> + mv $tar $dest
> + ;;
> + esac
You don't need to create a temporary file using tar-tree. The above can
be done like this:
case $ext in
.tar.gz|.tgz)
tar-tree $id "$base" | gzip -9
;;
.tar.bz2)
tar-tree $id "$base" | bzip2
;;
.tar)
tar-tree $id "$base"
;;
esac > $dest
This is both shorter and (a bit) faster. More easily readable, too,
IMO. Don't fear the pipe. ;-) And I don't think we need to avoid
the triplication of tar-tree calls.
Thanks,
Rene
parent reply other threads:[~2005-04-27 1:12 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <200504261928.44538.jcorbin@wunjo.org>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=426EE7E9.5010108@lsrfire.ath.cx \
--to=rene.scharfe@lsrfire.ath.cx \
--cc=git@vger.kernel.org \
--cc=jcorbin@wunjo.org \
--cc=pasky@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).