Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee273fac authored by Steve Block's avatar Steve Block
Browse files

Use locals to make run_apache2.py more readable

Also fixes style

Change-Id: I8045b7deb5badfed7758be459d05c58d0ff2e390
parent da9f91a1
Loading
Loading
Loading
Loading
+23 −19
Original line number Diff line number Diff line
@@ -53,6 +53,10 @@ def main():
  android_tree_root = os.path.join(script_location, parent, parent, parent, parent, parent)
  android_tree_root = os.path.normpath(android_tree_root)

  # Paths relative to android_tree_root
  webkit_path = os.path.join("external", "webkit")
  http_conf_path = os.path.join(webkit_path, "LayoutTests", "http", "conf")

  # Prepare the command to set ${APACHE_RUN_USER} and ${APACHE_RUN_GROUP}
  envvars_path = os.path.join("/etc", "apache2", "envvars")
  export_envvars_cmd = "source " + envvars_path
@@ -63,7 +67,7 @@ def main():
  # Prepare the command to (re)start/stop the server with specified settings
  apache2_restart_cmd = "apache2 -k " + run_cmd
  directives  = " -c \"ServerRoot " + android_tree_root + "\""
  directives += " -c \"DocumentRoot " + os.path.join("external", "webkit") + "\""
  directives += " -c \"DocumentRoot " + webkit_path + "\""

  # This directive is commented out in apache2-debian-httpd.conf for some reason
  # However, it is useful to browse through tests in the browser, so it's added here.
@@ -74,13 +78,13 @@ def main():

  directives += " -c \"ErrorLog " + error_log_path +"\""
  directives += " -c \"CustomLog " + custom_log_path + " combined\""
  directives += " -c \"SSLCertificateFile " + os.path.join ("external", "webkit", "LayoutTests",
    "http", "conf", "webkit-httpd.pem") + "\""
  directives += " -c \"SSLCertificateFile " + os.path.join(http_conf_path, "webkit-httpd.pem") + \
    "\""
  directives += " -c \"User ${APACHE_RUN_USER}\""
  directives += " -c \"Group ${APACHE_RUN_GROUP}\""
  directives += " -C \"TypesConfig " + os.path.join("/etc", "mime.types") + "\""
  conf_file_cmd = " -f " + os.path.join(android_tree_root, "external", "webkit", "LayoutTests",
    "http", "conf", "apache2-debian-httpd.conf")
  conf_file_cmd = " -f " + \
    os.path.join(android_tree_root, http_conf_path, "apache2-debian-httpd.conf")

  # Try to execute the commands
  logging.info("Will " + run_cmd + " apache2 server.")