diff options
author | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2003-08-08 19:39:13 +0000 |
---|---|---|
committer | bescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109> | 2003-08-08 19:39:13 +0000 |
commit | 2b45f542a5fa4145674b9380bfacd284e8d03d8e (patch) | |
tree | 664ac6920c827afb1b1f1be9e1b556fece6ddfc6 /rdiff-backup/dist/makedist | |
parent | cbaa402e61505b757a02f9f007d3ebc3fd9caf36 (diff) | |
download | rdiff-backup-2b45f542a5fa4145674b9380bfacd284e8d03d8e.tar.gz |
Now date in rdiff-backup script changed automatically
git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@383 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109
Diffstat (limited to 'rdiff-backup/dist/makedist')
-rwxr-xr-x | rdiff-backup/dist/makedist | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/rdiff-backup/dist/makedist b/rdiff-backup/dist/makedist index 95c2cb5..926b686 100755 --- a/rdiff-backup/dist/makedist +++ b/rdiff-backup/dist/makedist @@ -57,8 +57,13 @@ def MakeFAQ(): html_fp.write("\n</body></html>") html_fp.close() -def VersionedCopy(source, dest): - """Copy source to dest, substituting $version with version""" +def VersionedCopy(source, dest, munge_date = 0): + """Copy source to dest, substituting $version with version + + If munge_date is true, also replace $date with string like "August + 8, 2003". + + """ fin = open(source, "rb") inbuf = fin.read() assert not fin.close() @@ -68,6 +73,12 @@ def VersionedCopy(source, dest): assert not re.search("\$version", outbuf), \ "Two $version strings found in the same file %s" % (source,) + if munge_date: + inbuf = outbuf + outbuf = re.sub("\$date", time.strftime("%B %d, %Y"), inbuf, 1) + if outbuf == inbuf: assert 0, "No $date string replaced" + assert not re.search("\$date", outbuf), "Two $date strings found" + fout = open(dest, "wb") fout.write(outbuf) assert not fout.close() @@ -103,7 +114,7 @@ def MakeTar(): VersionedCopy("%s/Globals.py" % (SourceDir,), "%s/rdiff_backup/Globals.py" % (tardir,)) - VersionedCopy("rdiff-backup", "%s/rdiff-backup" % (tardir,)) + VersionedCopy("rdiff-backup", "%s/rdiff-backup" % (tardir,), 1) VersionedCopy(DistDir + "/setup.py", "%s/setup.py" % (tardir,)) os.chmod(os.path.join(tardir, "setup.py"), 0755) |