]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
no bug - add utility to toggle USE_NYTPROF (#323)
authorDylan William Hardison <dylan@hardison.net>
Sun, 31 Dec 2017 17:37:08 +0000 (12:37 -0500)
committerGitHub <noreply@github.com>
Sun, 31 Dec 2017 17:37:08 +0000 (12:37 -0500)
vagrant_support/apache.j2
vagrant_support/devtools.yml
vagrant_support/use-nytprof [new file with mode: 0644]

index 0a39125ce58e5228e0723fe88d9b75c4282821e2..722ebad9254470926445b54f62f7c4ce76ed7aad 100644 (file)
@@ -1,4 +1,5 @@
 PerlSwitches -wT
+PerlSetEnv USE_NYTPROF 0
 PerlConfigRequire /vagrant/mod_perl.pl
 
 <IfModule mpm_prefork_module>
index fa554ce3ce1745a97c6294c1dc3ae42e404d6947..3d4c9dbcdec789a5612329c5f56b81e835a61d8a 100644 (file)
@@ -18,6 +18,9 @@
 - name: copy re.pl
   copy: src=re.pl dest=/usr/local/bin/re.pl mode=0755
 
+- name: copy use-nytprof
+  copy: src=use-nytprof dest=/usr/local/bin/use-nytprof mode=0755
+
 - name: mkdir .re.pl
   file: path=/home/vagrant/.re.pl state=directory owner=vagrant group=vagrant mode=0775
 
diff --git a/vagrant_support/use-nytprof b/vagrant_support/use-nytprof
new file mode 100644 (file)
index 0000000..7c9dd3f
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/bash
+
+USE_NYTPROF="$1"
+if [[ -z $USE_NYTPROF ]]; then
+    USE_NYTPROF=1
+fi
+
+perl -e 'warn "Devel::NYTProf is ", $ARGV[0] ? "enabled" : "disabled", "\n";' "$USE_NYTPROF"
+
+sudo env USE_NYTPROF="$USE_NYTPROF" perl -i -pe 's/^\s*(PerlSetEnv\s+USE_NYTPROF\b).*$/$1 $ENV{USE_NYTPROF}/gmi' \
+    /etc/httpd/conf.d/bugzilla.conf
+sudo service httpd restart
\ No newline at end of file