diff --git a/Makefile b/Makefile index fc730a0ef7e49201e719535fc5109c441975d109..56293222cfce4b2636085e67dec9c17238033e23 100644 --- a/Makefile +++ b/Makefile @@ -49,9 +49,9 @@ check: bjcp-2015-styleguide-orig.xml bjcp-2015-styleguide-de.xml @xmllint --noout --schema xsd/bjcp-styleguide-2015.xsd bjcp-2015-styleguide-de.xml install: - ssh z "if [ ! -d /var/www/bjcp-styleguide ] ; then sudo mkdir /var/www/bjcp-styleguide ; sudo chown frank.www-data /var/www/bjcp-styleguide ; sudo chmod u+rwx,g+rwxs /var/www/bjcp-styleguide ; touch /var/www/bjcp-styleguide/web/logfile ; mkdir /var/www/bjcp-styleguide/web/snippets; fi" + ssh z "cd /var/www ; if [ -d bjcp-2015-styleguide ] ; then cd bjcp-2015-styleguide ; git pull ; else git clone https://github.com/frsteinb/bjcp-2015-styleguide.git ; cd bjcp-2015-styleguide ; sudo mkdir web/snippets ; sudo chgrp -R www-data web ; sudo chmod g+ws web ; make ; fi" + #ssh z "if [ ! -d /var/www/bjcp-styleguide ] ; then sudo mkdir /var/www/bjcp-styleguide ; sudo chown frank.www-data /var/www/bjcp-styleguide ; sudo chmod u+rwx,g+rwxs /var/www/bjcp-styleguide ; touch /var/www/bjcp-styleguide/web/logfile ; mkdir /var/www/bjcp-styleguide/web/snippets; fi" #scp bjcp-2015-styleguide-de-edit.html web/bjcp-styleguide.css web/edit.css web/edit.js web/pell.css web/pell.js web/save.cgi z:/var/www/bjcp-styleguide/ - ssh z "cd /var/www/bjcp-styleguide ; if [ -d bjcp-2015-styleguide ] ; then cd bjcp-2015-styleguide ; git pull ; else git clone https://github.com/frsteinb/bjcp-2015-styleguide.git ; cd bjcp-2015-styleguide ; make ; fi" clean: @rm -rf orig diff --git a/web/save.cgi b/web/save.cgi index bd0208f7c25211612386ec45627cfb32d2b8473c..32842704b798e3bae3333ecf83ef4b6ee0b142a4 100755 --- a/web/save.cgi +++ b/web/save.cgi @@ -9,10 +9,9 @@ import codecs import time import datetime -DIR = "/var/www/bjcp-styleguide" -LOGFILE = "%s/logfile" % DIR -SNIPPETDIR = "%s/snippets" % DIR -REPODIR = "%s/bjcp-2015-styleguide" % DIR +DIR = "/var/www/bjcp-2015-styleguide" +LOGFILE = "%s/web/logfile" % DIR +SNIPPETDIR = "%s/web/snippets" % DIR LANG = "de" @@ -107,23 +106,23 @@ else: f.write('</styleguide>\n') f.close() -origfilename = "%s/orig/%s.xml" % (REPODIR, id) -translatedfilename = "%s/%s/%s.xml" % (REPODIR, LANG, id) +origfilename = "%s/orig/%s.xml" % (DIR, id) +translatedfilename = "%s/%s/%s.xml" % (DIR, LANG, id) if os.path.isfile(translatedfilename): log("updating translation file %s/%s.xml based on snippet" % (LANG, id)) - cmd = "xsltproc --stringparam snippet %s %s/xsl/bjcp-2015-styleguide-merge.xsl %s > %s.tmp ; mv %s.tmp %s" % (snippetfilename, REPODIR, translatedfilename, translatedfilename, translatedfilename, translatedfilename) + cmd = "xsltproc --stringparam snippet %s %s/xsl/bjcp-2015-styleguide-merge.xsl %s > %s.tmp ; mv %s.tmp %s" % (snippetfilename, DIR, translatedfilename, translatedfilename, translatedfilename, translatedfilename) os.system(cmd) log("updating all files (may take a minute)") - cmd = "make -C %s" % REPODIR + cmd = "make -C %s" % DIR os.system(cmd) log("done") elif os.path.isfile(origfilename): log("creating new translation file %s/%s.xml from orig/%s.xml and snippet" % (LANG, id, id)) - cmd = "xsltproc --stringparam snippet %s %s/xsl/bjcp-2015-styleguide-merge.xsl %s > %s" % (snippetfilename, REPODIR, origfilename, translatedfilename) + cmd = "xsltproc --stringparam snippet %s %s/xsl/bjcp-2015-styleguide-merge.xsl %s > %s" % (snippetfilename, DIR, origfilename, translatedfilename) os.system(cmd) log("updating all files (may take a minute)") - cmd = "make -C %s" % REPODIR + cmd = "make -C %s" % DIR os.system(cmd) log("done") else: