permission mods
[feisty_meow.git] / scripts / clam / cpp / ms_manifest.sh
index a752837cc893309fbb4aa382ce4bfadcb6ec4ab0..94f0f66961f494266861762d8c2d14be0acebc03 100644 (file)
@@ -1,25 +1,33 @@
 #!/bin/bash
-# the basename is the file that needs its manifest stuffed into the file
+# the target is the file that needs its manifest stuffed into the file
 # itself.  the where parameter tells us what index to use when stuffing it.
-basename=$1
-where=$2
+target=$1; shift
+where=$1; shift
 if [ -z "$WIN32_MANIFEST_FILE" ]; then
-  WIN32_MANIFEST_FILE=$CLAM_DIR/cpp/ms_manifests/security_manifest.txt 
-fi
-error_val=0
-if [ -f "$basename.manifest" -a -f "$basename" ]; then 
-  bash $BUILD_SCRIPTS_DIR/wrapdoze.sh mt -manifest $basename.manifest $WIN32_MANIFEST_FILE -outputresource:$basename\;$where >/dev/null 
-  error_val=$?
-elif [ -f "$basename" ]; then 
-  bash $BUILD_SCRIPTS_DIR/wrapdoze.sh mt -manifest $WIN32_MANIFEST_FILE -outputresource:$basename\;$where >/dev/null
-  error_val=$?
-else
-  echo skipping manifest generation for $basename.
-  if [ ! -f "$basename.manifest" ]; then echo manifest file was missing.; fi
-  if [ ! -f "$basename" ]; then echo main file was missing.; fi
+  WIN32_MANIFEST_FILE=$CLAM_SCRIPTS/cpp/ms_manifests/security_manifest.txt 
 fi
+for ((count=1 ; count <= 10; count++)); do
+  error_val=0
+  if [ -f "$target.manifest" -a -f "$target" ]; then 
+    bash $BUILD_SCRIPTS_PATH/wrapdoze.sh mt -manifest $target.manifest $WIN32_MANIFEST_FILE -outputresource:$target\;$where >/dev/null 
+    error_val=$?
+  elif [ -f "$target" ]; then 
+    bash $BUILD_SCRIPTS_PATH/wrapdoze.sh mt -manifest $WIN32_MANIFEST_FILE -outputresource:$target\;$where >/dev/null
+    error_val=$?
+  else
+    echo skipping manifest generation for $target.
+    if [ ! -f "$target.manifest" ]; then echo manifest file was missing.; fi
+    if [ ! -f "$target" ]; then echo main file was missing.; fi
+    break
+  fi
+  if [ $error_val -ne 0 ]; then
+    echo "Error attaching manifest to $target at try #$count."
+  else
+    break
+  fi
+done
 if [ $error_val -ne 0 ]; then
-  echo There was an error attaching manifest to $1.
+  echo There was an error attaching manifest to $target.
   exit 12
 fi