From 1e22dfaf1fc71008f3d6084bcfbe7333fe8c93f0 Mon Sep 17 00:00:00 2001 From: Gilles Depeyrot Date: Sat, 4 May 2002 14:19:09 +0000 Subject: [PATCH] utility scripts to manipulate xml CodeWarrior 5.3 project files git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15373 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/mac/M5converteol.sh | 25 +++++++++++++++++++++++++ docs/mac/M5replace.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100755 docs/mac/M5converteol.sh create mode 100755 docs/mac/M5replace.sh diff --git a/docs/mac/M5converteol.sh b/docs/mac/M5converteol.sh new file mode 100755 index 0000000000..7cc1aa8aef --- /dev/null +++ b/docs/mac/M5converteol.sh @@ -0,0 +1,25 @@ +#!/bin/sh +#----------------------------------------------------------------------------- +#-- Name: docs/mac/M5converteol.sh +#-- Purpose: Convert end-of-lines in CodeWarrior exported XML project files +#-- Author: Gilles Depeyrot +#-- Modified by: +#-- Created: 07.01.2002 +#-- RCS-ID: $Id$ +#-- Copyright: (c) 2001 Gilles Depeyrot +#-- Licence: wxWindows licence +#----------------------------------------------------------------------------- + +echo "Searching for xml files..." +files=`find ../.. -name "*.xml" -print` + +for f in $files +do + cat $f | tr '\r' '\n' > $f.new + if [ "`diff -q $f $f.new`" != "" ] ; then + mv $f.new $f + echo "Converted $f" + else + rm $f.new + fi +done diff --git a/docs/mac/M5replace.sh b/docs/mac/M5replace.sh new file mode 100755 index 0000000000..9cbc741794 --- /dev/null +++ b/docs/mac/M5replace.sh @@ -0,0 +1,32 @@ +#!/bin/sh +#----------------------------------------------------------------------------- +#-- Name: docs/mac/M5replace.sh +#-- Purpose: Replace a string in CodeWarrior exported XML project files +#-- Author: Gilles Depeyrot +#-- Modified by: +#-- Created: 08.01.2002 +#-- RCS-ID: $Id$ +#-- Copyright: (c) 2001 Gilles Depeyrot +#-- Licence: wxWindows licence +#----------------------------------------------------------------------------- + +echo -n "Replace '$1' with '$2' in xml project files? [y/N]" +read ans + +if [ "$ans" != "y" ] ; then + exit +fi + +echo "Searching for xml files..." +files=`find ../.. -name "*.xml" -print` + +for f in $files +do + cat $f | sed -e "s,$1,$2," > $f.new + if [ "`diff -q $f $f.new`" != "" ] ; then + mv $f.new $f + echo "Replaced in $f..." + else + rm $f.new + fi +done -- 2.47.2