Stories
Slash Boxes
Comments

Slash Open Source Project

This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login
Loading... please wait.
  • I've been really champing at the bit to grab a new CVS snapshot. Now that I know the full story, I'm glad to know you guys took your time to make things right, thanks for that.

    One related thing I'd like to know more about - merging the latest CVS template changes with template customizations I've made. I'm only on my second incarnation of my slash site, and I've never upgraded (I've just done two fresh installs). Since templates are stored in the slash database, I take it there are some extra steps req
    • by jamiemccarthy (414) on Wednesday January 28 2004, @10:16AM (#6160) Homepage

      The easiest way to do what you want is to check out the CVS code, then make your template customizations directly to the checked-out files, not using the template editing tools on the website.

      If you then do a "cvs update", our fixes and improvements will be added to your checked-out files, but your changes will remain intact.

      (If one of our changes and your changes should happen to affect the same lines of code, CVS will warn you with a "C" in the left margin. You can grep the codebase on "<<<<" to find any conflicts that do arise, then edit the files manually and do a "cvs diff" on the edited files to make sure your final changes are sane. To give you an idea, my sites mccarthy.vg and censorware.net have a few custom templates each, and they get a conflict once every few months maybe.)

      After you do a "cvs update" to get more recent CVS code, a "make install" will copy your modified templates into place in /usr/local/slash. Once that's done, run "/usr/local/slash/bin/template-tool -u yourvirtuser -tU". That will compare what's in your DB to what's on disk -- the script knows which plugins and theme your site has, and how to find the right files on disk, to do a proper comparison. It will tell you what changes it sees like this:

      id 209 users;menu;default is different (template)

      If that list of changes looks right, take out the "-t" option, just run it with "-U", and it will automatically apply what's on disk to your DB. Then restart slashd and apache and your changes are live.

      Just for reference, here's the script I use on my test sites to copy my changes from the template files on disk, to the templates in the DB (and code changes too) (but don't just run this willy-nilly if you don't understand it, or don't have a backup :)

      /bin/rm -rf /usr/local/src/slash
      /bin/cp -rH $MY_SRC /usr/local/src/slash
      cd /usr/local/src/slash
      make GROUP=nogroup && make install GROUP=nogroup
      /etc/init.d/apache stop
      /etc/init.d/slash stop
      /usr/local/slash/bin/template-tool -U
      /usr/local/slash/bin/symlink-tool -U
      /etc/init.d/slash start
      /etc/init.d/apache start

      If you want to get really fancy, you can just "cp -a themes/slashcode themes/yourtheme", and then make your changes in the yourtheme directory (making sure to edit the THEME file to give it a new name)... then edit the site_info table to assign that theme to your site... CVS will be smart enough to recurse both into the themes/slashcode directory and into the themes/yourtheme directory... this not only gives you a quick way to use diff to tell what changes you've made to the stock theme, but if you are running multiple sites with custom templates, you can define a new theme for each one. Someday we'll have good documentation for all this :)