make the scripts more generic
adjust the patch so that it applies to trunk version 2542
http://bazaar.launchpad.net/~openpetracore/openpetraorg/trunkhosted/revision/2542