Code Search for Developers
 
 
  

txt_diff.sh from SME Web Application Framework at Krugle


Show txt_diff.sh syntax highlighted

#!/bin/bash
### get the old and new revions of the given xml file from cvs
### converts them to text format, and makes a diff

if [ $# -ne 2 ]
then
  echo "Usage: $0 repository revision"
  exit 1
fi

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

repos=$1
rev=$2

svnlook=/usr/bin/svnlook

### get the file that was changed
file=$($svnlook changed $repos -r $rev | sed 's/^U *//')

### get from svn the old and new versions in a temporary directory
p_rev=$(($rev - 1))  # previos revision number
mkdir -p tmp/
$svnlook cat $repos $file -r $p_rev > tmp/old_version.xml
$svnlook cat $repos $file -r $rev   > tmp/new_version.xml

### convert to text format
xmlto txt -v -o tmp/ tmp/old_version.xml 2>>tmp/output.txt
xmlto txt -v -o tmp/ tmp/new_version.xml 2>>tmp/output.txt

### find the difference of the text formats
diff -ubB tmp/old_version.txt tmp/new_version.txt | sed '1,2d'

### clean the temporary files
rm -rf tmp/




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

  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