Build directory creation with SVN property copying
Suggest you have a multi-program project using our usual schema and want to add a new program prog2
with similar build scheme as prog1
.
First set some helper variables to be able to use the loops below:
PROG="prog1" NEWPROG="prog2" AL="unix mingx" BL="debug release"
Then create the directories:
for A in ${AL} ; do for B in ${BL} ; do mkdir -pv build/$A/$B/programs/${NEWPROG} done ; done
You also might want to copy Makefiles:
for A in ${AL} ; do for B in ${BL} ; do cat build/$A/$B/programs/${PROG}/Makefile |sed -e "s/${PROG}/${NEWPROG}/g" >build/$A/$B/programs/${NEWPROG}/Makefile done ; done
Finally You might want to svn add
the new directories and copy the svn properties, especially svn:ignore
, like this:
for A in ${AL} ; do for B in ${BL} ; do svn add build/$A/$B/programs/${NEWPROG} svn propget svn:ignore build/$A/$B/programs/${PROG} |sed -e "s/${PROG}/${NEWPROG}/g" >/tmp/svn.props svn propset svn:ignore build/$A/$B/programs/${NEWPROG} --file /tmp/svn.props done ; done
Script for single-module projekcts
For simpler projects with one directory you might find https://svn.clazzes.org/svn/pba/trunk/pba-helloworld-portable/scripts/set_svn_ignore.sh very useful.
Just create a scripts/
directory right besides the debian*/
directory, svn export
the script there, and call it.