diff options
Diffstat (limited to 'diff.cgi')
-rwxr-xr-x | diff.cgi | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/diff.cgi b/diff.cgi new file mode 100755 index 0000000..c6176b3 --- /dev/null +++ b/diff.cgi @@ -0,0 +1,21 @@ +#!/usr/bin/python + +import cgi, cgitb, os, time, urllib, sch +cgitb.enable() + +form = cgi.FieldStorage() + +if not form.has_key("fname"): + sch.error("No file name passed to script file") + +if not isinstance(form["fname"], list) or len(form["fname"]) != 2: + sch.error("You are required to pass exactly two file names.") + +fname = [form["fname"][0].value, form["fname"][1].value] + +if not sch.valid_fname(fname[0]) or not sch.valid_fname(fname[1]): + sch.error("Fuck off!") + +sch.print_header("Differences between '%s' and '%s'" % (fname[0], fname[1])) +sch.run_proc('/usr/local/bin/syrep --diff "%s/%s" "%s/%s"' % (sch.repository_directory, fname[0], sch.repository_directory, fname[1])) +sch.print_footer() |