From b360b71e41333a5d685d4c10584dc7efb466f218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Thu, 17 Nov 2005 17:02:39 +0000 Subject: [PATCH] * fix: pisi version is specified inside pisi module * add a simple tool to prepare pisi source distribution from svn --- setup.py | 56 ++++++++++++++++++++++++++++-------------------- tools/svndist.py | 29 +++++++++++++++++++++++++ 2 files changed, 62 insertions(+), 23 deletions(-) create mode 100755 tools/svndist.py diff --git a/setup.py b/setup.py index b018d828..7633137a 100755 --- a/setup.py +++ b/setup.py @@ -8,35 +8,18 @@ # any later version. # # Please read the COPYING file. +# +# Authors: {eray,gurer}@uludag.org.tr import os import shutil import glob +import sys from distutils.core import setup from distutils.command.install import install -PISI_VERSION = "0.1" - -def getRevision(): - import os - try: - p = os.popen("svn info 2> /dev/null") - for line in p.readlines(): - line = line.strip() - if line.startswith("Revision:"): - return line.split(":")[1].strip() - except: - pass - - # doesn't working in a Subversion directory - return None - -def getVersion(): - rev = getRevision() - if rev: - return "-r".join([PISI_VERSION, rev]) - else: - return PISI_VERSION +sys.path.insert(0, '.') +import pisi i18n_domain = "pisi" i18n_languages = "tr" @@ -78,7 +61,7 @@ class Install(install): os.chdir('..') setup(name="pisi", - version= getVersion(), + version= pisi.__version__, description="PISI (Packages Installed Successfully as Intended)", long_description="PISI is the package management system of Pardus Linux.", license="GNU GPL2", @@ -93,3 +76,30 @@ setup(name="pisi", 'install' : Install } ) + +# the below stuff is really nice but we already have a version +# we can use this stuff for svn snapshots in a separate +# script -- exa + +PISI_VERSION = pisi.__version__ + +def getRevision(): + import os + try: + p = os.popen("svn info 2> /dev/null") + for line in p.readlines(): + line = line.strip() + if line.startswith("Revision:"): + return line.split(":")[1].strip() + except: + pass + + # doesn't working in a Subversion directory + return None + +def getVersion(): + rev = getRevision() + if rev: + return "-r".join([PISI_VERSION, rev]) + else: + return PISI_VERSION diff --git a/tools/svndist.py b/tools/svndist.py new file mode 100755 index 00000000..1566c33e --- /dev/null +++ b/tools/svndist.py @@ -0,0 +1,29 @@ +#! /usr/bin/python +# a script to preare PiSi source tarball from svn +# author: exa + +import sys +import os +import shutil + +def run(cmd): + print 'running', cmd + os.system(cmd) + +sys.path.insert(0, '.') +import pisi +if not os.path.exists('svndist'): + os.makedirs('svndist') + +ver = pisi.__version__ + +if os.path.exists('svndist/pisi-%s' % ver): + shutil.rmtree('svndist/pisi-%s' % ver) + +print 'Exporting svn directory' +run('svn export http://svn.uludag.org.tr/uludag/trunk/pisi svndist/pisi-%s' % ver) + +os.chdir('svndist') +run('tar cjvf pisi-%s.tar.bz2 pisi-%s' % (ver, ver)) + +print 'Have a look at svndist directory'