X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Fpatch_deps.sh;fp=helm%2Focaml%2Fpatch_deps.sh;h=cd9f09c8976277102a8ce1dbf84b3d9cb5dce574;hb=792b5d29ebae8f917043d9dd226692919b5d6ca1;hp=0000000000000000000000000000000000000000;hpb=a14a8c7637fd0b95e9d4deccb20c6abc98e8f953;p=helm.git diff --git a/helm/ocaml/patch_deps.sh b/helm/ocaml/patch_deps.sh new file mode 100755 index 000000000..cd9f09c89 --- /dev/null +++ b/helm/ocaml/patch_deps.sh @@ -0,0 +1,32 @@ +#!/bin/sh +# script args: source_file target_file + +use_clusters='no' +if [ ! -z "$USE_CLUSTERS" ]; then + use_clusters=$USE_CLUSTERS +fi + +# args: file snippet +# file will be modified in place +include_dot_snippet () +{ + echo "Adding to $1 graphviz snipet $2 ..." + sed -i "/digraph/r $2" $1 +} + +# args: file patch +apply_patch () +{ + if [ -f "$2" ]; then + echo "Applying to $1 patch $2 ..." + patch $1 $2 + fi +} + +cp $1 $2 +apply_patch $2 deps.patch +include_dot_snippet $2 daemons.dot +if [ "$use_clusters" = "yes" ]; then + include_dot_snippet $2 clusters.dot +fi +