permission mods
[feisty_meow.git] / scripts / clam / cpp / ms_manifest.sh
1 #!/bin/bash
2 # the target is the file that needs its manifest stuffed into the file
3 # itself.  the where parameter tells us what index to use when stuffing it.
4 target=$1; shift
5 where=$1; shift
6 if [ -z "$WIN32_MANIFEST_FILE" ]; then
7   WIN32_MANIFEST_FILE=$CLAM_SCRIPTS/cpp/ms_manifests/security_manifest.txt 
8 fi
9 for ((count=1 ; count <= 10; count++)); do
10   error_val=0
11   if [ -f "$target.manifest" -a -f "$target" ]; then 
12     bash $BUILD_SCRIPTS_PATH/wrapdoze.sh mt -manifest $target.manifest $WIN32_MANIFEST_FILE -outputresource:$target\;$where >/dev/null 
13     error_val=$?
14   elif [ -f "$target" ]; then 
15     bash $BUILD_SCRIPTS_PATH/wrapdoze.sh mt -manifest $WIN32_MANIFEST_FILE -outputresource:$target\;$where >/dev/null
16     error_val=$?
17   else
18     echo skipping manifest generation for $target.
19     if [ ! -f "$target.manifest" ]; then echo manifest file was missing.; fi
20     if [ ! -f "$target" ]; then echo main file was missing.; fi
21     break
22   fi
23   if [ $error_val -ne 0 ]; then
24     echo "Error attaching manifest to $target at try #$count."
25   else
26     break
27   fi
28 done
29 if [ $error_val -ne 0 ]; then
30   echo There was an error attaching manifest to $target.
31   exit 12
32 fi
33