Adapt the OS X build to use the OS X tar
[openssl.git] / util / openssl-format-source
index e1606a7f40c7cbbae0c8c1494f151639e9b63678..8c3a7c0dbb9449fc61ea08d47a8baeefc2d889e5 100755 (executable)
@@ -30,6 +30,7 @@ VERBOSE=false
 DONT=false
 STOPARGS=false
 COMMENTS=false
+DEBUG=""
 
 # for this exercise, we want to force the openssl style, so we roll
 # our own indent profile, which is at a well known location
@@ -54,6 +55,10 @@ do
       -c) COMMENTS="true"; 
          INDENT_ARGS="-fc1 -fca -cdb -sc"; 
          continue;;
+      -nc) COMMENTS="true";
+         continue;;
+      -d) DEBUG='eval tee "$j.pre" |'
+         continue;;
     esac
   fi
 
@@ -88,7 +93,7 @@ do
       case `basename $j` in 
        # the list of files that indent is unable to handle correctly
        # that we simply leave alone for manual formatting now
-       obj_dat.h|aes_core.c|aes_x86core.c)
+       obj_dat.h|aes_core.c|aes_x86core.c|ecp_nistz256.c)
          echo "skipping $j"
          ;;
        *)
@@ -114,11 +119,11 @@ do
              -e 's/^((DECLARE|IMPLEMENT)_(EXTERN_ASN1|ASN1|ADB|STACK_OF|PKCS12_STACK_OF).*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \
              -e 's/^([ \t]*(make_dh|make_dh_bn|make_rfc5114_td)\(.*\)[ \t,]*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \
              -e 's/^(ASN1_ADB_TEMPLATE\(.*)$/\/**INDENT-OFF**\/\n$1\n\/**INDENT-ON**\//;' \
-             -e 's/^((ASN1|ADB)_.*_END\(.*[\){=,;]+[ \t]*)$/$1\n\/**INDENT-ON**\//;' \
+             -e 's/^((ASN1|ADB)_.*_(end|END)\(.*[\){=,;]+[ \t]*)$/$1\n\/**INDENT-ON**\//;' \
              -e '/ASN1_(ITEM_ref|ITEM_ptr|ITEM_rptr|PCTX)/ || s/^((ASN1|ADB)_[^\*]*[){=,]+[ \t]*)$/\/**INDENT-OFF**\/\n$1/;' \
              -e 's/^(} (ASN1|ADB)_[^\*]*[\){=,;]+)$/$1\n\/**INDENT-ON**\//;' \
              | \
-             indent $INDENT_ARGS | \
+             $DEBUG indent $INDENT_ARGS | \
              perl -np \
                -e 's/^([ \t]*)\/\*-(.*)\*\/[ \t]*$/$1\/*$2*\//;' \
                -e 's/^\/\*-((Copyright|=|----).*)$/\/* $1/;' \