2
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
4
# Copyright 2002 Ben Escoto <ben@emerose.org>
5
# Copyright 2007 Kenneth Loafman <kenneth@loafman.com>
7
# This file is part of duplicity.
9
# Duplicity is free software; you can redistribute it and/or modify it
10
# under the terms of the GNU General Public License as published by the
11
# Free Software Foundation; either version 2 of the License, or (at your
12
# option) any later version.
14
# Duplicity is distributed in the hope that it will be useful, but
15
# WITHOUT ANY WARRANTY; without even the implied warranty of
16
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
# General Public License for more details.
19
# You should have received a copy of the GNU General Public License
20
# along with duplicity; if not, write to the Free Software Foundation,
21
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25
def command_line_error():
26
print ("Syntax: %s [-u|-m|-c] version_number old_version_number"
29
print "This program uploads the new files to the web page and moves the"
30
print "old files to the OLD directory."
33
if len(sys.argv) == 4:
35
old_version = sys.argv[3]
36
command = sys.argv[1][1:]
37
elif len(sys.argv) == 3:
38
command = sys.argv[1][1:]
39
if command in ('u', 'm', 'c'): version = old_version = sys.argv[2]
42
old_version = sys.argv[2]
44
else: command_line_error()
46
duplicity_mirror = "/home/ben/misc/html/mirror/duplicity"
48
tarball = "duplicity-%s.tar.gz" % version
49
srcrpm = "duplicity-%s-0.fdr.%d.src.rpm" % (version, fedora_release)
50
i386rpm = "duplicity-%s-0.fdr.%d.i386.rpm" % (version, fedora_release)
52
old_tarball = "duplicity-%s.tar.gz" % old_version
53
old_srcrpm = "duplicity-%s-1.src.rpm" % old_version
54
old_i386rpm = "duplicity-%s-1.i386.rpm" % old_version
58
assert not os.system(commandline)
61
run("scp %s %s %s bescoto@savannah.nongnu.org:/upload/duplicity"
62
% (tarball, srcrpm, i386rpm))
63
run("cp CHANGELOG bin/duplicity.1 bin/rdiffdir.1 %s" % (duplicity_mirror,))
64
run("rman -f html bin/duplicity.1 > %s/duplicity.1.html" % (duplicity_mirror,))
65
run("rman -f html bin/rdiffdir.1 > %s/rdiffdir.1.html" % (duplicity_mirror,))
68
"""Move old files from upload area to OLD directory
70
Unfortunately, savannah sftp is broken so apparently there is no
71
way to remove the old files.
74
olddir = os.path.join(duplicity_mirror, "OLD", old_version)
78
run("mv %s %s %s %s" % (old_tarball, old_srcrpm, old_i386rpm, olddir))
80
def checkin_webpage():
81
"""Check new web page into CVS"""
82
os.chdir(duplicity_mirror)
83
try: run("cvs add OLD/%s" % old_version)
84
except AssertionError: pass
85
run("cvs add -kb OLD/%s/%s OLD/%s/%s OLD/%s/%s" %
86
(old_version, old_tarball, old_version, old_i386rpm,
87
old_version, old_srcrpm))
91
if __name__ == "__main__":
92
if command == "u": upload_new()
93
elif command == "m": move_old()
94
elif command == "c": checkin_webpage()
95
elif command == "all":
99
else: command_line_error()