Commit 1c344bd5 authored by ben's avatar ben

A few fixes to accomodate the new CVS system


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@18 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent 86b10a7e
...@@ -2,8 +2,10 @@ ...@@ -2,8 +2,10 @@
import os, re, shutil, time import os, re, shutil, time
filelist = ["rdiff-backup", "CHANGELOG", "COPYING", "README", "FAQ.html"]
SourceDir = "src" SourceDir = "src"
filelist = [SourceDir + "/rdiff-backup", "CHANGELOG",
"COPYING", "README", "FAQ.html"]
# Various details about the files must also be specified by the rpm # Various details about the files must also be specified by the rpm
# spec template. # spec template.
...@@ -12,7 +14,7 @@ spec_template = "dist/rdiff-backup.spec" ...@@ -12,7 +14,7 @@ spec_template = "dist/rdiff-backup.spec"
def GetVersion(): def GetVersion():
"""Return version string by reading in ./rdiff-backup""" """Return version string by reading in ./rdiff-backup"""
fp = open(SourceDir + "rdiff-backup", "r") fp = open(SourceDir + "/rdiff-backup", "r")
match = re.search("Version (.*?) ", fp.read()) match = re.search("Version (.*?) ", fp.read())
fp.close() fp.close()
return match.group(1) return match.group(1)
...@@ -35,8 +37,12 @@ def MakeTar(version): ...@@ -35,8 +37,12 @@ def MakeTar(version):
"""Create rdiff-backup tar file""" """Create rdiff-backup tar file"""
tardir = "rdiff-backup-%s" % version tardir = "rdiff-backup-%s" % version
tarfile = "rdiff-backup-%s.tar.gz" % version tarfile = "rdiff-backup-%s.tar.gz" % version
try:
os.lstat(tardir)
os.system("rm -rf " + tardir)
except OSError: pass
os.mkdir(tardir) os.mkdir(tardir)
for file in filelist: shutil.copyfile(file, os.path.join(tardir, file)) for file in filelist: os.system("cp -a %s %s" % (file, tardir))
os.chmod(os.path.join(tardir, "rdiff-backup"), 0755) os.chmod(os.path.join(tardir, "rdiff-backup"), 0755)
CopyMan(os.path.join(tardir, "rdiff-backup.1"), version) CopyMan(os.path.join(tardir, "rdiff-backup.1"), version)
os.system("tar -cvzf %s %s" % (tarfile, tardir)) os.system("tar -cvzf %s %s" % (tarfile, tardir))
...@@ -55,7 +61,10 @@ def MakeSpecFile(version): ...@@ -55,7 +61,10 @@ def MakeSpecFile(version):
return specfile return specfile
def Main(): def Main():
cwd = os.getcwd()
os.chdir(SourceDir)
assert not os.system("./Make") assert not os.system("./Make")
os.chdir(cwd)
version = GetVersion() version = GetVersion()
print "Processing version " + version print "Processing version " + version
tarfile = MakeTar(version) tarfile = MakeTar(version)
......
...@@ -2,9 +2,11 @@ ...@@ -2,9 +2,11 @@
import os, sys, re import os, sys, re
SourceDir = "src"
def GetVersion(): def GetVersion():
"""Return version string by reading in ./rdiff-backup""" """Return version string by reading in ./rdiff-backup"""
fp = open("rdiff-backup", "r") fp = open(SourceDir + "/rdiff-backup", "r")
match = re.search("Version (.*?) ", fp.read()) match = re.search("Version (.*?) ", fp.read())
fp.close() fp.close()
return match.group(1) return match.group(1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment