cfi build fixes in x86-64 ghash assembly
[openssl.git] / util / copy.pl
index ef4d8708e24789cc3cfc50fa77ca5f4c7481bbbe..58ecc82c48fe000705c0fc2f91631f8c8a185798 100644 (file)
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
 #! /usr/bin/env perl
-# Copyright 2005-2016 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2005-2018 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the OpenSSL license (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
 #
 # Licensed under the OpenSSL license (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -18,6 +18,7 @@ use Fcntl;
 my $stripcr = 0;
 
 my $arg;
 my $stripcr = 0;
 
 my $arg;
+my @excludes = ();
 
 foreach $arg (@ARGV) {
        if ($arg eq "-stripcr")
 
 foreach $arg (@ARGV) {
        if ($arg eq "-stripcr")
@@ -25,10 +26,16 @@ foreach $arg (@ARGV) {
                $stripcr = 1;
                next;
                }
                $stripcr = 1;
                next;
                }
+       if ($arg =~ /^-exclude_re=(.*)$/)
+               {
+               push @excludes, $1;
+               next;
+               }
        $arg =~ s|\\|/|g;       # compensate for bug/feature in cygwin glob...
        $arg =~ s|\\|/|g;       # compensate for bug/feature in cygwin glob...
-       foreach (glob qq("$arg"))
+       $arg = qq("$arg") if ($arg =~ /\s/);    # compensate for bug in 5.10...
+       foreach my $f (glob $arg)
                {
                {
-               push @filelist, $_;
+               push @filelist, $f unless grep { $f =~ /$_/ } @excludes;
                }
 }
 
                }
 }
 
@@ -40,7 +47,7 @@ if ($fnum <= 1)
        }
 
 $dest = pop @filelist;
        }
 
 $dest = pop @filelist;
-       
+
 if ($fnum > 2 && ! -d $dest)
        {
        die "Destination must be a directory";
 if ($fnum > 2 && ! -d $dest)
        {
        die "Destination must be a directory";
@@ -73,5 +80,5 @@ foreach (@filelist)
        close(OUT);
        print "Copying: $_ to $dfile\n";
        }
        close(OUT);
        print "Copying: $_ to $dfile\n";
        }
-               
+