ソースを参照

upgrade rt 3.0.1 -> 3.0.2; polishing

Michael van Elst 22 年 前
コミット
7991902ca1
3 ファイル変更109 行追加233 行削除
  1. 20 101
      rt/rt.patch
  2. 86 132
      rt/rt.spec
  3. 3 0
      rt/rtapache.conf

+ 20 - 101
rt/rt.patch

@@ -1,6 +1,14 @@
---- lib/RT/User_Overlay.pm.dist	Wed Apr 16 10:27:51 2003
-+++ lib/RT/User_Overlay.pm	Wed Apr 16 10:39:22 2003
-@@ -271,7 +271,7 @@
+--- lib/RT/User_Overlay.pm.dist	2003-05-15 12:35:15.000000000 +0200
++++ lib/RT/User_Overlay.pm	2003-05-15 12:36:26.000000000 +0200
+@@ -203,7 +203,6 @@
+         @_    # get the real argumentlist
+     );
+ 
+-
+     $args{'EmailAddress'} = $self->CanonicalizeEmailAddress($args{'EmailAddress'});
+ 
+     #Check the ACL
+@@ -274,7 +273,7 @@
  
      #If the create failed.
      unless ($id) {
@@ -9,18 +17,9 @@
  
          return ( 0, $self->loc('Could not create user') );
      }
-@@ -598,7 +598,7 @@
-     # coming from a subdomain as coming from second level domain
-     # foo.com
-     if ($RT::CanonicalizeEmailAddressMatch && $RT::CanonicalizeEmailAddressReplace ) {
--        $email =~ s/\$RT::CanonicalizeEmailAddressMatch/$RT::CanonicalizeEmailAddressReplace/gi;
-+        $email =~ s/$RT::CanonicalizeEmailAddressMatch/$RT::CanonicalizeEmailAddressReplace/gi;
-     }
-     return ($email);
- }
---- html/Ticket/Elements/ShowMessageStanza.dist	Wed Apr 16 10:25:57 2003
-+++ html/Ticket/Elements/ShowMessageStanza	Wed Apr 16 10:26:24 2003
-@@ -22,21 +22,22 @@
+--- html/Ticket/Elements/ShowMessageStanza.dist	2003-05-15 12:30:24.000000000 +0200
++++ html/Ticket/Elements/ShowMessageStanza	2003-05-15 12:31:11.000000000 +0200
+@@ -22,22 +22,23 @@
  %# 
  %# END LICENSE BLOCK
  <%perl>
@@ -28,12 +27,14 @@
 -    if ( ref $stanza eq "ARRAY" ) {
 -        $m->comp( 'ShowMessageStanza',
 -                  Depth   => $Depth + 1,
+-                  Transaction => $Transaction,
 -                  Message => $stanza );
 +  { my $msg = '';
 +    foreach my $stanza (@$Message) {
 +        if ( ref $stanza eq "ARRAY" ) {
 +            $m->comp( 'ShowMessageStanza',
 +                      Depth   => $Depth + 1,
++                      Transaction => $Transaction,
 +                      Message => $stanza );
 +        }
 +        elsif ( ref $stanza eq "HASH" ) {
@@ -56,20 +57,8 @@
  % }
  <%INIT>
  use URI::URL;
---- etc/RT_Config.pm.dist	Mon Apr  7 12:02:13 2003
-+++ etc/RT_Config.pm	Mon Apr  7 12:03:09 2003
-@@ -262,7 +262,8 @@
- 
- # $RTLogoURL points to the URL of the RT logo displayed in the web UI
- 
--Set($LogoURL , $WebImagesURL . "rt.jpg");
-+Set($LogoURL , $WebImagesURL . "/bplogo.gif");
-+Set($LogoLink , "http://bestpractical.com/");
- 
- # if TrustHTMLAttachments is not defined, we will display them
- # as text. This prevents malicious HTML and javascript from being
---- html/Elements/Header.dist	Wed Apr 16 10:23:42 2003
-+++ html/Elements/Header	Wed Apr 16 10:24:13 2003
+--- html/Elements/Header.dist	2003-04-16 10:23:42.000000000 +0200
++++ html/Elements/Header	2003-04-16 10:24:13.000000000 +0200
 @@ -40,9 +40,10 @@
  "
  % }
@@ -90,8 +79,8 @@
  <%INIT>
  
  $r->header_out('Pragma' => 'no-cache');
---- html/Elements/Login.dist	Wed Apr 16 10:23:47 2003
-+++ html/Elements/Login	Wed Apr 16 10:25:06 2003
+--- html/Elements/Login.dist	2003-04-16 10:23:47.000000000 +0200
++++ html/Elements/Login	2003-04-16 10:25:06.000000000 +0200
 @@ -86,12 +86,13 @@
  If you've forgotten your username or password, RT can <A
  href="/NoAuth/Reminder.html">send you a reminder</a>.
@@ -107,73 +96,3 @@
  <%ARGS>
  $user => ""
  $pass => undef
---- lib/RT/Ticket_Overlay.pm.dist	Wed Apr 16 10:27:42 2003
-+++ lib/RT/Ticket_Overlay.pm	Thu Apr 17 12:41:16 2003
-@@ -1726,6 +1726,7 @@
- Returns true if the specified principal (or the one corresponding to the
- specified address) is a member of the group Type for this ticket.
- 
-+
- =cut
- 
- sub IsWatcher {
-@@ -2995,7 +2996,16 @@
-     my $NewOwner = shift;
-     my $Type     = shift || "Give";
- 
--    unless ( $self->CurrentUserHasRight('ModifyTicket') ) {
-+    # we want to allow to take over tickets from Nobody even
-+    # when we currently are not allowed to modify the ticket
-+    # but might own it.
-+    # it is also ok to assign it to a third user as we could
-+    # get to the same result by first owning the ticket ourselves
-+    # and then give it away to the third user.
-+    # -- mlelstv
-+    unless ( $self->CurrentUserHasRight('ModifyTicket')
-+             or ( $self->CurrentUserHasRight('OwnTicket') and 
-+                  $self->OwnerObj->Id == $RT::Nobody->Id ) ) {
-         return ( 0, $self->loc("Permission Denied") );
-     }
- 
-@@ -3046,10 +3056,14 @@
-     # Delete the owner in the owner group, then add a new one
-     # TODO: is this safe? it's not how we really want the API to work 
-     # for most things, but it's fast.
--    my ($del_id, $del_msg) = $self->OwnerGroup->MembersObj->First->Delete();
--    unless ($del_id) {
-+    #
-+    # it is neither safe nor working -- mlelstv
-+    # -> find old owner, add new owner, modify ticket, remove old owner
-+
-+    my ( $old_owner ) = $self->OwnerGroup->MembersObj->First;
-+    unless ($old_owner) {
-         $RT::Handle->Rollback();
--        return(0, $self->loc("Could not change owner. "). $del_msg);
-+        return(0, $self->loc("Could not find owner. "));
-     }
- 
-     my ( $add_id, $add_msg ) = $self->OwnerGroup->_AddMember(
-@@ -3057,7 +3071,7 @@
-                                        InsideTransaction => 1 );
-     unless ($add_id) {
-         $RT::Handle->Rollback();
--        return(0, $self->loc("Could not change owner. "). $add_msg);
-+        return(0, $self->loc("Could not add owner. "). $add_msg);
-     }
-    
-     # We call set twice with slightly different arguments, so 
-@@ -3073,7 +3087,13 @@
- 
-     unless ($val) {
-         $RT::Handle->Rollback;
--        return(0, $self->loc("Could not change owner. "). $msg);
-+        return(0, $self->loc("Could not set owner. "). $msg);
-+    }
-+
-+    my ($del_id, $del_msg) = $old_owner->Delete();
-+    unless ($del_id) {
-+        $RT::Handle->Rollback();
-+        return(0, $self->loc("Could not remove owner. "). $del_msg);
-     }
- 
-     $RT::Handle->Commit();

+ 86 - 132
rt/rt.spec

@@ -24,8 +24,8 @@
 ##
 
 #   package versions
-%define       V_real                       3-0-1
-%define       V_here                       3.0.1
+%define       V_real                       3-0-2
+%define       V_here                       3.0.2
 %define       V_log_dispatch               2.04
 %define       V_html_mason                 1.20
 %define       V_libapreq                   1.1
@@ -47,10 +47,23 @@ Distribution: OpenPKG [EVAL]
 Group:        Database
 License:      GPL
 Version:      %{V_here}
-Release:      20030503
+Release:      20030515
 
 #   package options
 %option       with_color_primary  336699
+%option       with_db_mysql       yes
+%option       with_db_postgresql  no
+%option       with_db_oracle      no
+
+#   fixing conflicting options
+%if "%{with_db_oracle}" == "yes"
+%undefine     with_db_postgresql
+%define       with_db_postgresql  no
+%endif
+%if "%{with_db_oracle}" == "yes" || "%{with_db_postgresql}" == "yes"
+%undefine     with_db_mysql
+%define       with_db_mysql       no
+%endif
 
 #   list of sources
 Source0:      http://www.cpan.org/modules/by-module/Log/Log-Dispatch-%{V_log_dispatch}.tar.gz
@@ -85,7 +98,15 @@ PreReq:       OpenPKG, openpkg >= 20020206, perl, perl-openpkg
 PreReq:       perl-sys, perl-util, perl-ds, perl-text, perl-apache
 PreReq:       perl-dbi, perl-dbix, perl-mail, perl-www
 PreReq:       apache, apache::with_mod_perl = yes
+%if "%{with_db_mysql}" == "yes"
 PreReq:       MYSQL, perl-dbi::with_dbd_mysql = yes
+%endif
+%if "%{with_db_postgresql}" == "yes"
+PreReq:       postgresql, perl-dbi::with_dbd_pg = yes
+%endif
+%if "%{with_db_oracle}" == "yes"
+PreReq:       oracle, perl-dbi::with_dbd_oracle = yes
+%endif
 PreReq:       MTA
 AutoReq:      no
 AutoReqProv:  no
@@ -121,6 +142,9 @@ AutoReqProv:  no
       -e 's;chmod;true;g' \
       -e 's;mkdir -p;%{l_shtool} mkdir -p;g' \
       rt-%{V_real}/Makefile.in
+    %{l_shtool} subst \
+      -e 's;Locale::Maketext 1\.04;Locale::Maketext 1.03;' \
+      rt-%{V_real}/lib/RT/I18N.pm
 
 %build
     ( cd rt-%{V_real}
@@ -133,10 +157,24 @@ AutoReqProv:  no
         --with-db-type=mysql \
         --with-db-host=localhost \
         --with-db-home=%{l_prefix} \
+%if "%{with_db_mysql}" == "yes"
         --with-db-dba=root \
-        --with-db-database=RT \
-        --with-db-user=RT \
+        --with-db-database=rt \
+        --with-db-user=rt \
+        --with-db-pass=XXX \
+%endif
+%if "%{with_db_postgresql}" == "yes"
+        --with-db-dba=postgresql \
+        --with-db-database=rt \
+        --with-db-user=rt \
+        --with-db-pass=XXX \
+%endif
+%if "%{with_db_oracle}" == "yes"
+        --with-db-dba=system \
+        --with-db-database=rt \
+        --with-db-user=rt \
         --with-db-pass=XXX \
+%endif
         --with-web-user=%{l_nusr} \
         --with-web-group=%{l_ngrp} \
         --with-customdir=%{l_prefix}/etc/rt/local \
@@ -150,132 +188,40 @@ AutoReqProv:  no
 
     #   perform common prolog operations
     rt=%{l_prefix}/libexec/rt
-    %{l_prefix}/bin/perl-openpkg prolog
     %{l_shtool} mkdir -f -p -m 755 ${RPM_BUILD_ROOT}$rt
-    perl="${RPM_BUILD_DIR}/perl"
-    echo "exec ${l_prefix}/bin/perl \\" >>$perl
-    echo " \"\$@\"" >>$perl
-    chmod a+x $perl
-
-    ( cd Log-Dispatch-%{V_log_dispatch}
-      perl_args="INSTALLSITELIB=${RPM_BUILD_ROOT}$rt"
-      make=`%{l_prefix}/bin/rpm --eval '%{l_make} %{l_mflags}'`
-      make_args="PERL=${perl} FULLPERL=${perl}"
-      chmod -R u+rw Makefile.PL
-      cp Makefile.PL Makefile.PL.orig
-      sed -e "s:\$^X:'$perl':g" <Makefile.PL.orig >Makefile.PL
-      $perl Makefile.PL ${1+"$@"} $perl_args </dev/null
-      $make $make_args pure_all
-      $make $make_args pure_install
-    ) || exit $?
-
-    ( cd HTML-Mason-%{V_html_mason}
-      perl_args="INSTALLSITELIB=${RPM_BUILD_ROOT}$rt"
-      make=`%{l_prefix}/bin/rpm --eval '%{l_make} %{l_mflags}'`
-      make_args="PERL=${perl} FULLPERL=${perl}"
-      chmod -R u+rw Makefile.PL
-      cp Makefile.PL Makefile.PL.orig
-      sed -e "s:\$^X:'$perl':g" <Makefile.PL.orig >Makefile.PL
-      $perl Makefile.PL ${1+"$@"} $perl_args </dev/null
-      $make $make_args pure_all
-      $make $make_args pure_install
-    ) || exit $?
-
-    ( cd libapreq-%{V_libapreq}
-      perl_args="INSTALLSITELIB=${RPM_BUILD_ROOT}$rt"
-      make=`%{l_prefix}/bin/rpm --eval '%{l_make} %{l_mflags}'`
-      make_args="PERL=${perl} FULLPERL=${perl}"
-      chmod -R u+rw Makefile.PL
-      cp Makefile.PL Makefile.PL.orig
-      sed -e "s:\$^X:'$perl':g" <Makefile.PL.orig >Makefile.PL
-      $perl Makefile.PL ${1+"$@"} $perl_args </dev/null
-      $make $make_args pure_all
-      $make $make_args pure_install
-    ) || exit $?
-
-    ( cd WWW-Mechanize-%{V_www_mechanize}
-      perl_args="INSTALLSITELIB=${RPM_BUILD_ROOT}$rt"
-      make=`%{l_prefix}/bin/rpm --eval '%{l_make} %{l_mflags}'`
-      make_args="PERL=${perl} FULLPERL=${perl}"
-      chmod -R u+rw Makefile.PL
-      cp Makefile.PL Makefile.PL.orig
-      sed -e "s:\$^X:'$perl':g" <Makefile.PL.orig >Makefile.PL
-      $perl Makefile.PL ${1+"$@"} $perl_args </dev/null
-      $make $make_args pure_all
-      $make $make_args pure_install
-    ) || exit $?
 
-    ( cd MLDBM-%{V_mldbm}
-      perl_args="INSTALLSITELIB=${RPM_BUILD_ROOT}$rt"
-      make=`%{l_prefix}/bin/rpm --eval '%{l_make} %{l_mflags}'`
-      make_args="PERL=${perl} FULLPERL=${perl}"
-      chmod -R u+rw Makefile.PL
-      cp Makefile.PL Makefile.PL.orig
-      sed -e "s:\$^X:'$perl':g" <Makefile.PL.orig >Makefile.PL
-      $perl Makefile.PL ${1+"$@"} $perl_args </dev/null
-      $make $make_args pure_all
-      $make $make_args pure_install
-    ) || exit $?
-
-    ( cd HTML-Format-%{V_html_format}
-      perl_args="INSTALLSITELIB=${RPM_BUILD_ROOT}$rt"
-      make=`%{l_prefix}/bin/rpm --eval '%{l_make} %{l_mflags}'`
-      make_args="PERL=${perl} FULLPERL=${perl}"
-      chmod -R u+rw Makefile.PL
-      cp Makefile.PL Makefile.PL.orig
-      sed -e "s:\$^X:'$perl':g" <Makefile.PL.orig >Makefile.PL
-      $perl Makefile.PL ${1+"$@"} $perl_args </dev/null
-      $make $make_args pure_all
-      $make $make_args pure_install
-    ) || exit $?
-
-    ( cd Test-Inline-%{V_test_inline}
-      perl_args="INSTALLSITELIB=${RPM_BUILD_ROOT}$rt"
-      make=`%{l_prefix}/bin/rpm --eval '%{l_make} %{l_mflags}'`
-      make_args="PERL=${perl} FULLPERL=${perl}"
-      chmod -R u+rw Makefile.PL
-      cp Makefile.PL Makefile.PL.orig
-      sed -e "s:\$^X:'$perl':g" <Makefile.PL.orig >Makefile.PL
-      $perl Makefile.PL ${1+"$@"} $perl_args </dev/null
-      $make $make_args pure_all
-      $make $make_args pure_install
-    ) || exit $?
-
-    ( cd Locale-Maketext-Lexicon-%{V_locale_maketext_lexicon}
-      perl_args="INSTALLSITELIB=${RPM_BUILD_ROOT}$rt"
-      make=`%{l_prefix}/bin/rpm --eval '%{l_make} %{l_mflags}'`
-      make_args="PERL=${perl} FULLPERL=${perl}"
-      chmod -R u+rw Makefile.PL
-      cp Makefile.PL Makefile.PL.orig
-      sed -e "s:\$^X:'$perl':g" <Makefile.PL.orig >Makefile.PL
-      $perl Makefile.PL ${1+"$@"} $perl_args </dev/null
-      $make $make_args pure_all
-      $make $make_args pure_install
-    ) || exit $?
-
-    ( cd Locale-Maketext-Fuzzy-%{V_locale_maketext_fuzzy}
-      perl_args="INSTALLSITELIB=${RPM_BUILD_ROOT}$rt"
-      make=`%{l_prefix}/bin/rpm --eval '%{l_make} %{l_mflags}'`
-      make_args="PERL=${perl} FULLPERL=${perl}"
-      chmod -R u+rw Makefile.PL
-      cp Makefile.PL Makefile.PL.orig
-      sed -e "s:\$^X:'$perl':g" <Makefile.PL.orig >Makefile.PL
-      $perl Makefile.PL ${1+"$@"} $perl_args </dev/null
-      $make $make_args pure_all
-      $make $make_args pure_install
-    ) || exit $?
+    %{l_prefix}/bin/perl-openpkg prolog
 
-    ( cd Regexp-Common-%{V_regexp_common}
-      perl_args="INSTALLSITELIB=${RPM_BUILD_ROOT}$rt"
-      make=`%{l_prefix}/bin/rpm --eval '%{l_make} %{l_mflags}'`
-      make_args="PERL=${perl} FULLPERL=${perl}"
-      chmod -R u+rw Makefile.PL
-      cp Makefile.PL Makefile.PL.orig
-      sed -e "s:\$^X:'$perl':g" <Makefile.PL.orig >Makefile.PL
-      $perl Makefile.PL ${1+"$@"} $perl_args </dev/null
-      $make $make_args pure_all
-      $make $make_args pure_install
-    ) || exit $?
+    %{l_prefix}/bin/perl-openpkg install \
+        -d Log-Dispatch-%{V_log_dispatch} \
+        -p ${RPM_BUILD_ROOT}$rt
+    %{l_prefix}/bin/perl-openpkg install \
+        -d HTML-Mason-%{V_html_mason} \
+        -p ${RPM_BUILD_ROOT}$rt
+    %{l_prefix}/bin/perl-openpkg install \
+        -d libapreq-%{V_libapreq} \
+        -p ${RPM_BUILD_ROOT}$rt
+    %{l_prefix}/bin/perl-openpkg install \
+        -d WWW-Mechanize-%{V_www_mechanize} \
+        -p ${RPM_BUILD_ROOT}$rt
+    %{l_prefix}/bin/perl-openpkg install \
+        -d MLDBM-%{V_mldbm} \
+        -p ${RPM_BUILD_ROOT}$rt
+    %{l_prefix}/bin/perl-openpkg install \
+        -d HTML-Format-%{V_html_format} \
+        -p ${RPM_BUILD_ROOT}$rt
+    %{l_prefix}/bin/perl-openpkg install \
+        -d Test-Inline-%{V_test_inline} \
+        -p ${RPM_BUILD_ROOT}$rt
+    %{l_prefix}/bin/perl-openpkg install \
+        -d Locale-Maketext-Lexicon-%{V_locale_maketext_lexicon} \
+        -p ${RPM_BUILD_ROOT}$rt
+    %{l_prefix}/bin/perl-openpkg install \
+        -d Locale-Maketext-Fuzzy-%{V_locale_maketext_fuzzy} \
+        -p ${RPM_BUILD_ROOT}$rt
+    %{l_prefix}/bin/perl-openpkg install \
+        -d Regexp-Common-%{V_regexp_common} \
+        -p ${RPM_BUILD_ROOT}$rt
 
     #   perform common epilog operations
     %{l_prefix}/bin/perl-openpkg epilog
@@ -309,7 +255,6 @@ AutoReqProv:  no
         $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/etc/upgrade/
       %{l_shtool} install -c -m 0644 \
         -e '/Set($WebBaseURL/s;"[^"]*";"";' \
-        -e '/Set($WebImagesURL/s;/";";' \
         etc/RT_Config.pm \
         $RPM_BUILD_ROOT%{l_prefix}/etc/rt/RT_SiteConfig.pm
       rm -f \
@@ -338,19 +283,28 @@ AutoReqProv:  no
     rm -f $RPM_BUILD_ROOT%{l_prefix}/libexec/rt/tools/rt-test-dependencies
 
     #   setup/cleanup/upgrade script
+%if "%{with_db_mysql}" == "yes"
+    rt_db_dba=root
+%endif
+%if "%{with_db_postgresql}" == "yes"
+    rt_db_dba=postgresql
+%endif
+%if "%{with_db_oracle}" == "yes"
+    rt_db_dba=system
+%endif
     %{l_shtool} install -c -m 755 \
         -e 's;@l_prefix@;%{l_prefix};g' \
-        -e 's;@rt_db_dba@;root;g' \
+        -e "s;@rt_db_dba@;$rt_db_dba;g" \
         %{SOURCE rtsetup} \
         $RPM_BUILD_ROOT%{l_prefix}/sbin/
     %{l_shtool} install -c -m 755 \
         -e 's;@l_prefix@;%{l_prefix};g' \
-        -e 's;@rt_db_dba@;root;g' \
+        -e "s;@rt_db_dba@;$rt_db_dba;g" \
         %{SOURCE rtcleanup} \
         $RPM_BUILD_ROOT%{l_prefix}/sbin/
     %{l_shtool} install -c -m 755 \
         -e 's;@l_prefix@;%{l_prefix};g' \
-        -e 's;@rt_db_dba@;root;g' \
+        -e "s;@rt_db_dba@;$rt_db_dba;g" \
         %{SOURCE rtupgrade} \
         $RPM_BUILD_ROOT%{l_prefix}/sbin/
 

+ 3 - 0
rt/rtapache.conf

@@ -96,3 +96,6 @@ PerlRequire @l_prefix@/cgi/rt/webmux.pl
     PerlHandler RT::Mason
 </Location>
 </IfModule>
+<LocationMatch "/NoAuth/images">
+    SetHandler None
+</LocationMatch>