In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/7191ba826010be5f9fb9fcf3b1127d150479a588?hp=1d1f77a4a3d406b218c3066fcecead9a27cb2e11>

- Log -----------------------------------------------------------------
commit 7191ba826010be5f9fb9fcf3b1127d150479a588
Author: Andrew Fresh <[email protected]>
Date:   Sat May 31 15:37:52 2014 -0700

    Better handling of symlink creation
    
    OpenBSD heavily uses the mksymlinks define to build outside of the src
    tree.  This combines two commits from OpenBSD that improve the
    robustness and speed of creating the symlinks.
    
    From r1.24 by deraadt@:
    > After the MANIFEST-based symbolic link creation loop, there is a check
    > for a specific link to see if things worked out.  Add a check for the very
    > last file in the MANIFEST, as well, since we are trying to spot a very
    > odd bug where symbolic links are not being created.  Hopefully this will
    > help us diagnose it.
    
    http://www.openbsd.org/cgi-bin/cvsweb/src/gnu/usr.bin/perl/Configure#rev1.24
    
    And from r1.25 by millert@:
    > More efficient method of building the symlink tree that makes better
    > use of awk.  Slightly faster and works around an apparent namei or
    > buffer cache related bug on arm.
    
    http://www.openbsd.org/cgi-bin/cvsweb/src/gnu/usr.bin/perl/Configure#rev1.25
    
    Re-worked by Andy Armstrong to support the old awk used by systems
    such as Solaris, see [perl #122002].
-----------------------------------------------------------------------

Summary of changes:
 Configure | 45 ++++++++++++++++++++++++---------------------
 1 file changed, 24 insertions(+), 21 deletions(-)

diff --git a/Configure b/Configure
index 9bd6f18..795204c 100755
--- a/Configure
+++ b/Configure
@@ -2816,38 +2816,41 @@ $define|true|[yY]*)
        *)      case "$lns:$issymlink" in
                *"ln"*" -s:"*"test -"?)
                        echo "Creating the symbolic links..." >&4
-                       echo "(First creating the subdirectories...)" >&4
                        cd ..
-                       awk '{print $1}' $src/MANIFEST | grep / | sed 
's:/[^/]*$::' | sort -u | while true; do
-                               read directory
-                               test -z "$directory" && break
-                               mkdir -p $directory
-                       done
+                       awk '{print $1}' $src/MANIFEST | sed -e 's:/\([^/]*\)$: 
\1:' |
+                       awk 'NF == 1 {
+                               dir=".";
+                               file=$1 "";
+                            }
+                            NF == 2 {
+                               dir=$1 "";
+                               file=$2 "";
+                            }
+                            {
+                                print "# dir = ", dir, "file = ", file
+                                mf[dir] = mf[dir]" "src"/"dir"/"file;
+                            } END {
+                                for (d in mf) {
+                                    if (d != ".") { print("mkdir -p "d) }
+                                    print("ln -sf "mf[d]" "d);
+                                }
+                            }' src="$src" > UU/mksymlinks.$$
+                       sh UU/mksymlinks.$$
+                       rm UU/mksymlinks.$$
                        # Sanity check 1.
                        if test ! -d t/base; then
                                echo "Failed to create the subdirectories.  
Aborting." >&4
                                exit 1
                        fi
-                       echo "(Then creating the symlinks...)" >&4
-                       awk '{print $1}' $src/MANIFEST | while true; do
-                               read filename
-                               test -z "$filename" && break
-                               if test -f $filename; then
-                                       if $issymlink $filename; then
-                                               rm -f $filename
-                                       fi
-                               fi
-                               if test -f $filename; then
-                                       echo "$filename already exists, not 
symlinking."
-                               else
-                                       ln -s $src/$filename $filename
-                               fi
-                       done
                        # Sanity check 2.
                        if test ! -f t/base/lex.t; then
                                echo "Failed to create the symlinks 
(t/base/lex.t missing).  Aborting." >&4
                                exit 1
                        fi
+                       if test ! -f win32/win32.c; then
+                               echo "Failed to create the symlinks 
(win32/win32.c missing).  Aborting." >&4
+                               exit 1
+                       fi
                        cd UU
                        ;;
                *)      echo "(I cannot figure out how to do symbolic links, 
ignoring mksymlinks)." >&4

--
Perl5 Master Repository

Reply via email to