Git development
 help / color / mirror / Atom feed
From: Mark Allen <mrallen1@yahoo.com>
To: Petr Baudis <pasky@ucw.cz>, Chris Wright <chrisw@osdl.org>
Cc: git@vger.kernel.org
Subject: [PATCH] extend cg-export to support release tarball creation
Date: Tue, 3 May 2005 15:57:11 -0700 (PDT)	[thread overview]
Message-ID: <20050503225712.74818.qmail@web41211.mail.yahoo.com> (raw)
In-Reply-To: 6667

Here's a patch for cg-export which supports a "-r RELEASE" option. It will export the
specific ID or HEAD and then create a tar gz and a tar bz2 in your previous working
directory using RELEASE as the tarball name and the directory inside the tarball.

Within cogito itself,

cg-export -r $(cat VERSION) /tmp/foo

seems to work quite nicely to make release tarballs.

Unlike my previous attempt, this one does not make evil tarballs. :-)  One could insert a
script to update the .spec file before the tarfiles get created if desired.

Cheers,

--Mark

Signed-off-by: Mark Allen <mrallen1@yahoo.com>

Index: cg-export
===================================================================
--- aa6233be6d1b8bf42797c409a7c23b50593afc99/cg-export  (mode:100755
sha1:a4497314ab33f6a6387bc278e84f88d4442070ce)
+++ uncommitted/cg-export  (mode:100755 sha1:b0dfdf6049e7a074ef8c8c3f6a43e04a30e5cb89)
@@ -8,10 +8,17 @@

 . cg-Xlib

-destdir=$1
-id=$(tree-id $2)

-([ "$destdir" ] && [ "$id" ]) || die "usage: cg-export DESTDIR [TREE_ID]"
+if [ "$1" = "-r" ]; then
+       release=$2
+       destdir="$3/$2"
+       id=$(tree-id $4)
+else
+       destdir=$1
+       id=$(tree-id $2)
+fi
+
+([ "$destdir" ] && [ "$id" ]) || die "usage: cg-export [-r RELEASE] DESTDIR [TREE_ID]"

 [ -e "$destdir" ] && die "$destdir already exists."

@@ -20,3 +27,14 @@
 git-read-tree $id
 git-checkout-cache "--prefix=$destdir/" -a
 rm $GIT_INDEX_FILE
+
+if [ "$1" = "-r" ]; then
+       origdir=$PWD
+       cd $destdir
+       cd ..
+       tar czf $origdir/$release.tar.gz $release
+       tar cjf $origdir/$release.tar.bz2 $release
+       cd $origdir
+else
+       exit 0
+fi



                 reply	other threads:[~2005-05-03 22:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20050503225712.74818.qmail@web41211.mail.yahoo.com \
    --to=mrallen1@yahoo.com \
    --cc=chrisw@osdl.org \
    --cc=git@vger.kernel.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