Le jeu 15/07/2004 à 00:45, Michael Prager a écrit :
>> src/ in now splitted into small subdirectories (...)

Just for information : change file names was very boring and very long
... I used rename and sed scripts.

Example of rename :
  rename 's/jeu/game/' *

Example of SED script :
  s/"jeu.h"/"../game/game.h"/g
  s/"base.h"/"../include/base.h"/g

I also used bash script, in particulary to simplify #include (e.g.
#include "../team/team.h" changed to #include "team.h" because it was
used in team subdirectoy) :
---
if [ "$1x" == "x" ]; then
  echo "give subdirectory ..."
  exit 1
fi

for i in `find $1/ -name "*.cpp" -o -name "*.h"`; do
  echo $i
  mv $i $i.old
  sed -e 's~#include "../$1/~#include "~g' $i.old >$i
  rm $i.old
done
---
(I'm not sure of my regular expression, I deleted all scripts ...)

THANKS YOU REGEX !

Bye, Haypo


Répondre à