Tag: Open Source

Move Subversion repository without svnadmin

November 12, 2008 » Geek

Update (2008-11-13)
Okay, so I did actually end up finding a way to move from SF.net for real. It seems they provide read-only rsync access straight to the repository directory. So here is what I did instead.

$ rsync -av blowpass.svn.sourceforge.net::svn/blowpass/* blowpass
$ svnadmin dump blowpass/ > blowpass.dump
$ svnadmin create clearpass
$ svnadmin load clearpass < blowpass.dump

Update (2008-11-12)
Made a small performance change then ran it on the ClearPass repository. Worked flawlessly.

I have been having a terrible time trying to figure out how I can get the Subversion repository for ClearPass out of SourceForge. I could not find a single reference to svnadmin on the SourceForge and no examples of exporting without it. So I took matters into my own hands. Below is a quick and dirty shell script that exports and imports a repository one revision at a time, using common Linux command line tools and the svn command. I'm going to do more testing before using it for real, but so far it has done well. Hope this helps someone else in my position.

Download it: svncrossload

#!/bin/sh

################################################################################
# LICENSE
################################################################################
# Copyright 2008 John Hobbs
################################################################################
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program 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.,
# 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
################################################################################

################################################################################
# ABOUT
################################################################################
#
# Home: http://www.velvetcache.org/
#
# This is a script to cross load subversion repositories (kind of) keeping history
# intact without access to svnadmin.  Import into a FRESH repository only, and
# be sure to do a comprehensive diff at the end.
#
# Also be sure to do this in an empty directory. Temp files get added and removed
# without sincere thought put into them.
#
# Log messages get eaten and re-inserted as shown below. Edit to taste.
#   $ svn log -r 1
#   ------------------------------------------------------------------------
#   r1 | jmhobbs | 2008-11-12 18:19:43 -0600 (Wed, 12 Nov 2008) | 7 lines
#
#   Imported from file:///srv/svn/scs using svncrossload
#
#     |r1 | jmhobbs | 2008-10-27 17:32:44 -0500 (Mon, 27 Oct 2008) | 2 lines
#     |
#     |Initial import.
#     |
#
#   ------------------------------------------------------------------------
#   $

echo "Checking out initial revisions"
svn co $2 importing > /dev/null
svn co -r 0 $1 updateme > /dev/null

echo "Getting most recent revision number"
LATESTREVISION=$(svn info $1 | grep Revision | sed 's/^Revision: *\([0-9]*\)/\1/')

for i in $(seq 1 $LATESTREVISION); do

  echo -e "\nCopying revision $i"

  cd updateme
  svn update -r $i > ../_update
  echo -e "Imported from $1 using svncrossload\n" > ../_log
  # The '\-\-\-\-\...' looks ridiculous, but it works.
  svn log -r $i | grep -v '\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-' | sed 's/\(.*\)/   |\1/'  >> ../_log
  cd ..

  cat _update | grep -E '^A' | sed 's/^A *//' > _update_add
  cat _update | grep -E '^D' | sed 's/^D *//' > _update_del
  cat _update | grep -E '^U' | sed 's/^U *//' > _update_mod

  echo "$(wc -l _update_add | sed 's/^\([0-9]*\).*/\1/') Files To Add"
  echo "$(wc -l _update_mod | sed 's/^\([0-9]*\).*/\1/') Files To Modify"
  echo "$(wc -l _update_del | sed 's/^\([0-9]*\).*/\1/') Files To Delete"

  # Copy
  for j in $(cat _update_add | tr ' ' '@'); do
    if [ -d "updateme/${j//@/ }" ]; then
      mkdir "importing/${j//@/ }"
    else
      cp -f "updateme/${j//@/ }" "importing/${j//@/ }"
    fi
    cd importing
    # We send cerr to null because it warns when we add existing stuff
    svn add "${j//@/ }" 2> /dev/null
    cd ..
  done

  # Modify
  for j in $(cat _update_mod | tr ' ' '@'); do
    if [ -f "updateme/${j//@/ }" ]; then
      cp -f "updateme/${j//@/ }" "importing/${j//@/ }"
    fi
  done

  # Delete
  for j in $(cat _update_del | tr ' ' '@'); do
    cd importing
    svn rm "${j//@/ }"
    cd ..
  done

  echo "Committing"
  cd importing
  svn commit -F ../_log
  cd ..

done

echo "Cleaning up"
rm -rf importing _log _update _update_add _update_del updateme _update_mod
echo "Done!"

Warped Jane Austen Quote

August 16, 2007 » Geek

From the GNU Automake Documentation:

“It is a truth universally acknowledged, search that a developer in possession of a new package, must be in want of a build system.”

Awesome.

BlowPass Alpha Release

July 7, 2007 » Geek

I released an alpha of the latest version of BlowPass today. It’s almost a full rewrite, the structure is that different. Anyway, you can get more information on the BlowPass dev blog.

OurUNO is Our Reviews

May 1, 2007 » Geek

Well, tonight I finally got around to working on OurUNO. I decided a long time ago to convert it to a framework around which anyone can build up a college review site. I started cutting up the code around 9:00 and it’s now 3:45 of the next day. Ouch.

I naturally decided to use Smarty to template this guy, and then I decided that there was going to be a definite need for good docs. I chose NaturalDocs and it’s pretty good. It’s got 0 learning curve for the basic functionality, and outputs pretty docs.

I got most of the system documented tonight, and converted about, contact, index, and viewReviews to Smarty. There are still some problems with NaturalDocs I have to figure out (like how to group files together) and lots of files to template of course.

I think I can have a package together within a month. I’ll hook up to sourceforge soon, maybe snag a domain. It’s actually been a lot easier than I thought it would be so far. Smarty is pretty kickin, as is NaturalDocs. The latter could, ironically, use better documentation.

BlowPass Has Taken Over

December 7, 2006 » Geek

So I thought that I had moved past BlowPass. I guess I was wrong. I’ve been spending every spare moment working on it. I found what I feel is a better Blowfish library at www.farfarfar.com. I still can’t implement any of the vector tests because they’re all in hex and translate into nasty characters. This means I have no actual idea if the crypt is working. I also quickly stopped trying to write my own Twofish implementation. I could handle it in C I think, but not JavaScript, I don’t know enough of it and it’s little oddities.

Regardless of all that, I’ve got my prototype AJAX down pat now (okay, AHAH) and I’m working up my own open source version of passlet.com. Here’s a nice list of features/todo’s.

  • Uses a non-proprietary algorithm (Blowfish)
  • Has AJAX-y-ness
  • Uses PHP
  • Uses a database abstraction library TODO
  • Slick animations (mootools?) TODO

You can check out the current version at http://static.velvetcache.org/projects/blowpass/demo/ to play around.