git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] extend cg-export to support release tarball creation

From
MAMark Allen <mrallen1@yahoo.com>
Date
May 3, 2005, 22:57 UTC
Message-ID
<20050503225712.74818.qmail@web41211.mail.yahoo.com>

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
Message 1 of 1 in “extend cg-export to support release tarball creation”
  1. extend cg-export to support release tarball creationMark Allen, May 3, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.