If a file is already FatELF, do a replace instead of a glue.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 04 Oct 2009 16:16:00 -0400
changeset 69 eac4c3810ee4
parent 68 79f33789900d
child 70 d702ac585686
If a file is already FatELF, do a replace instead of a glue.
misc/merge.sh
--- a/misc/merge.sh	Sun Oct 04 16:15:45 2009 -0400
+++ b/misc/merge.sh	Sun Oct 04 16:16:00 2009 -0400
@@ -22,7 +22,13 @@
 for feh in `cat binaries-32` ; do
     mkdir -p --mode=0755 `dirname "/$feh"`
     if [ -f "/$feh" ]; then
-        ./fatelf-glue tmp-fatelf "/$feh" "/x86/$feh"
+        FATELF=0
+        ./fatelf-validate "/$feh" && ISFATELF=1
+        if [ "x$ISFATELF" = "x1" ]; then
+            ./fatelf-replace tmp-fatelf "/$feh" "/x86/$feh"
+        else
+            ./fatelf-glue tmp-fatelf "/$feh" "/x86/$feh"
+        fi
         chmod --reference="/$feh" tmp-fatelf
         mv tmp-fatelf "/$feh"
     else