summaryrefslogtreecommitdiffstats
path: root/diff.cgi
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2003-11-12 21:41:46 +0000
committerLennart Poettering <lennart@poettering.net>2003-11-12 21:41:46 +0000
commitf4f5053170a6bf8e45c15ea0435b86f5fa1b6d06 (patch)
treea7353540ccbb8550d2889e8911ff331cabe018e2 /diff.cgi
parent8c4fde5b8f3ea7148cd3ad85c87f2c99a94e77da (diff)
initial commit
git-svn-id: file:///home/lennart/svn/public/syrep-chub/trunk@2 4c8cc7d0-f3cb-0310-ad32-ddc431b48844
Diffstat (limited to 'diff.cgi')
-rwxr-xr-xdiff.cgi21
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()