summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-08-08 19:39:13 +0000
committerbescoto <bescoto@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2003-08-08 19:39:13 +0000
commit2b45f542a5fa4145674b9380bfacd284e8d03d8e (patch)
tree664ac6920c827afb1b1f1be9e1b556fece6ddfc6
parentcbaa402e61505b757a02f9f007d3ebc3fd9caf36 (diff)
downloadrdiff-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
-rwxr-xr-xrdiff-backup/dist/makedist17
-rwxr-xr-xrdiff-backup/rdiff-backup4
2 files changed, 16 insertions, 5 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)
diff --git a/rdiff-backup/rdiff-backup b/rdiff-backup/rdiff-backup
index 0aafb65..48c67df 100755
--- a/rdiff-backup/rdiff-backup
+++ b/rdiff-backup/rdiff-backup
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# rdiff-backup -- Mirror files while keeping incremental changes
-# Version $version released October 5, 2002
-# Copyright (C) 2001, 2002 Ben Escoto <bescoto@stanford.edu>
+# Version $version released $date
+# Copyright (C) 2001, 2002, 2003 Ben Escoto <bescoto@stanford.edu>
#
# This program is licensed under the GNU General Public License (GPL).
# you can redistribute it and/or modify it under the terms of the GNU