Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[livejournal] r21422: LJSUP-11530 (prepare LJ code to run on d...

Committer: ailyin
LJSUP-11530 (prepare LJ code to run on debian squeeze)
U   trunk/bin/upgrading/make_system.pl
U   trunk/bin/upgrading/update-db-general.pl
U   trunk/cgi-bin/Apache/LiveJournal.pm
U   trunk/cgi-bin/ljdefaults.pl
U   trunk/cgi-bin/ljtextutil.pl
U   trunk/cvs/multicvs.conf
Modified: trunk/bin/upgrading/make_system.pl
===================================================================
--- trunk/bin/upgrading/make_system.pl	2012-03-15 07:04:02 UTC (rev 21421)
+++ trunk/bin/upgrading/make_system.pl	2012-03-15 08:13:34 UTC (rev 21422)
@@ -18,18 +18,23 @@
 
 print "\n";
 
-print "Creating system account...\n";
-unless (LJ::create_account({ 'user' => 'system',
-                             'name' => 'System Account',
-                             'password' => $pass }))
-{
+my $u = LJ::load_user('system');
+
+if ($u) {
     print "Already exists.\nModifying 'system' account...\n";
-    my $id = LJ::get_userid("system");
-    $dbh->do("UPDATE password SET password=? WHERE userid=?",
-             undef, $pass, $id);
+    $dbh->do( "UPDATE password SET password=? WHERE userid=?",
+        undef, $pass, $u->userid );
+} else {
+    print "Creating system account...\n";
+    LJ::create_account( {
+        'user'     => 'system',
+        'name'     => 'System Account',
+        'password' => $pass,
+    } );
+
+    $u = LJ::load_user('system');
 }
 
-my $u = LJ::load_user("system");
 unless ($u) {
     print "ERROR: can't find newly-created system account.\n";
     exit 1;

Modified: trunk/bin/upgrading/update-db-general.pl
===================================================================
--- trunk/bin/upgrading/update-db-general.pl	2012-03-15 07:04:02 UTC (rev 21421)
+++ trunk/bin/upgrading/update-db-general.pl	2012-03-15 08:13:34 UTC (rev 21422)
@@ -3546,7 +3546,7 @@
     # upgrade people to the new capabilities system.  if they're
     # using the the paidfeatures column already, we'll assign them
     # the same capability bits that ljcom will be using.
-    if (table_relevant("user") && column_type("user", "caps") eq "")
+    if (table_relevant("user") && !column_type("user", "caps"))
     {
         do_alter("user",
                  "ALTER TABLE user ADD ".

Modified: trunk/cgi-bin/Apache/LiveJournal.pm
===================================================================
--- trunk/cgi-bin/Apache/LiveJournal.pm	2012-03-15 07:04:02 UTC (rev 21421)
+++ trunk/cgi-bin/Apache/LiveJournal.pm	2012-03-15 08:13:34 UTC (rev 21422)
@@ -513,7 +513,7 @@
             LJ::Request->filename($file);
             $LJ::IMGPREFIX = '/img';
             $LJ::STATPREFIX = '/stc';
-            return LJ::Request::OK
+            return $bml_handler->($file);
         }
         else {
             return LJ::Request::FORBIDDEN;
@@ -1375,6 +1375,15 @@
             }
         }
     }
+
+    if ( $host eq $LJ::DOMAIN_WEB && ( my $uri = LJ::Request->uri ) ) {
+        my $filename_full = $LJ::HTDOCS . $uri;
+        $filename_full =~ s{//}{/}g;
+        if ( $filename_full =~ /[.]bml$/ && -e $filename_full ) {
+            return $bml_handler->($filename_full);
+        }
+    }
+
     LJ::Request->pnotes ('error' => 'e404');
     LJ::Request->pnotes ('remote' => LJ::get_remote());
     return LJ::Request::DECLINED

Modified: trunk/cgi-bin/ljdefaults.pl
===================================================================
--- trunk/cgi-bin/ljdefaults.pl	2012-03-15 07:04:02 UTC (rev 21421)
+++ trunk/cgi-bin/ljdefaults.pl	2012-03-15 08:13:34 UTC (rev 21422)
@@ -442,6 +442,70 @@
             User
         );
     }
+
+    if ($LJ::IS_DEV_SERVER) {
+        $LJ::CAPTCHA_MOGILEFS   = 1 unless defined $LJ::CAPTCHA_MOGILEFS;
+        $LJ::USERPIC_MOGILEFS   = 1 unless defined $LJ::USERPIC_MOGILEFS;
+        $LJ::PHONEPOST_MOGILEFS = 1 unless defined $LJ::PHONEPOST_MOGILEFS;
+        $LJ::TRUST_X_HEADERS    = 1 unless defined $LJ::TRUST_X_HEADERS;
+        $LJ::NO_PASSWORD_CHECK  = 1 unless defined $LJ::NO_PASSWORD_CHECK;
+
+        unless (@LJ::CLUSTERS) {
+            @LJ::CLUSTERS = ( 1, 2 );
+        }
+
+        unless ( defined $LJ::DEFAULT_CLUSTER ) {
+            $LJ::DEFAULT_CLUSTER = [ 1, 2 ];
+        }
+
+        unless (%LJ::DBINFO) {
+            %LJ::DBINFO = (
+                'master' => {
+                    'host'   => 'localhost',
+                    'user'   => 'lj',
+                    'pass'   => 'ljpass',
+                    'dbname' => 'livejournal',
+                    'role'   => { 'master' => 1, 'slow' => 1 }
+                },
+
+                'c1' => {
+                    'host'   => 'localhost',
+                    'user'   => 'lj',
+                    'pass'   => 'ljpass',
+                    'dbname' => 'lj_c1',
+                    'role'   => { 'cluster1' => 1 },
+                },
+
+                'c2' => {
+                    'host'   => 'localhost',
+                    'user'   => 'lj',
+                    'pass'   => 'ljpass',
+                    'dbname' => 'lj_c2',
+                    'role'   => { 'cluster2' => 1 },
+                },
+            );
+        }
+
+        unless (%LJ::MOGILEFS_CONFIG) {
+            %LJ::MOGILEFS_CONFIG = (
+                domain => 'danga.com::lj',
+                hosts  => [ '127.0.0.1:7001' ],
+                classes => {
+                    'userpics'   => 3,
+                    'captcha'    => 2,
+                    'phoneposts' => 3,
+                    'file'       => 1,
+                    'photo'      => 2,
+                },
+            );
+        }
+
+        @LJ::MEMCACHE_SERVERS = qw( 127.0.0.1:11211 )
+            unless @LJ::MEMCACHE_SERVERS;
+
+        @LJ::GEARMAN_SERVERS = qw( 127.0.0.1:8000 )
+            unless @LJ::GEARMAN_SERVERS;
+    }
 }
 
 # no dependencies.

Modified: trunk/cgi-bin/ljtextutil.pl
===================================================================
--- trunk/cgi-bin/ljtextutil.pl	2012-03-15 07:04:02 UTC (rev 21421)
+++ trunk/cgi-bin/ljtextutil.pl	2012-03-15 08:13:34 UTC (rev 21422)
@@ -8,6 +8,9 @@
                       HTML::Parser
                       LJ::Text
                       );
+
+use Encode;
+
 # <LJFUNC>
 # name: LJ::trim
 # class: text
@@ -279,15 +282,10 @@
         return LJ::run_hook("is_utf8", $text);
     }
 
-    require Unicode::CheckUTF8;
-    {
-        no strict;
-        local $^W = 0;
-        *stab = *{"main::LJ::"};
-        undef $stab{is_utf8};
-    }
-    *LJ::is_utf8 = \&Unicode::CheckUTF8::is_utf8;
-    return Unicode::CheckUTF8::is_utf8($text);
+    return 1 if Encode::is_utf8($text);
+
+    my $eval_res = eval { Encode::decode_utf8($text); 1 };
+    return $eval_res ? 1 : 0;
 }
 
 # <LJFUNC>

Modified: trunk/cvs/multicvs.conf
===================================================================
--- trunk/cvs/multicvs.conf	2012-03-15 07:04:02 UTC (rev 21421)
+++ trunk/cvs/multicvs.conf	2012-03-15 08:13:34 UTC (rev 21422)
@@ -34,7 +34,6 @@
 SVN(Test-FakeApache)      = http://code.livejournal.org/svn/Test-FakeApache/trunk/
 SVN(LJ-UserSearch)        = http://code.livejournal.org/svn/LJ-UserSearch/trunk/
 SVN(TheSchwartz-Worker-SendEmail) = http://code.livejournal.org/svn/TheSchwartz-Worker-SendEmail/trunk/
-#SVN(hubbub)               = http://pubsubhubbub.googlecode.com/svn/branches/perl-stable/publisher_clients/
 SVN(antispam)             = http://code.sixapart.com/svn/antispam/trunk/lib/Net/
 
 livejournal                                   .
@@ -76,8 +75,6 @@
 
 dmtp/server/dmtpd                             bin/dmtpd
 
-hubbub/perl/lib/Net/PubSubHubbub/Publisher.pm cgi-bin/Net/PubSubHubbub/Publisher.pm
-
 antispam/Akismet                              cgi-bin/Net/Akismet
 
 mogilefs/api/perl/MogileFS-Client/lib         cgi-bin

Tags: ailyin, andy, conf, livejournal, pl, pm
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments