summaryrefslogtreecommitdiff
path: root/rdiff-backup/src/Make
blob: cadf9ea6832f7f820a8d08a9002ba04dc58fc5fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python

"""Read component files of rdiff-backup, and glue them together after
removing unnecessary bits."""

import os

def mystrip(filename):
	"""Open filename, read input, strip appropriately, and return contents"""
	fp = open(filename, "r")
	lines = fp.readlines()
	fp.close()

	i = 0
	while(lines[i][:60] !=
		  "############################################################"):
		i = i+1
		
	return "".join(lines[i:]).strip() + "\n\n\n"



files = ["globals.py", "static.py", "lazy.py", "log.py", "ttime.py",
		 "iterfile.py", "rlist.py", "rdiff.py", "connection.py",
		 "rpath.py", "robust.py", "rorpiter.py",
		 "destructive_stepping.py", "increment.py", "restore.py",
		 "manage.py", "filelist.py", "highlevel.py",
		 "setconnections.py", "main.py"]

os.system("cp header.py rdiff-backup")

outfp = open("rdiff-backup", "a")
for file in files:
	outfp.write(mystrip(file))
outfp.close()

os.system("chmod 755 rdiff-backup")