The Artima Developer Community
Sponsored Link

Python Buzz Forum
If you've held back from files in a PA update and broken something, here's how to selectively...

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Phillip Pearson

Posts: 1083
Nickname: myelin
Registered: Aug, 2003

Phillip Pearson is a Python hacker from New Zealand
If you've held back from files in a PA update and broken something, here's how to selectively... Posted: Oct 23, 2006 10:59 PM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Phillip Pearson.
Original Post: If you've held back from files in a PA update and broken something, here's how to selectively...
Feed Title: Second p0st
Feed URL: http://www.myelin.co.nz/post/rss.xml
Feed Description: Tech notes and web hackery from the guy that brought you bzero, Python Community Server, the Blogging Ecosystem and the Internet Topic Exchange
Latest Python Buzz Posts
Latest Python Buzz Posts by Phillip Pearson
Latest Posts From Second p0st

Advertisement

One dangerous option I included in the PA updater is the one to update all files that don't have conflicts, but leave everything else in place. This usually breaks your system :)

If you've used this option and ended up with a broken install, here's how to fix it. The example below uses the previously-broken idubb.com install.

First, cd into your PA root dir. Then check out a copy of the latest code from Subversion and move the .svn directories into your install:

cd ~/public_html
svn checkout http://update.peopleaggregator.org/svn/release/pa pa_svn_latest
cd pa_svn_latest
for f in `find . -name .svn`; do mv $f ../; done

Now go into MySQL (using the host/login/password/db in local_config.php)

mysql -u peopleaggregator -p peopleaggregator
(enter password)
select * from svn_objects where is_active=1 and held_revision is not null;

You'll get something like this:

+---------------------------------------------------------+------+----------------------------------+----------+-----------+---------------+
| path                                                    | kind | hash                             | revision | is_active | held_revision |
+---------------------------------------------------------+------+----------------------------------+----------+-----------+---------------+
| api/Invitation/Invitation.php                           | file | f4f0c8a7dac5950db1ce091231437a02 |        9 |         1 |            16 |
| web/Themes/Alpha/images/pa-logo.gif                     | file | 33d3095ec596ab354a5321ec47afdecc |        9 |         1 |            16 |
| web/homepage.php                                        | file | a6f3ac29057f7b09c3250289fc4b140f |        9 |         1 |            16 |
| web/BlockModules/InvitationModule/public_inner_html.tpl | file | 16bfeaf22dd8f82db34904fe094984a9 |       13 |         1 |            16 |
| web/Themes/Alpha/header_all.tpl                         | file | 21174ca7c74cc5b3996680f6b10f27ae |       13 |         1 |            16 |
| web/Themes/Alpha/footer.tpl                             | file | d253a24268ac6654c5765f1b9181f334 |       13 |         1 |            16 |
| config.inc                                              | file | e2454115a72ca2e298f1df2a2e896768 |       16 |         1 |            16 |
+---------------------------------------------------------+------+----------------------------------+----------+-----------+---------------+
7 rows in set (0.05 sec)

Now you've got to update each of these files in turn. For each file, you've got to make a copy of what's on your system, then check out the appropriate version from Subversion, then move your file back in, and update to the latest version.

for f in api/Invitation/Invitation.php web/Themes/Alpha/images/pa-logo.gif web/homepage.php web/BlockModules/InvitationModule/public_inner_html.tpl web/Themes/Alpha/header_all.tpl web/Themes/Alpha/footer.tpl config.inc; do mv $f _asdf; svn update -r16 $f; mv _asdf $f; svn update $f; done

You'll see something like this:

Restored 'api/Invitation/Invitation.php'
U    api/Invitation/Invitation.php
Updated to revision 16.
G    api/Invitation/Invitation.php
Updated to revision 22.
Restored 'web/Themes/Alpha/images/pa-logo.gif'
U    web/Themes/Alpha/images/pa-logo.gif
Updated to revision 16.
C    web/Themes/Alpha/images/pa-logo.gif
Updated to revision 22.
Restored 'web/homepage.php'
U    web/homepage.php
Updated to revision 16.
C    web/homepage.php
Updated to revision 22.
Restored 'web/BlockModules/InvitationModule/public_inner_html.tpl'
U    web/BlockModules/InvitationModule/public_inner_html.tpl
Updated to revision 16.
C    web/BlockModules/InvitationModule/public_inner_html.tpl
Updated to revision 22.
A    web/Themes/Alpha/header_all.tpl
Updated to revision 16.
D    web/Themes/Alpha/header_all.tpl
Updated to revision 22.
Restored 'web/Themes/Alpha/footer.tpl'
U    web/Themes/Alpha/footer.tpl
Updated to revision 16.
C    web/Themes/Alpha/footer.tpl
Updated to revision 22.

If everything in there is A, U, G, or D, you're fine. If you see any Cs (C = conflict), your site is probably now even more broken than before. Not to worry, you now have enough clues to finish off the job :)

Open each conflicting (C) file and look for text like this:

<<<<<<< .mine
        $invite_title = "Invite Colleagues and Friends to iDubb.com:";
=======
        $invite_title = "Invite friends and colleagues to join PeopleAggregator:";
>>>>>>> .r22

Now replace this whole lot with the correct version. (In this case it looks like the PA code had a grammar fix, but the same line had already been changed by the site operator to refer to iDubb.com, and Subversion isn't quite magical enough to merge this sort of thing.)

Once you've done that for everything, run svn resolved to mark each file as up to date:

svn resolved web/Themes/Alpha/images/pa-logo.gif web/homepage.php web/BlockModules/InvitationModule/public_inner_html.tpl web/Themes/Alpha/footer.tpl

Your site should now be working, assuming you fixed all the conflicts properly!

In future, to update, go into your PA root directory, run svn update, then php web/update/run_scripts.php:

cd ~/public_html
svn update
php web/update/run_scripts.php

Comment

Read: If you've held back from files in a PA update and broken something, here's how to selectively...

Topic: Mini-book: a dozen recipes for Zope 3 Previous Topic   Next Topic Topic: Common Message Runtime

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use