<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">

<chapter id="chapter02">
  <chapterinfo>
    <othername>$Author: igor $</othername>
    <date>$Date: 2013-05-26 15:01:55 -0400 (Sun, 26 May 2013) $</date>
  </chapterinfo>
  <title><application>Subversion</application> Access</title>
  <?dbhtml filename="chapter02.html" ?>

  <section id="ch02-introduction">
    <title>Introduction</title>

    <para>The LFS <application>Subversion</application>
    (<acronym>SVN</acronym>) server provides services for all of the *LFS projects
    (and some others).  The tree which we are interested in for BLFS editing is
    (unsurprisingly) the BLFS tree.  A complete list of the modules which are
    available can be found using the interface at <ulink
    url="http://wiki.linuxfromscratch.org/blfs/browser/trunk"/>.</para>

    <para>There are two types of SVN access provided to the BLFS tree: anonymous
    read-only access which anyone can use and read-write access granted to active
    editors who have higgs accounts with membership in the appropriate groups.</para>

  </section>

  <section id="ch02-anonsvn">
    <title>Anonymous Access</title>

    <para>To get anonymous access, simply use the following command:</para>

<screen><userinput>svn co svn://svn.linuxfromscratch.org/BLFS/trunk</userinput></screen>

    <para>This will create a BLFS directory and copy the current working
    tree into it.  When you wish to update your local copy (often called a
    sand box), simply cd into the directory and run:</para>

<screen><userinput>svn update</userinput></screen>

  </section>

  <section id="ch02-svnssh">
    <title>SVN SSH Access (for editors)</title>

    <para>For editors, access is slightly more complicated.  You first need
    to generate yourself an ssh key-pair.  You then need to upload your public key
    into your <filename>~/.ssh</filename> directory on higgs.  To generate the
    keys run:</para>

<screen><userinput>ssh-keygen -t dsa</userinput></screen>

    <para>When prompted where to save them, it's probably best to leave them in
    <filename class="directory">~/.ssh</filename> (as <filename>id_dsa</filename>
    and <filename>id_dsa.pub</filename>) unless you already have ssh keys there.
    You can use a null passphrase, but use of ssh-agent with a good password is
    recommended.  Having generated your keys, upload
    <filename>~/.ssh/id_dsa.pub</filename> to higgs and move it to
    <filename>~/.ssh/authorized_keys</filename> <emphasis>on higgs</emphasis>.
    Your local copy of <filename>id_dsa</filename> and
    <filename>id_dsa.pub</filename> should remain untouched by this.</para>

    <para>If your local userid and your higgs userid differ, you will
    need to create a <filename>~/.ssh/config</filename> file on your local system
    with the contents:</para>

<screen><userinput>cat &gt;&gt; ~/.ssh/config &lt;&lt; "EOF"
<literal>Host svn.linuxfromscratch.org
User &lt;higgs-userid&gt;
RhostsRSAAuthentication yes</literal>
EOF
chmod g-w ~/.ssh/config</userinput></screen>

    <para>Once you have this setup, try to checkout the BLFS tree using:</para>

<screen><userinput>svn co svn+ssh://svn.linuxfromscratch.org/BLFS/trunk</userinput></screen>

    <para>If this works, you'll get a nice trunk directory listing and you have
    your own sandbox!  You also have write access so from now on be extra
    careful but note that <emphasis>no</emphasis> changes will be made until
    you use a <userinput>svn commit</userinput> command.</para>

    <para>As with anonymous access, you can update your local copy by simply
    changing into the appropriate directory and running:</para>

<screen><userinput>svn update</userinput></screen>

  </section>

</chapter>
