[Crossfire-wiki] [Crossfire DokuWiki] page changed: user:kbulgrien

no-reply_wiki at metalforge.org no-reply_wiki at metalforge.org
Sun May 10 22:38:54 CDT 2009


A page in your DokuWiki was added or changed. Here are the details:

Date        : 2009/05/10 22:38
User        : kbulgrien
Edit Summary: Update the svn-co.sh script to use command-line parameters & link arch in server/lib

@@ -25,98 +25,115 @@
  ====Portable C/C++====
      * [[http://www.gnu.org/software/automake/manual/autoconf/Portable-C-and-C_002b_002b.html#Portable-C-and-C_002b_002b|Automake Manual Chapter]]
  
  =====SVN Scripts=====
+ 
  
  
  ====svn-co.sh====
  
- This script can do svn 1.5.x sparse checkouts or pre-1.5 checkouts.  Set the if true/false as desired to get trunk, branch or both, but do not select both SVN 1.5.x Sparse Checkout and Pre-SVN 1.5 Checkout. 
+ This script can do svn 1.5.x sparse checkouts or pre-1.5 checkouts.  The script defaults to using subversion 1.5+ sparse checkouts.  If the older checkout style is desired, the script must be edited to change "if false" to "if true".
  
  Create the desired development directory first, then run the script to checkout.  For example:
  
    cd /home/devel/crossfire
-   bash svn-co.sh
+ 
+ Usage examples:
+ 
+   bash svn-co.sh trunk
+   bash svn-co.sh branch 1.12
  
  The script:
  
+   #!/bin/bash
    #
-   # Pre-SVN 1.5 Checkout
+   # Determine what to checkout based on the command-line parameters.
    #
-   if false
+   allmodules="arch client jxclient maps metaserver server sounds"
+   branchmodules="arch client maps server"
+   
+   if [ "${1}" = "trunk" ]
    then
-     CMD=""
-     CWD=$(pwd)
-     URL="https://crossfire.svn.sourceforge.net/svnroot/crossfire"
-     #
-     # Trunk
-     #
-     if true
+     COTYPE="trunk"
+   elif [ "${1}" = "branch" ]
+   then
+     COTYPE="branches/"
+     if [ -z "${2}" ]
      then
-       for file in arch client jxclient maps metaserver server sounds
-       do
-         DIR="${file}/trunk/"
-         if [ ! -d "${DIR}" ]
-         then
-           echo -e "\n${DIR}\n"
-           CMD="svn co ${*} ${URL}/${DIR} ${DIR}"
-           ${CMD}
-         fi
-       done
+       echo -e "\nsvn-co.sh: Error: Specify branch version.\n"
+       exit 1;
+     else
+       COTYPE="branches/${2}"
      fi
-     #
-     # Branches/1.x
-     #
-     if true
-     then
-       for file in arch client maps server
-       do
-         DIR="${file}/branches/1.x/"
-         if [ ! -d "${DIR}" ]
-         then
-           echo -e "\n${DIR}\n"
-           CMD="svn co ${*} ${URL}/${DIR} ${DIR}"
-           ${CMD}
-         fi
-       done
-     fi
-     echo
+   else
+     echo -e "\nsvn-co.sh: Error: Usage:\n"
+     echo -e "  svn-co.sh trunk"
+     echo -e "  svn-co.sh branch 1.xx"
+     echo -e "    where xx = the branch number.\n"
+     exit 1;
    fi
+   
+   # How shall the checkout be done?  The pre-svn 1.5 way, or via sparse
+   # checkout?  Always use sparse checkouts = false.
    #
-   # SVN 1.5.x Sparse Checkout
-   #
-   if true
+   if false
    then
-     svn co --depth=empty https://crossfire.svn.sourceforge.net/svnroot/crossfire .
-     for dir in arch client jxclient maps metaserver server sounds
+     #
+     # Pre-SVN 1.5 Checkout (deprecated).
+     #
+     CMD=""
+     CWD=$(pwd)
+     URL="https://crossfire.svn.sourceforge.net/svnroot/crossfire"
+     for module in ${allmodules}
      do
-       svn update --depth=files ${dir}
+       DIR="${module}/${COTYPE}"
+       if [ ! -d "${DIR}" ]
+       then
+         echo -e "\n${DIR}\n"
+         CMD="svn co ${*} ${URL}/${DIR} ${DIR}"
+         ${CMD}
+       fi
      done
+      echo
+   else
      #
-     # Trunk
+     # Sparse Checkout
      #
-     if true
+     # Do we have to initialize the workspace?
+     #
+     if [ ! -e .svn ]
      then
-       for dir in arch client jxclient maps metaserver server sounds
+       svn co --depth=empty https://crossfire.svn.sourceforge.net/svnroot/crossfire .
+       for dir in ${allmodules}
        do
-         svn update --depth=infinity ${dir}/trunk
+         svn update --depth=files ${dir}
        done
      fi
-     #
-     # Branch
-     #
-     if true
+   
+     path="${COTYPE%%/*}"
+     if [ "${COTYPE}" != "${COTYPE##branch*}" ]
      then
-       for dir in arch maps server sounds client sounds
+       # Branch
+       #
+       for module in ${branchmodules}
        do
-         svn update --depth=files ${dir}/branches
-       done
-       for dir in arch maps server client
-       do
-         svn update --depth=infinity ${dir}/branches/1.x
+         svn update --depth=files ${module}/${path}
        done
+       path="${path}/${COTYPE##*/}"
+       allmodules="${branchmodules}"
      fi
+     for module in ${allmodules}
+     do
+       svn update --depth=infinity ${module}/${path}
+     done
+     svn update --depth=infinity sounds/trunk
    fi
+   
+   # Link the arch directory into the server directory tree.
+   #
+   unlink $(pwd)/server/${COTYPE}/lib/arch
+   ln -s $(pwd)/arch/${COTYPE} $(pwd)/server/${COTYPE}/lib/arch
+   echo
  
  =====Configure Scripts=====
  
  ====trunk.autogen.sh====


IP-Address  : 68.90.128.197
Old Revision: http://wiki.metalforge.net/doku.php/user:kbulgrien?rev=1229843483
New Revision: http://wiki.metalforge.net/doku.php/user:kbulgrien

-- 
This mail was generated by DokuWiki at
http://wiki.metalforge.net/




More information about the crossfire-wiki mailing list