From 63dd3061a164345095847e502bb5395bb5570c3a Mon Sep 17 00:00:00 2001 From: Mary Umoh Date: Tue, 8 Aug 2017 17:12:08 -0400 Subject: Bug 1386336 - Generate robots.txt at checksetup.pl from a template --- Bugzilla/Install/Filesystem.pm | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'Bugzilla/Install') diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm index adc1815c1..3114d64be 100644 --- a/Bugzilla/Install/Filesystem.pm +++ b/Bugzilla/Install/Filesystem.pm @@ -214,11 +214,10 @@ sub FILESYSTEM { 'Bugzilla.pm' => { perms => CGI_READ }, "$localconfig*" => { perms => CGI_READ }, - 'META.*' => { perms => CGI_READ }, - 'MYMETA.*' => { perms => CGI_READ }, + 'META.*' => { perms => CGI_READ }, + 'MYMETA.*' => { perms => CGI_READ }, 'bugzilla.dtd' => { perms => WS_SERVE }, 'mod_perl.pl' => { perms => WS_SERVE }, - 'robots.txt' => { perms => WS_SERVE }, '.htaccess' => { perms => WS_SERVE }, 'cvs-update.log' => { perms => WS_SERVE }, 'scripts/sendunsentbugmail.pl' => { perms => WS_EXECUTE }, @@ -405,6 +404,9 @@ sub FILESYSTEM { "skins/yui3.css" => { perms => CGI_READ, overwrite => 1, contents => $yui3_all_css }, + "robots.txt" => { perms => CGI_READ, + overwrite => 1, + contents => \&robots_txt}, ); # Because checksetup controls the creation of index.html separately @@ -952,6 +954,16 @@ sub _check_web_server_group { return $group_id; } +sub robots_txt { + my $output = ''; + my %vars; + Bugzilla::Hook::process("before_robots_txt", { vars => \%vars }); + Bugzilla->template->process("robots.txt.tmpl", \%vars, \$output) + or die Bugzilla->template->error; + return $output; +} + + 1; __END__ -- cgit v1.2.3-24-g4f1b