Commit 2fc20552 authored by owsla's avatar owsla

Get makedist working on Windows. (Patch from Josh Nisly)


git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup@900 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
parent b389c9dd
New in v1.1.17 (????/??/??) New in v1.1.17 (????/??/??)
--------------------------- ---------------------------
Get makedist working on Windows. (Patch from Josh Nisly)
New in v1.1.16 (2008/06/17) New in v1.1.16 (2008/06/17)
......
...@@ -93,10 +93,10 @@ def VersionedCopy(source, dest, munge_date = 0): ...@@ -93,10 +93,10 @@ def VersionedCopy(source, dest, munge_date = 0):
def MakeTar(specfiles): def MakeTar(specfiles):
"""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 tarfilename = "rdiff-backup-%s.tar.gz" % Version
try: try:
os.lstat(tardir) os.lstat(tardir)
os.system("rm -rf " + tardir) shutil.rmtree(tardir)
except OSError: pass except OSError: pass
os.mkdir(tardir) os.mkdir(tardir)
for filename in ["CHANGELOG", "COPYING", "README", for filename in ["CHANGELOG", "COPYING", "README",
...@@ -104,7 +104,8 @@ def MakeTar(specfiles): ...@@ -104,7 +104,8 @@ def MakeTar(specfiles):
SourceDir + "/cmodule.c", SourceDir + "/cmodule.c",
SourceDir + "/_librsyncmodule.c", SourceDir + "/_librsyncmodule.c",
DistDir + "/setup.py"] + specfiles: DistDir + "/setup.py"] + specfiles:
assert not os.system("cp %s %s" % (filename, tardir)), filename shutil.copyfile(filename,
os.path.join(tardir, os.path.basename(filename)))
os.mkdir(tardir+"/rdiff_backup") os.mkdir(tardir+"/rdiff_backup")
for filename in ["eas_acls.py", "backup.py", "connection.py", "compare.py", for filename in ["eas_acls.py", "backup.py", "connection.py", "compare.py",
...@@ -118,8 +119,8 @@ def MakeTar(specfiles): ...@@ -118,8 +119,8 @@ def MakeTar(specfiles):
"SetConnections.py", "static.py", "SetConnections.py", "static.py",
"statistics.py", "TempFile.py", "Time.py", "statistics.py", "TempFile.py", "Time.py",
"user_group.py"]: "user_group.py"]:
assert not os.system("cp %s/%s %s/rdiff_backup" % shutil.copyfile(os.path.join(SourceDir, filename),
(SourceDir, filename, tardir)), filename os.path.join(tardir, "rdiff_backup", filename))
VersionedCopy("%s/Globals.py" % (SourceDir,), VersionedCopy("%s/Globals.py" % (SourceDir,),
"%s/rdiff_backup/Globals.py" % (tardir,)) "%s/rdiff_backup/Globals.py" % (tardir,))
...@@ -132,9 +133,17 @@ def MakeTar(specfiles): ...@@ -132,9 +133,17 @@ def MakeTar(specfiles):
os.chmod(os.path.join(tardir, "rdiff-backup"), 0644) os.chmod(os.path.join(tardir, "rdiff-backup"), 0644)
CopyMan(os.path.join(tardir, "rdiff-backup.1"), Version) CopyMan(os.path.join(tardir, "rdiff-backup.1"), Version)
CopyMan(os.path.join(tardir, "rdiff-backup-statistics.1"), Version) CopyMan(os.path.join(tardir, "rdiff-backup-statistics.1"), Version)
os.system("tar -cvzf %s %s" % (tarfile, tardir)) if os.name != 'nt':
os.system("tar -cvzf %s %s" % (tarfilename, tardir))
else:
import tarfile
tar = tarfile.open(tarfilename, 'w:gz')
for path in os.listdir(tardir):
tar.add(os.path.join(tardir, path))
tar.close()
shutil.rmtree(tardir) shutil.rmtree(tardir)
return tarfile return tarfilename
def MakeSpecFile(): def MakeSpecFile():
"""Create spec file using spec template""" """Create spec file using spec template"""
......
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