ForgePatch/forge/update_patches.sh

42 lines
868 B
Bash
Raw Normal View History

echo Creating directories
2012-02-21 08:53:33 +00:00
fdir=$PWD
cd ..
for i in `find src_work -type d`
do
2012-02-21 08:53:33 +00:00
mkdir --parents "$fdir/patches${i##src_work}"
done
echo Creating patches
2012-02-21 08:53:33 +00:00
cd src_work
for i in `find ../src_work -type f`
do
2012-02-21 08:53:33 +00:00
ibase=${i##../src_work}
diff -u ../src_base$ibase $i -r --strip-trailing-cr --new-file | sed -e "1,2s/[0-9-]* [0-9:\.]* [+-][0-9]*\b/0000-00-00 00:00:00.000000000 -0000/" | tr -d \r > $fdir/patches$ibase.patch
done
2012-02-21 08:53:33 +00:00
cd ..
echo Removing empty patches
2012-02-21 08:53:33 +00:00
find $fdir/patches -size 0 -type f -name \*.patch -delete
for i in `find $fdir/patches -depth -empty -type d | grep -a -v "svn"`
do
rmdir "$i"
done
echo Grabbing copy of conf folder
2012-02-21 08:53:33 +00:00
for i in `find $fdir/conf -type f | grep -a -v "svn"`
do
rm $i
done
2012-02-21 08:53:33 +00:00
for i in `find $fdir/conf -depth -empty -type d | grep -a -v "svn"`
do
rmdir "$i"
done
2012-02-21 08:53:33 +00:00
mkdir -p $fdir/conf
cp -r conf/* $fdir/conf
echo Finished