1999-12-18 23:05:58 +00:00
|
|
|
#! /usr/bin/env python
|
1999-12-18 23:28:54 +00:00
|
|
|
#
|
|
|
|
# Script to make a compressed tar archive of the directory
|
|
|
|
# the script is living in, excluding CVS directories and the
|
|
|
|
# script itself.
|
|
|
|
#
|
1999-12-18 23:56:14 +00:00
|
|
|
# $Id: mktarball.py,v 1.6 1999-12-18 23:56:14 just Exp $
|
1999-12-18 23:28:54 +00:00
|
|
|
#
|
|
|
|
|
1999-12-18 23:05:58 +00:00
|
|
|
|
1999-12-18 23:09:30 +00:00
|
|
|
import os, sys
|
|
|
|
|
1999-12-18 23:56:14 +00:00
|
|
|
script = os.path.join(os.getcwd(), sys.argv[0])
|
|
|
|
srcdir, scriptname = os.path.split(script)
|
|
|
|
wdir, src = os.path.split(srcdir)
|
|
|
|
os.chdir(wdir)
|
|
|
|
|
1999-12-18 23:05:58 +00:00
|
|
|
tar = src + ".tar"
|
|
|
|
gz = tar + ".gz"
|
|
|
|
tgz = src + ".tgz"
|
|
|
|
|
1999-12-18 23:25:16 +00:00
|
|
|
print "source:", src
|
|
|
|
print "dest:", tgz
|
|
|
|
|
1999-12-18 23:56:14 +00:00
|
|
|
os.system('tar --exclude=CVS --exclude=%s -cf %s %s' % (scriptname, tar, src))
|
1999-12-18 23:10:58 +00:00
|
|
|
os.system('gzip -9v %s' % tar)
|
1999-12-18 23:05:58 +00:00
|
|
|
os.rename(gz, tgz)
|