Code Search for Developers
 
 
  

svn_relocate.sh from SME Web Application Framework at Krugle


Show svn_relocate.sh syntax highlighted

#!/bin/bash
### When the path of the directory 'content/' (this directory)
### changes (e.g. when the application is moved to another path),
### the path of the subversion repositories changes as well,
### since they are inside this directory. As a result, the svn
### working copies (sandboxes) do not work anymore, they still
### are connected to the old repositories.
###  
### This script is used to fix this problem. It changes the URL 
### of the SVN working copies according to the new path of 'content/'.

### go to this directory
cd $(dirname $0)

old_path=/var/www/html/tools/docs_1/content
new_path=/var/www/html/tools/docs/content

function relocate_all
{
  until [ -z "$1" ]  # until all parameters used up...
  do
    local book_id=$1
    local lng=$2
    echo "relocating $book_id $lng"
    relocate_book $book_id $lng
    shift
    shift
  done
}

function relocate_book
{
  local book_id=$1
  local lng=$2

  # get the old and new urls
  path="books/xml/$book_id/$lng/"
  old_url=$(svn info $path | grep 'URL:' | gawk '{print $2}')
  pwd=$(pwd)
  new_url="file://$pwd/books/svn/$book_id/$lng/trunk"

  # relocate the public and workspace copies 
  svn switch --relocate $old_url $new_url  books/xml/$book_id/$lng/
  svn switch --relocate $old_url $new_url  workspace/xml/$book_id/$lng/
}

### get a list of all the books and relocate them
book_list=$(gawk -F: '{print $1" "$2}' books/book_list)
relocate_all $book_list

### relocate the copy in SVN and 'xml_source/' in downloads
pwd=$(pwd)
. SVN/svn_dir.txt  ## get the variable $svn_dir
old_url=$(SVN/get_url.sh)
new_url="file://$pwd/SVN/repository/$svn_dir/trunk"
echo "relocating SVN/$svn_dir"
svn switch --relocate $old_url $new_url SVN/$svn_dir
echo "relocating downloads/xml_source"
svn switch --relocate $old_url $new_url downloads/xml_source






See more files for this project here

SME Web Application Framework

smewebapp intends to simplify the construction of web applications for informatization of the work of SME-s (small and medium enterprises), institutions, organizations etc.

Project homepage: http://sourceforge.net/projects/smewebapp
Programming language(s): JavaScript,PHP,Shell Script,XML
License: other

  SVN/
    README
    book_list.sh
    commit-email.pl
    commit.sh
    commit_all.sh
    get_url.sh
    init.sh
    post-commit.tmpl
    sync.sh
    sync_all.sh
    txt_diff.sh
    update.sh
    update_all.sh
  books_media/
  cache/
    cache.sh
    html2xhtml.php
  downloads/
    test/
      kurani_1.tex
      kurani_1.xml
      test.sh
    checkout_xml_sources.sh
    make-all-downloads.sh
    make-downloads.sh
    sgml_dsssl.sh
    xml2latex.xsl
    xml_xsl.sh
  explode/
    explode.sh
    post_process.php
    pre_process.php
  implode/
    implode.sh
    post_process.php
    pre_process.php
    section2sect.sh
  initial_xml/
    GNU-FDL.xml
    article_template_en.xml
    book_template_en.xml
    docbookwiki_guide_en.xml
    menushpk_manual_en.xml
    menushpk_manual_sq_AL.xml
    smewebapp_manual_en.xml
    transform.xsl
    transform_template.xsl
  test/
    get_id.sh
    get_lang.sh
    sect2section.sh
    section2sect.sh
  book_list.sh
  clean.sh
  import.sh
  make-content.sh
  svn_relocate.sh