Search code examples
svnreposurgeon

Reposurgeon fails to mirror svn


Update figured the problem I needed to configure svn to store passwords, see the answer for details.

Problem description follows

I've got a svn database that needs to be converted to git, so about as basic use case as it comes.

I'm using WSL / ubuntu and have pulled the 4.31-1 version of it with apt, I also tried getting the 5.0 from the repository but that didn't make any difference.

The SVN database does not follow the standard format, it looks like this: enter image description here

Repotool fails right away trying to do the mirror, why? Git-svn does work, but reposurgeon was supposed to be "better".

omannisto@olli-lt:~/repotest2$ repotool initmake AltiumComponentLibrary svn git
repotool: a Makefile already exists here.
repotool: generating a stub options file.
repotool: generating a stub lift file.
repotool: generating a stub map file.
omannisto@olli-lt:~/repotest2$ nano Makefile
omannisto@olli-lt:~/repotest2$ make
rm -rf AltiumComponentLibraries-mirror
make AltiumComponentLibraries.svn AltiumComponentLibraries.opts AltiumComponentLibraries.lift AltiumComponentLibraries.map
make[1]: Entering directory '/home/omannisto/repotest2'
repotool mirror http://[email protected]:8008/svn/oxford/AltiumComponentLibraries AltiumComponentLibraries-mirror
Authentication realm: <http://10.4.0.44:8008> Authorization Realm
Password for 'omannisto': **********

repotool: executing "/usr/bin/sh -c svn info --show-item=revision  http://[email protected]:8008/svn/oxford/AltiumComponentLibraries": exit status 1
make[1]: *** [Makefile:71: AltiumComponentLibraries-mirror] Error 1
make[1]: Leaving directory '/home/omannisto/repotest2'
make: *** [Makefile:62: AltiumComponentLibraries-git] Error 2
omannisto@olli-lt:~/repotest2$ nano Makefile

EDIT svn info command output

omannisto@olli-lt:~/repotest2$ svn info --show-item=revision  http://[email protected]:8008/svn/oxford/AltiumComponentLibraries
Authentication realm: <http://10.4.0.44:8008> Authorization Realm
Password for 'omannisto': **********

37557
omannisto@olli-lt:~/repotest2$

Solution

  • The problem is that repotool fires svn import using "sh -c" non-interactive session, this will duly fail since it cannot ask me for the database password. There's no way to define the password with reposurgeon. This would be a non-issue if this was a linux-box that's been using subversion for ages, but it's a virgin WSL installation for porting company svn database over to git.

    To fix the issue I installed gnome-keyring, kwallet was causing problems (error spam, wants to add ~95 packages) in wsl. With gnome-keyring installed and editing the ~/.subversion/config and servers to allow saving passwords using gnome-keyring, the password was saved after the first time it was asked and things started to work.

    To wit, add/edit line

    # password-stores = gnome-keyring
    

    in ~/.subversion/config [auth] section

    and add/edit lines

    # store-passwords = yes
    # store-auth-creds = yes
    

    in ~/.subversion/servers [global] section

    Installing gnome-keyring requires some extra effort on WSL, since it's essentially headless linux. First we install it like normal:

    sudo apt install gnome-keyring -y
    

    There are some problems with gnome keyring not actually starting properly, one way to get around it is to put this into the end of your .bashrc:

    echo 'db' | gnome-keyring-daemon --unlock
    

    With this the repotool mirror works fine, with or without using the makefile created by repotool initialize. You need to create a keyring when first using the password and after that you need to unlock it, once a session.