X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fbin%2Frt.in;h=aefe7af727c21221e6868025ec32a13c5ee73b2d;hb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924;hp=aa3ac33de433933ad4aa5440fed0f2244dc57a82;hpb=b4b0c7e72d7eaee2fbfc7022022c9698323203dd;p=freeside.git diff --git a/rt/bin/rt.in b/rt/bin/rt.in index aa3ac33de..aefe7af72 100644 --- a/rt/bin/rt.in +++ b/rt/bin/rt.in @@ -1,41 +1,41 @@ #!@PERL@ -w # BEGIN BPS TAGGED BLOCK {{{ -# +# # COPYRIGHT: -# -# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC -# -# +# +# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +# +# # (Except where explicitly superseded by other copyright notices) -# -# +# +# # LICENSE: -# +# # This work is made available to you under the terms of Version 2 of # the GNU General Public License. A copy of that license should have # been provided with this software, but in any event can be snarfed # from www.gnu.org. -# +# # This work is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301 or visit their web page on the internet at # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html. -# -# +# +# # CONTRIBUTION SUBMISSION POLICY: -# +# # (The following paragraph is not intended to limit the rights granted # to you to modify and distribute this software under the terms of # the GNU General Public License and is only of importance to you if # you choose to contribute your changes and enhancements to the # community by submitting them to Best Practical Solutions, LLC.) -# +# # By intentionally submitting any modifications, corrections or # derivatives to this work, or any other work intended for use with # Request Tracker, to Best Practical Solutions, LLC, you confirm that @@ -44,7 +44,7 @@ # royalty-free, perpetual, license to use, copy, create derivative # works based on those contributions, and sublicense and distribute # those contributions and any derivatives thereof. -# +# # END BPS TAGGED BLOCK }}} # Designed and implemented for Best Practical Solutions, LLC by # Abhijit Menon-Sen @@ -1166,7 +1166,7 @@ sub submit { $file ||= $self->{file}; local *F; - open(F, $file) && do { + open(F, '<', $file) && do { $self->{file} = $file; my $sids = $self->{sids} = {}; while () { @@ -1187,7 +1187,7 @@ sub submit { $file ||= $self->{file}; local *F; - open(F, ">$file") && do { + open(F, '>', $file) && do { my $sids = $self->{sids}; foreach my $server (keys %$sids) { foreach my $user (keys %{ $sids->{$server} }) { @@ -1347,7 +1347,7 @@ sub Form::compose { $line .= ",\n$sp$v"; } else { - $line = $line ? "$line, $v" : "$key: $v"; + $line = $line ? "$line,$v" : "$key: $v"; } } @@ -1415,7 +1415,7 @@ sub config_from_file { } # Still nothing? We'll fall back to some likely defaults. - for ("$HOME/$rc", "/etc/rt.conf") { + for ("$HOME/$rc", "@LOCAL_ETC_PATH@/rt.conf", "/etc/rt.conf") { return parse_config_file($_) if (-r $_); } } @@ -1429,7 +1429,7 @@ sub parse_config_file { my ($file) = @_; local $_; # $_ may be aliased to a constant, from line 1163 - open(CFG, $file) && do { + open(CFG, '<', $file) && do { while () { chomp; next if (/^#/ || /^\s*$/); @@ -1479,9 +1479,9 @@ sub vi { local *F; local $/ = undef; - open(F, ">$file") || die "$file: $!\n"; print F $text; close(F); + open(F, '>', $file) or die "$file: $!\n"; print F $text; close(F); system($editor, $file) && die "Couldn't run $editor.\n"; - open(F, $file) || die "$file: $!\n"; $text = ; close(F); + open(F, '<', $file) or die "$file: $!\n"; $text = ; close(F); unlink($file); return $text; @@ -1514,7 +1514,7 @@ sub vsplit { # XXX: This should become a real parser, à la Text::ParseWords. $line =~ s/^\s+//; $line =~ s/\s+$//; - my ( $a, $b ) = split /,/, $line, 2; + my ( $a, $b ) = split /\s*,\s*/, $line, 2; while ($a) { no warnings 'uninitialized'; @@ -1522,7 +1522,7 @@ sub vsplit { my $s = $a; while ( $a !~ /'$/ || ( $a !~ /(\\\\)+'$/ && $a =~ /(\\)+'$/ )) { - ( $a, $b ) = split /,/, $b, 2; + ( $a, $b ) = split /\s*,\s*/, $b, 2; $s .= ',' . $a; } push @words, $s; @@ -1531,7 +1531,7 @@ sub vsplit { my $s = $a; while ( $a !~ /}$/ ) { ( $a, $b ) = - split /,/, $b, 2; + split /\s*,\s*/, $b, 2; $s .= ',' . $a; } $s =~ s/^q{/'/; @@ -1541,7 +1541,7 @@ sub vsplit { else { push @words, $a; } - ( $a, $b ) = split /,/, $b, 2; + ( $a, $b ) = split /\s*,\s*/, $b, 2; } @@ -1556,7 +1556,7 @@ sub expand_list { my ($list) = @_; my @elts; - foreach (split /,/, $list) { + foreach (split /\s*,\s*/, $list) { push @elts, /^(\d+)-(\d+)$/? ($1..$2): $_; } @@ -1751,10 +1751,7 @@ Title: intro Title: introduction Text: - ** THIS IS AN UNSUPPORTED PREVIEW RELEASE ** - ** PLEASE REPORT BUGS TO rt-bugs@bestpractical.com ** - - This is a command-line interface to RT 3.0 or newer + This is a command-line interface to RT 3.0 or newer. It allows you to interact with an RT server over HTTP, and offers an interface to RT's functionality that is better-suited to automation @@ -1829,7 +1826,8 @@ Text: The program looks for configuration directives in a file named .rtrc (or $RTCONFIG; see below) in the current directory, and then in more distant ancestors, until it reaches /. If no suitable configuration - files are found, it will also check for ~/.rtrc and /etc/rt.conf. + files are found, it will also check for ~/.rtrc, @LOCAL_ETC_PATH@/rt.conf + and /etc/rt.conf. Configuration directives: