[Rt-commit] rt branch, 4.2/upgrade-and-policy, created. rt-4.2.9-23-g8c11b51

Alex Vandiver alexmv at bestpractical.com
Thu Nov 13 19:54:18 EST 2014


The branch, 4.2/upgrade-and-policy has been created
        at  8c11b519ee09ab43713097f4d0f4d85ab247fc0c (commit)

- Log -----------------------------------------------------------------
commit 0d1cd53e3b4618b969adb66bb8571220f9fe1d23
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Mar 24 12:52:49 2014 -0400

    Move all etc/upgrade scrips to .in files, and standardize their init
    
    Fixes: I#18856

diff --git a/.gitignore b/.gitignore
index 159f895..855514b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,11 +4,15 @@
 /etc/RT_Config.pm
 /etc/upgrade/3.8-ical-extension
 /etc/upgrade/4.0-customfield-checkbox-extension
-/etc/upgrade/split-out-cf-categories
 /etc/upgrade/generate-rtaddressregexp
+/etc/upgrade/sanity-check-stylesheets
+/etc/upgrade/shrink-cgm-table
+/etc/upgrade/shrink-transactions-table
+/etc/upgrade/split-out-cf-categories
+/etc/upgrade/switch-templates-to
+/etc/upgrade/time-worked-history
 /etc/upgrade/upgrade-articles
 /etc/upgrade/vulnerable-passwords
-/etc/upgrade/switch-templates-to
 /lib/RT/Generated.pm
 /Makefile
 /t/data/gnupg/keyrings/random_seed
diff --git a/configure.ac b/configure.ac
index 8cd71d0..26fb8e9 100755
--- a/configure.ac
+++ b/configure.ac
@@ -429,11 +429,15 @@ dnl Binaries that should be +x
 AC_CONFIG_FILES([
                  etc/upgrade/3.8-ical-extension
                  etc/upgrade/4.0-customfield-checkbox-extension
-                 etc/upgrade/split-out-cf-categories
                  etc/upgrade/generate-rtaddressregexp
+                 etc/upgrade/sanity-check-stylesheets
+                 etc/upgrade/shrink-cgm-table
+                 etc/upgrade/shrink-transactions-table
+                 etc/upgrade/split-out-cf-categories
+                 etc/upgrade/switch-templates-to
+                 etc/upgrade/time-worked-history
                  etc/upgrade/upgrade-articles
                  etc/upgrade/vulnerable-passwords
-                 etc/upgrade/switch-templates-to
                  sbin/rt-attributes-viewer
                  sbin/rt-preferences-viewer
                  sbin/rt-session-viewer
diff --git a/docs/UPGRADING-3.8 b/docs/UPGRADING-3.8
index ba71777..9c3f93f 100644
--- a/docs/UPGRADING-3.8
+++ b/docs/UPGRADING-3.8
@@ -7,13 +7,13 @@ authentication itself, it may still store these weak password hashes -- using
 ExternalAuth does not guarantee that you are not vulnerable!  To upgrade
 stored passwords to a stronger hash, run:
 
-    perl etc/upgrade/vulnerable-passwords
+    /opt/rt4/etc/upgrade/vulnerable-passwords
 
 We have also proved that it's possible to delete a notable set of records from
 Transactions table without losing functionality. To delete these records, run
 the following script:
 
-    perl -I /opt/rt4/local/lib -I /opt/rt4/lib etc/upgrade/shrink_transactions_table.pl
+    /opt/rt4/etc/upgrade/shrink-transactions-table
 
 If you chose not to run the shrink_cgm_table.pl script when you upgraded to
 3.8, you should read more about it below and run it at this point.
@@ -63,7 +63,7 @@ Custom fields with categories can optionally be split out into hierarchical
 custom fields.  If you wish to convert your old category-based custom fields,
 run:
 
-    perl etc/upgrade/split-out-cf-categories
+    /opt/rt4/etc/upgrade/split-out-cf-categories
 
 It will prompt you for each custom field with categories that it finds, and
 the name of the custom field to create to store the categories.
@@ -138,7 +138,7 @@ CachedGroupMembers table without losing functionality; in fact, failing to do
 so may result in occasional problems where RT miscounts users, particularly in
 the chart functionality.  To delete these records run the following script:
 
-    perl -I /opt/rt4/local/lib -I /opt/rt4/lib etc/upgrade/shrink_cgm_table.pl
+    /opt/rt4/etc/upgrade/shrink-cgm-table
 
 After you run this, you will have significantly reduced the number of records
 in your CachedGroupMembers table, and may need to tell your database to
@@ -174,7 +174,7 @@ RT::Action::LinearEscalate extension has been integrated into core, so you
 MUST uninstall it before upgrading.
 
 RT::Extension::iCal has been integrated into core, so you MUST uninstall it
-before upgrading. In addition, you must run etc/upgrade/3.8-ical-extension
+before upgrading. In addition, you must run /opt/rt4/etc/upgrade/3.8-ical-extension
 script to convert old data.
 
 
diff --git a/docs/UPGRADING-4.2 b/docs/UPGRADING-4.2
index ccd8575..2ed98e4 100644
--- a/docs/UPGRADING-4.2
+++ b/docs/UPGRADING-4.2
@@ -131,7 +131,7 @@ extra transactions, and keeping the summed time spent consistent.
 In order to fix the history records of old ticket you can run the following
 command:
 
-    perl -I /opt/rt4/local/lib/ -I /opt/rt4/lib/ etc/upgrade/time-worked-history.pl
+    /opt/rt4/etc/upgrade/time-worked-history
 
 This command deletes records from the Transactions table. This script can only fix
 TimeWorked mismatches, but not TimeLeft or TimeEstimated.
diff --git a/etc/upgrade/3.8-ical-extension.in b/etc/upgrade/3.8-ical-extension.in
index 47b1846..ebb03a1 100644
--- a/etc/upgrade/3.8-ical-extension.in
+++ b/etc/upgrade/3.8-ical-extension.in
@@ -46,16 +46,16 @@
 # those contributions and any derivatives thereof.
 #
 # END BPS TAGGED BLOCK }}}
+use 5.10.1;
 use strict;
 use warnings;
 
 use lib "@LOCAL_LIB_PATH@";
 use lib "@RT_LIB_PATH@";
 
+use RT -init;
 
-use RT;
-RT::LoadConfig();
-RT::Init();
+$| = 1;
 
 use RT::Attributes;
 my $attrs = RT::Attributes->new( RT->SystemUser );
diff --git a/etc/upgrade/4.0-customfield-checkbox-extension.in b/etc/upgrade/4.0-customfield-checkbox-extension.in
index 9e0d1bf..74dfbf4 100644
--- a/etc/upgrade/4.0-customfield-checkbox-extension.in
+++ b/etc/upgrade/4.0-customfield-checkbox-extension.in
@@ -46,15 +46,16 @@
 # those contributions and any derivatives thereof.
 #
 # END BPS TAGGED BLOCK }}}
+use 5.10.1;
 use strict;
 use warnings;
 
 use lib "@LOCAL_LIB_PATH@";
 use lib "@RT_LIB_PATH@";
 
-use RT;
-RT::LoadConfig();
-RT::Init();
+use RT -init;
+
+$| = 1;
 
 use RT::CustomFields;
 my $cfs = RT::CustomFields->new( RT->SystemUser );
diff --git a/etc/upgrade/generate-rtaddressregexp.in b/etc/upgrade/generate-rtaddressregexp.in
index 1f91c9f..2cb207e 100644
--- a/etc/upgrade/generate-rtaddressregexp.in
+++ b/etc/upgrade/generate-rtaddressregexp.in
@@ -46,16 +46,15 @@
 # those contributions and any derivatives thereof.
 #
 # END BPS TAGGED BLOCK }}}
+use 5.10.1;
 use strict;
 use warnings;
 
 use lib "@LOCAL_LIB_PATH@";
 use lib "@RT_LIB_PATH@";
 
-use RT;
-RT::LoadConfig();
+use RT -init;
 RT->Config->Set('LogToSTDERR' => 'debug');
-RT::Init();
 
 $| = 1;
 
diff --git a/etc/upgrade/sanity-check-stylesheets.pl b/etc/upgrade/sanity-check-stylesheets.in
similarity index 97%
rename from etc/upgrade/sanity-check-stylesheets.pl
rename to etc/upgrade/sanity-check-stylesheets.in
index 2019f25..ded82eb 100644
--- a/etc/upgrade/sanity-check-stylesheets.pl
+++ b/etc/upgrade/sanity-check-stylesheets.in
@@ -1,3 +1,4 @@
+#!@PERL@
 # BEGIN BPS TAGGED BLOCK {{{
 #
 # COPYRIGHT:
@@ -45,13 +46,15 @@
 # those contributions and any derivatives thereof.
 #
 # END BPS TAGGED BLOCK }}}
+use 5.10.1;
 use strict;
 use warnings;
 
-use RT;
-RT::LoadConfig();
+use lib "@LOCAL_LIB_PATH@";
+use lib "@RT_LIB_PATH@";
+
+use RT -init;
 RT->Config->Set('LogToSTDERR' => 'debug');
-RT::Init();
 
 $| = 1;
 
diff --git a/etc/upgrade/shrink_cgm_table.pl b/etc/upgrade/shrink-cgm-table.in
similarity index 97%
rename from etc/upgrade/shrink_cgm_table.pl
rename to etc/upgrade/shrink-cgm-table.in
index 7157b20..cb15daf 100644
--- a/etc/upgrade/shrink_cgm_table.pl
+++ b/etc/upgrade/shrink-cgm-table.in
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!@PERL@
 # BEGIN BPS TAGGED BLOCK {{{
 #
 # COPYRIGHT:
@@ -50,10 +50,13 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use RT;
-RT::LoadConfig();
+use lib "@LOCAL_LIB_PATH@";
+use lib "@RT_LIB_PATH@";
+
+use RT -init;
 RT->Config->Set('LogToSTDERR' => 'debug');
-RT::Init();
+
+$| = 1;
 
 use RT::CachedGroupMembers;
 my $cgms = RT::CachedGroupMembers->new( RT->SystemUser );
@@ -89,7 +92,6 @@ $cgms->Limit(
     ENTRYAGGREGATOR => 'AND',
 );
 
-$| = 1;
 my $total = $cgms->Count;
 my $i = 0;
 
diff --git a/etc/upgrade/shrink_transactions_table.pl b/etc/upgrade/shrink-transactions-table.in
similarity index 97%
rename from etc/upgrade/shrink_transactions_table.pl
rename to etc/upgrade/shrink-transactions-table.in
index 0b78f0f..be14cb3 100644
--- a/etc/upgrade/shrink_transactions_table.pl
+++ b/etc/upgrade/shrink-transactions-table.in
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!@PERL@
 # BEGIN BPS TAGGED BLOCK {{{
 #
 # COPYRIGHT:
@@ -50,10 +50,13 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use RT;
-RT::LoadConfig();
+use lib "@LOCAL_LIB_PATH@";
+use lib "@RT_LIB_PATH@";
+
+use RT -init;
 RT->Config->Set('LogToSTDERR' => 'debug');
-RT::Init();
+
+$| = 1;
 
 use RT::Transactions;
 my $txns = RT::Transactions->new( RT->SystemUser );
@@ -91,7 +94,6 @@ $txns->Limit(
     ENTRYAGGREGATOR => 'AND',
 );
 
-$| = 1;
 my $total = $txns->Count;
 my $i = 0;
 
diff --git a/etc/upgrade/split-out-cf-categories.in b/etc/upgrade/split-out-cf-categories.in
index a774501..12ce5ee 100644
--- a/etc/upgrade/split-out-cf-categories.in
+++ b/etc/upgrade/split-out-cf-categories.in
@@ -46,16 +46,15 @@
 # those contributions and any derivatives thereof.
 #
 # END BPS TAGGED BLOCK }}}
+use 5.10.1;
 use strict;
 use warnings;
 
 use lib "@LOCAL_LIB_PATH@";
 use lib "@RT_LIB_PATH@";
 
-use RT;
-RT::LoadConfig();
+use RT -init;
 RT->Config->Set('LogToSTDERR' => 'debug');
-RT::Init();
 
 $| = 1;
 
diff --git a/etc/upgrade/switch-templates-to.in b/etc/upgrade/switch-templates-to.in
index 974ec64..f41ff68 100644
--- a/etc/upgrade/switch-templates-to.in
+++ b/etc/upgrade/switch-templates-to.in
@@ -46,13 +46,17 @@
 # those contributions and any derivatives thereof.
 #
 # END BPS TAGGED BLOCK }}}
+use 5.10.1;
 use strict;
 use warnings;
 
 use lib "@LOCAL_LIB_PATH@";
 use lib "@RT_LIB_PATH@";
 
-use RT;
+use RT -init;
+RT->Config->Set('LogToSTDERR' => 'info');
+
+$| = 1;
 
 my $to = shift || '';
 my $from;
@@ -66,11 +70,6 @@ if ($to =~ /html|text/i) {
     exit 1;
 }
 
-RT::LoadConfig();
-RT->Config->Set('LogToSTDERR' => 'info');
-RT::Init();
-
-$| = 1;
 
 my @templates = (
     "Autoreply",
diff --git a/etc/upgrade/time-worked-history.pl b/etc/upgrade/time-worked-history.in
similarity index 98%
rename from etc/upgrade/time-worked-history.pl
rename to etc/upgrade/time-worked-history.in
index 46961aa..1596265 100644
--- a/etc/upgrade/time-worked-history.pl
+++ b/etc/upgrade/time-worked-history.in
@@ -1,4 +1,4 @@
-#!/usr/bin/env perl
+#!@PERL@
 # BEGIN BPS TAGGED BLOCK {{{
 #
 # COPYRIGHT:
@@ -50,10 +50,11 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use RT;
-RT::LoadConfig();
+use lib "@LOCAL_LIB_PATH@";
+use lib "@RT_LIB_PATH@";
+
+use RT -init;
 RT->Config->Set('LogToSTDERR' => 'info');
-RT::Init();
 
 my $dbh = $RT::Handle->dbh;
 my $ids = $dbh->selectcol_arrayref(
diff --git a/etc/upgrade/upgrade-articles.in b/etc/upgrade/upgrade-articles.in
index 17128e9..2619c11 100644
--- a/etc/upgrade/upgrade-articles.in
+++ b/etc/upgrade/upgrade-articles.in
@@ -46,16 +46,16 @@
 # those contributions and any derivatives thereof.
 #
 # END BPS TAGGED BLOCK }}}
+use 5.10.1;
 use strict;
 use warnings;
 
 use lib "@LOCAL_LIB_PATH@";
 use lib "@RT_LIB_PATH@";
 
-use RT;
-RT::LoadConfig();
+use RT -init;
+
 RT->Config->Set('LogToSTDERR' => 'debug');
-RT::Init();
 
 $| = 1;
 
diff --git a/etc/upgrade/vulnerable-passwords.in b/etc/upgrade/vulnerable-passwords.in
old mode 100755
new mode 100644
index b1027a4..f16319f
--- a/etc/upgrade/vulnerable-passwords.in
+++ b/etc/upgrade/vulnerable-passwords.in
@@ -46,15 +46,14 @@
 # those contributions and any derivatives thereof.
 #
 # END BPS TAGGED BLOCK }}}
+use 5.10.1;
 use strict;
 use warnings;
 
 use lib "@LOCAL_LIB_PATH@";
 use lib "@RT_LIB_PATH@";
 
-use RT;
-RT::LoadConfig;
-RT::Init;
+use RT -init;
 
 $| = 1;
 

commit 79c62e19dfa38dcbe743b4810998109b70cfdc22
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Jul 21 17:27:21 2014 -0400

    Add policy tests for etc/upgrade/ files

diff --git a/t/99-policy.t b/t/99-policy.t
index 7e6d4a3..e0212ba 100644
--- a/t/99-policy.t
+++ b/t/99-policy.t
@@ -135,4 +135,10 @@ check( $_, exec => -1, bps_tag => -1 )
 check( $_, warnings => 1, strict => 1, compile_perl => 1, no_tabs => 1 )
     for grep {m{^etc/upgrade/.*/content$}} @files;
 
+check( $_, shebang => 1, exec => 1, warnings => 1, strict => 1, bps_tag => 1, no_tabs => 1 )
+    for grep {m{^etc/upgrade/[^/]+$}} @files;
+
+check( $_, compile_perl => 1, exec => 1 )
+    for grep{ -f $_} map {s/\.in$//; $_} grep {m{^etc/upgrade/[^/]+$}} @files;
+
 done_testing;

commit 2f15a17be53c82a3d2c6816c3dddf04f7c7ad687
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Jul 21 17:29:33 2014 -0400

    \Q and \E only affect within their given string
    
    Splitting the \Q and \E into differing double-quoted strings has no
    effect -- and as $domain is not substituted into either of them, it does
    not gain the beneficial effects.  That is, if $domain is "example.com"
    the generated string will contain "(?:foo|bar)\@example.com" without the
    "." escaped.
    
    Embed the $domain substitution between the \Q and \E so it is effective.
    This was detected by a warning found in the previous commit.

diff --git a/etc/upgrade/generate-rtaddressregexp.in b/etc/upgrade/generate-rtaddressregexp.in
index 2cb207e..84d8ad1 100644
--- a/etc/upgrade/generate-rtaddressregexp.in
+++ b/etc/upgrade/generate-rtaddressregexp.in
@@ -85,7 +85,7 @@ for my $domain (sort keys %merged) {
         }
     }
     if (@addresses > 1) {
-        push @domains, "(?:".join("|", @addresses).")\Q\@".$domain."\E";
+        push @domains, "(?:".join("|", @addresses).")\Q\@$domain\E";
     } else {
         push @domains, "$addresses[0]\Q\@$domain\E";
     }

commit 73d84b3c8a83149e9d76c9ada0a5d146ec5a4ea3
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Jul 21 17:31:30 2014 -0400

    Make sure the non-.in bin/ and sbin/ files are +x

diff --git a/t/99-policy.t b/t/99-policy.t
index e0212ba..79f2bba 100644
--- a/t/99-policy.t
+++ b/t/99-policy.t
@@ -111,7 +111,7 @@ check( $_, shebang => -1, exec => -1, warnings => 1, strict => 1, bps_tag => -1,
 check( $_, shebang => 1, exec => 1, warnings => 1, strict => 1, bps_tag => 1, no_tabs => 1 )
     for grep {m{^s?bin/}} @files;
 
-check( $_, compile_perl => 1 )
+check( $_, compile_perl => 1, exec => 1 )
     for grep { -f $_ } map { s/\.in$//; $_ } grep {m{^s?bin/}} @files;
 
 check( $_, shebang => 1, exec => 1, warnings => 1, strict => 1, bps_tag => 1, no_tabs => 1 )

commit f76094580c61afae4d84048a9a7970023655fadf
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Jul 21 17:31:50 2014 -0400

    There is no reason for config, acl, schema, and initialdata to be +x

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
old mode 100755
new mode 100644
diff --git a/etc/RT_SiteConfig.pm b/etc/RT_SiteConfig.pm
old mode 100755
new mode 100644
diff --git a/etc/acl.Oracle b/etc/acl.Oracle
old mode 100755
new mode 100644
diff --git a/etc/acl.Pg b/etc/acl.Pg
old mode 100755
new mode 100644
diff --git a/etc/acl.mysql b/etc/acl.mysql
old mode 100755
new mode 100644
diff --git a/etc/schema.Oracle b/etc/schema.Oracle
old mode 100755
new mode 100644
diff --git a/etc/schema.Pg b/etc/schema.Pg
old mode 100755
new mode 100644
diff --git a/etc/schema.SQLite b/etc/schema.SQLite
old mode 100755
new mode 100644
diff --git a/etc/schema.mysql b/etc/schema.mysql
old mode 100755
new mode 100644
diff --git a/t/99-policy.t b/t/99-policy.t
index 79f2bba..16fc5be 100644
--- a/t/99-policy.t
+++ b/t/99-policy.t
@@ -130,6 +130,9 @@ check( $_, exec => -1 )
     for grep {m{^t/data/}} @files;
 
 check( $_, exec => -1, bps_tag => -1 )
+    for grep {m{^etc/[^/]+$}} @files;
+
+check( $_, exec => -1, bps_tag => -1 )
     for grep {m{^etc/upgrade/[^/]+/}} @files;
 
 check( $_, warnings => 1, strict => 1, compile_perl => 1, no_tabs => 1 )

commit 8a078072eea01dcf913691946cbc12daa106a307
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Jul 21 17:42:05 2014 -0400

    There is no reason for doc files to be +x

diff --git a/docs/schema.dot b/docs/schema.dot
old mode 100755
new mode 100644
diff --git a/t/99-policy.t b/t/99-policy.t
index 16fc5be..b08ab96 100644
--- a/t/99-policy.t
+++ b/t/99-policy.t
@@ -11,7 +11,7 @@ find( { wanted   => sub {
             $File::Find::prune = 1 if $_ eq "t/tmp" or m{/\.git$};
         },
         no_chdir => 1 },
-      qw{etc lib share t bin sbin devel/tools} );
+      qw{etc lib share t bin sbin devel/tools docs} );
 
 if ( my $dir = `git rev-parse --git-dir 2>/dev/null` ) {
     # We're in a git repo, use the ignore list
@@ -144,4 +144,7 @@ check( $_, shebang => 1, exec => 1, warnings => 1, strict => 1, bps_tag => 1, no
 check( $_, compile_perl => 1, exec => 1 )
     for grep{ -f $_} map {s/\.in$//; $_} grep {m{^etc/upgrade/[^/]+$}} @files;
 
+check( $_, exec => -1 )
+    for grep {m{^docs/}} @files;
+
 done_testing;

commit 413b4495d845f66b83bb6aae8866fbacc2de09b8
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Mon Jul 21 17:43:22 2014 -0400

    These top-level files need not be +x

diff --git a/Makefile.in b/Makefile.in
old mode 100755
new mode 100644
diff --git a/aclocal.m4 b/aclocal.m4
old mode 100755
new mode 100644
diff --git a/config.layout b/config.layout
old mode 100755
new mode 100644

commit 23d6d4eb83277df3c493f0fc6043e2684787c0fc
Author: Wallace Reis <wreis at bestpractical.com>
Date:   Thu Nov 13 19:51:34 2014 -0200

    Prepend default install location to all command-line scripts
    
    Explicitly include the default installation path to all commands in
    documenataion.  Many of these lacked them because previous to efaf506b,
    etc/upgrade/ was not installed.

diff --git a/README b/README
index 8c0b65d..90d1b34 100644
--- a/README
+++ b/README
@@ -175,7 +175,7 @@ GENERAL INSTALLATION
     logout for inactive sessions. For more information about how to do
     that, run:
 
-        perldoc /path/to/rt/sbin/rt-clean-sessions
+        perldoc /opt/rt4/sbin/rt-clean-sessions
 
  8) Set up users, groups, queues, scrips and access control.
 
diff --git a/docs/UPGRADING-4.0 b/docs/UPGRADING-4.0
index 766964f..fd0d738 100644
--- a/docs/UPGRADING-4.0
+++ b/docs/UPGRADING-4.0
@@ -34,7 +34,8 @@ new configuration.
 
 RT::Extension::CustomField::Checkbox has been integrated into core, so you
 MUST uninstall it before upgrading. In addition, you must run
-etc/upgrade/4.0-customfield-checkbox-extension script to convert old data.
+/opt/rt4/etc/upgrade/4.0-customfield-checkbox-extension script to convert old
+data.
 
 =head2 RT_SiteConfig.pm
 
@@ -60,7 +61,7 @@ the new schema.
 
 RT4 now includes an Articles functionality, merged from RTFM.  You should not
 install and enable the RT::FM plugin separately on RT 4.  If you have existing
-data in RTFM, you can use the etc/upgrade/upgrade-articles script to upgrade
+data in RTFM, you can use the /opt/rt4/etc/upgrade/upgrade-articles script to upgrade
 that data.
 
 When running normal upgrade scripts, RT will warn if it finds existing RTFM
@@ -73,7 +74,7 @@ spectacularly.  Do *not* run this except on a fresh upgrade of RT.
 
 You can run this as
 
-  etc/upgrade/upgrade-articles
+  /opt/rt4/etc/upgrade/upgrade-articles
 
 It will ouput a lot of data about what it is changing.  You should review this
 for errors.
@@ -245,7 +246,7 @@ version of DBD::Pg RT will stop the upgrade during the 3.9.8 step and
 remind you to upgrade DBD::Pg.  If this happens, you can re-start your
 upgrade by running:
 
-   ./sbin/rt-setup-database --action insert --datadir etc/upgrade/3.9.8/
+   /opt/rt4/sbin/rt-setup-database --action insert --datadir etc/upgrade/3.9.8/
 
 Followed by re-running make upgrade-database and answering 3.9.8 when
 prompted for which RT version you're upgrading from.
diff --git a/docs/automating_rt.pod b/docs/automating_rt.pod
index 5636d41..11960c3 100644
--- a/docs/automating_rt.pod
+++ b/docs/automating_rt.pod
@@ -15,7 +15,7 @@ different ways you can automate tasks.
 
 All of the options for L<rt-crontool> are documented with the tool itself:
 
-    $ perldoc bin/rt-crontool
+    $ perldoc /opt/rt4/bin/rt-crontool
 
 and on the Best Practical web site.
 
@@ -62,7 +62,7 @@ Starting with a simple example, this command performs a search and
 displays output, but doesn't do anything to the returned tickets.
 This can be useful for safely testing search criteria.
 
-    bin/rt-crontool --search RT::Search::FromSQL \
+    /opt/rt4/bin/rt-crontool --search RT::Search::FromSQL \
         --search-arg "Owner = 'root'" \
         --action RT::Action \
         --verbose \
@@ -84,7 +84,7 @@ You can auto-set status based on any criteria you can define in
 a TicketSQL statement. For example, this command will resolve all
 active tickets that haven't been acted on in a month or more:
 
-    bin/rt-crontool --search RT::Search::FromSQL \
+    /opt/rt4/bin/rt-crontool --search RT::Search::FromSQL \
         --search-arg "(Status != 'resolved' AND Status != 'rejected') \
                        AND LastUpdated <= '1 month ago'" \
         --action RT::Action::SetStatus \
@@ -114,7 +114,7 @@ the selected tickets, and the transition must be allowed.
 The following command records a comment on all tickets returned from the
 query -- in this case, tickets that are new and unowned after 3 days.
 
-    bin/rt-crontool --search RT::Search::FromSQL \
+    /opt/rt4/bin/rt-crontool --search RT::Search::FromSQL \
         --search-arg "Owner = 'Nobody' AND Status = 'new' \
                       AND Created < '3 days ago'" \
         --action RT::Action::RecordComment \
@@ -138,7 +138,7 @@ using the L<RT::Action::RecordCorrespondence> module.
 While the example above sends notifications as a side-effect of recording
 a comment, you can also send notifications directly.
 
-    bin/rt-crontool --search RT::Search::FromSQL \
+    /opt/rt4/bin/rt-crontool --search RT::Search::FromSQL \
         --search-arg "(Status != 'resolved' AND Status != 'rejected') \
                       AND Queue = 'Project Work'" \
         --condition RT::Condition::Overdue \
@@ -178,7 +178,7 @@ date and are still not resolved have priority escalated automatically.
 
 This command escalates tickets in a designated queue:
 
-    bin/rt-crontool --search RT::Search::ActiveTicketsInQueue \
+    /opt/rt4/bin/rt-crontool --search RT::Search::ActiveTicketsInQueue \
         --search-arg "General" \
         --action RT::Action::EscalatePriority
 
@@ -186,7 +186,7 @@ The C<--search-arg> is the name of the queue in which to escalate tickets.
 As shown in previous examples, you can also set your criteria using a
 TicketSQL query as well:
 
-    bin/rt-crontool --search RT::Search::FromSQL \
+    /opt/rt4/bin/rt-crontool --search RT::Search::FromSQL \
         --search-arg "(Status='new' OR Status='open') AND Due > 'Jan 1, 1970'" \
         --action RT::Action::EscalatePriority
 
@@ -224,7 +224,7 @@ appropriate transaction object for your conditions and actions. For
 example, if you had an action you wanted to perform based on the content
 of the last reply on stalled tickets, you could do something like:
 
-    bin/rt-crontool --search RT::Search::FromSQL \
+    /opt/rt4/bin/rt-crontool --search RT::Search::FromSQL \
         --search-arg "Status = 'stalled' AND Queue = 'General'" \
         --action RT::Action::CheckLastCorrespond \
         --transaction last \
diff --git a/docs/full_text_indexing.pod b/docs/full_text_indexing.pod
index 6b0025d..211326f 100644
--- a/docs/full_text_indexing.pod
+++ b/docs/full_text_indexing.pod
@@ -21,19 +21,19 @@ Postgres 8.3 and above support full-text searching natively; to set up
 the required C<ts_vector> column, and create either a C<GiN> or C<GiST>
 index on it, run:
 
-    sbin/rt-setup-fulltext-index
+    /opt/rt4/sbin/rt-setup-fulltext-index
 
 If you have a non-standard database administrator username or password,
 you may need to pass the C<--dba> or C<--dba-password> options:
 
-    sbin/rt-setup-fulltext-index --dba postgres --dba-password secret
+    /opt/rt4/sbin/rt-setup-fulltext-index --dba postgres --dba-password secret
 
 This will also output an appropriate C<%FullTextSearch> configuration to
 add to your F<RT_SiteConfig.pm>; you will need to restart your webserver
 after making these changes.  However, the index will also need to be
 filled before it can be used.  To update the index initially, run:
 
-    sbin/rt-fulltext-indexer --all
+    /opt/rt4/sbin/rt-fulltext-indexer --all
 
 This will tokenize and index all existing attachments in your database;
 it may take quite a while if your database already has a large number of
@@ -43,7 +43,7 @@ tickets in it.
 
 To keep the index up-to-date, you will need to run:
 
-    sbin/rt-fulltext-indexer
+    /opt/rt4/sbin/rt-fulltext-indexer
 
 ...at regular intervals.  By default, this will only tokenize up to 100
 tickets at a time; you can adjust this upwards by passing
@@ -57,7 +57,7 @@ and end those processes normally (with exit code 0) using the C<--quiet>
 option; this is particularly useful when running the command via
 C<cron>:
 
-    sbin/rt-fulltext-indexer --quiet
+    /opt/rt4/sbin/rt-fulltext-indexer --quiet
 
 =head1 MYSQL
 
@@ -82,12 +82,12 @@ L<http://sphinxsearch.com/docs/current.html#sphinxse-installing>.
 Once MySQL has been recompiled with SphinxSE, and Sphinx itself is
 installed, you may create the required SphinxSE communication table via:
 
-    sbin/rt-setup-fulltext-index
+    /opt/rt4/sbin/rt-setup-fulltext-index
 
 If you have a non-standard database administrator username or password,
 you may need to pass the C<--dba> or C<--dba-password> options:
 
-    sbin/rt-setup-fulltext-index --dba root --dba-password secret
+    /opt/rt4/sbin/rt-setup-fulltext-index --dba root --dba-password secret
 
 This will also provide you with the appropriate C<%FullTextSearch>
 configuration to add to your F<RT_SiteConfig.pm>; you will need to
@@ -142,12 +142,12 @@ C<RT_SiteConfig.pm> must be updated.
 Oracle supports full-text indexing natively using the Oracle Text
 package.  Once Oracle Text is installed and configured, run:
 
-    sbin/rt-setup-fulltext-index
+    /opt/rt4/sbin/rt-setup-fulltext-index
 
 If you have a non-standard database administrator username or password,
 you may need to pass the C<--dba> or C<--dba-password> options:
 
-    sbin/rt-setup-fulltext-index --dba sysdba --dba-password secret
+    /opt/rt4/sbin/rt-setup-fulltext-index --dba sysdba --dba-password secret
 
 This will create an Oracle CONTEXT index on the Content column in the
 Attachments table, as well as several preferences, functions and
@@ -160,7 +160,7 @@ F<RT_SiteConfig>.
 To update the index, you will need to run the following at regular
 intervals:
 
-    sbin/rt-fulltext-indexer
+    /opt/rt4/sbin/rt-fulltext-indexer
 
 This, in effect, simply runs:
 
@@ -180,7 +180,7 @@ and end those processes normally (with exit code 0) using the C<--quiet>
 option; this is particularly useful when running the command via
 C<cron>:
 
-    sbin/rt-fulltext-indexer --quiet
+    /opt/rt4/sbin/rt-fulltext-indexer --quiet
 
 Instead of being run via C<cron>, this may instead be run via a
 DBMS_JOB; read the B<Managing DML Operations for a CONTEXT Index>
diff --git a/docs/incremental-export/README b/docs/incremental-export/README
index 86503c4..14716bc 100644
--- a/docs/incremental-export/README
+++ b/docs/incremental-export/README
@@ -23,7 +23,7 @@ For additional information on the following steps, please review
 rt-importer --help and rt-serializer --help
 
 During your final cutover, you will bring down the production web and mail servers for the final time.
-Run $RTHOME/sbin/rt-serializer --incremental
+Run /opt/rt4/sbin/rt-serializer --incremental
 This will create a directory named $Organization:date
 Once this has completed, you will copy this directory to the new server.
-On the new server, run $RTHOME/sbin/rt-importer $Organization:date
+On the new server, run /opt/rt4/sbin/rt-importer $Organization:date
diff --git a/docs/initialdata.pod b/docs/initialdata.pod
index ac55dcf..44a93ed 100644
--- a/docs/initialdata.pod
+++ b/docs/initialdata.pod
@@ -477,7 +477,7 @@ to easily create B<Classes>, B<Topics>, or B<Articles> from initialdata files.
 
 =head1 Running an initialdata file
 
-    sbin/rt-setup-database --action insert --datafile /path/to/your/initialdata
+    /opt/rt4/sbin/rt-setup-database --action insert --datafile /path/to/your/initialdata
 
 This may prompt you for a database password.
 
diff --git a/etc/upgrade/3.9.8/content b/etc/upgrade/3.9.8/content
index 0305aa9..e9a1a32 100644
--- a/etc/upgrade/3.9.8/content
+++ b/etc/upgrade/3.9.8/content
@@ -20,6 +20,6 @@ our @Initial = sub {
     my $result = $dbh->selectall_arrayref("SELECT count(*) AS articlecount FROM FM_Articles", { Slice => {} } );
 
     if ($result->[0]{articlecount} > 0) {
-        RT->Logger->error("You appear to have RTFM Articles.  You can upgrade using the etc/upgrade/upgrade-articles script.  Read more about it in docs/UPGRADING-4.0");
+        RT->Logger->error("You appear to have RTFM Articles.  You can upgrade using the /opt/rt4/etc/upgrade/upgrade-articles script.  Read more about it in docs/UPGRADING-4.0");
     }
 };
diff --git a/lib/RT/Test.pm b/lib/RT/Test.pm
index e4950fd..aa03a9b 100644
--- a/lib/RT/Test.pm
+++ b/lib/RT/Test.pm
@@ -1072,7 +1072,7 @@ sub add_rights {
 
 =head2 switch_templates_to TYPE
 
-This runs etc/upgrade/switch-templates-to in order to change the templates from
+This runs /opt/rt4/etc/upgrade/switch-templates-to in order to change the templates from
 HTML to text or vice versa.  TYPE is the type to switch to, either C<html> or
 C<text>.
 
@@ -1102,7 +1102,7 @@ sub switch_templates_ok {
     
     if ($exit >> 8) {
         Test::More::fail("Switched templates to $type cleanly");
-        diag("**** etc/upgrade/switch-templates-to exited with ".($exit >> 8).":\n$output");
+        diag("**** $RT::EtcPath/upgrade/switch-templates-to exited with ".($exit >> 8).":\n$output");
     } else {
         Test::More::pass("Switched templates to $type cleanly");
     }
diff --git a/sbin/rt-email-dashboards.in b/sbin/rt-email-dashboards.in
index 9688edc..2b7e6a1 100644
--- a/sbin/rt-email-dashboards.in
+++ b/sbin/rt-email-dashboards.in
@@ -122,7 +122,7 @@ are taken to be in the user's timezone if available, UTC otherwise.
 You'll need to have cron run this script every hour. Here's an example crontab
 entry to do this.
 
-    0 * * * * @PERL@ /opt/rt4/local/sbin/rt-email-dashboards
+    0 * * * * /opt/rt4/local/sbin/rt-email-dashboards
 
 This will run the script every hour on the hour. This may need some further
 tweaking to be run as the correct user.
diff --git a/sbin/rt-importer.in b/sbin/rt-importer.in
index e8a3942..7a17f05 100644
--- a/sbin/rt-importer.in
+++ b/sbin/rt-importer.in
@@ -274,7 +274,7 @@ which are only suitable for inserting into a schema with no data in it.
 You can setup the required database state for the receiving RT instance
 by running:
 
-    sbin/rt-setup-database --action create,schema,acl --prompt-for-dba-password
+    /opt/rt4/sbin/rt-setup-database --action create,schema,acl --prompt-for-dba-password
 
 The normal C<make initdb> step will B<not> work because it also inserts
 core system data.

commit 8c11b519ee09ab43713097f4d0f4d85ab247fc0c
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Nov 13 16:47:06 2014 -0800

    Replace hardcoded paths with configure-time paths when possible
    
    This also corrects an error in rt-email-dashboards, where the path to it
    was mistakenly given as local/sbin/ instead of sbin/

diff --git a/bin/rt-mailgate.in b/bin/rt-mailgate.in
index 1b27f5a..364b3ce 100644
--- a/bin/rt-mailgate.in
+++ b/bin/rt-mailgate.in
@@ -415,10 +415,10 @@ You need to route mail to C<rt-mailgate> for the queues you're
 monitoring. For instance, if you're using F</etc/aliases> and you have a
 "bugs" queue, you will want something like this:
 
-    bugs:         "|/opt/rt4/bin/rt-mailgate --queue bugs --action correspond
+    bugs:         "|@RT_BIN_PATH_R@/rt-mailgate --queue bugs --action correspond
               --url http://rt.mycorp.com/"
 
-    bugs-comment: "|/opt/rt4/bin/rt-mailgate --queue bugs --action comment
+    bugs-comment: "|@RT_BIN_PATH_R@/rt-mailgate --queue bugs --action comment
               --url http://rt.mycorp.com/"
 
 Note that you don't have to run your RT server on your mail server, as
diff --git a/sbin/rt-email-dashboards.in b/sbin/rt-email-dashboards.in
index 2b7e6a1..7c6cbbe 100644
--- a/sbin/rt-email-dashboards.in
+++ b/sbin/rt-email-dashboards.in
@@ -122,7 +122,7 @@ are taken to be in the user's timezone if available, UTC otherwise.
 You'll need to have cron run this script every hour. Here's an example crontab
 entry to do this.
 
-    0 * * * * /opt/rt4/local/sbin/rt-email-dashboards
+    0 * * * * @RT_SBIN_PATH_R@/rt-email-dashboards
 
 This will run the script every hour on the hour. This may need some further
 tweaking to be run as the correct user.
diff --git a/sbin/rt-importer.in b/sbin/rt-importer.in
index 7a17f05..a7dcf03 100644
--- a/sbin/rt-importer.in
+++ b/sbin/rt-importer.in
@@ -274,7 +274,7 @@ which are only suitable for inserting into a schema with no data in it.
 You can setup the required database state for the receiving RT instance
 by running:
 
-    /opt/rt4/sbin/rt-setup-database --action create,schema,acl --prompt-for-dba-password
+    @RT_SBIN_PATH_R@/rt-setup-database --action create,schema,acl --prompt-for-dba-password
 
 The normal C<make initdb> step will B<not> work because it also inserts
 core system data.

-----------------------------------------------------------------------


More information about the rt-commit mailing list