Skip to content

Instantly share code, notes, and snippets.

@fabienhinault
Last active August 29, 2015 14:00
Show Gist options
  • Save fabienhinault/61f905f4a9d5234bf6b7 to your computer and use it in GitHub Desktop.
Save fabienhinault/61f905f4a9d5234bf6b7 to your computer and use it in GitHub Desktop.
#!/bin/sh
localdir=$(dirname $0)
gen=$(realpath $localdir/../Generation_Int)
files=$localdir/tocopy
copy_debug()
{
echo $1
if [ ! -f $gen/*/$1D.dll ]
then
locate -d $localdir/locatedb -r "/$1.dll\$" |sed -rn "s#.*#cp $localdir/$1D.dll \$(dirname '&'); echo '&'#p" | sh
# find $gen -iname $1.dll -exec dirname '{}' \; | sed -rn "s#.*#cp $localdir/$1D.dll '&'; echo '&'#p" | sh
fi
}
copy_debug "xerces-c_2_6"
copy_debug "mfc71"
copy_debug "msvcr71"
copy_debug "msvcp71"
#! /bin/sh
localdir=$(dirname $0)
gen=$(realpath $localdir/..)
files=$localdir/tocopy
for f in $(ls $files)
do
src=$files/$f
find $gen -path $files -prune -o -iname "$f" -print | sed -nr "s#.*#cmp -s $src '&' || if [ -f '&'~ ]; then cp -pf $src '&'; else cp -pfb $src '&'; fi; echo '&'#p" | sh
done
#!/bin/sh
echo "Remove debug DLLs"
localdir=$(dirname $0)
gen=$(realpath $localdir/../Generation_Int)
rm_debug()
{
find $gen -iname "$1D.dll" -exec rm "{}" \;
}
rm_debug "xerces-c_2_6"
rm_debug "mfc71"
rm_debug "msvcr71"
rm_debug "msvcp71"
#! /bin/sh
localdir=$(dirname $0)
gen=$(realpath $localdir/..)
find $gen -path $files -prune -o -iname "*~" -print | sed -nr "s#(.*)~#mv -f '&' '\1'; echo '&'#p" | sh
find $gen -path $files -prune -o -iname "*.~1~" -print | sed -nr "s#(.*)\.~1~#mv -f '&' '\1'; echo '&'#p" | sh
find $gen -path $files -prune -o -iname "*.~?~" -print | sed -nr "s#.*\.~[2-9]~#rm '&'; echo '&'#p" | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment