Blame SOURCES/0031-fix-removal-of-cpu-machine-links-on-mingw-msys.patch

f725e3
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
f725e3
From: Andrey Borzenkov <arvidjaar@gmail.com>
f725e3
Date: Sat, 18 Jan 2014 22:48:04 +0400
f725e3
Subject: [PATCH] fix removal of {cpu,machine} links on mingw/msys
f725e3
f725e3
At least on Windows 2003 using "ln -s dir1 dir2" in msys shell succeeds,
f725e3
but results in what looks like hard link. Subsequent "rm -f dir2" (e.g.
f725e3
during second config.status invocation) fails. Check that we also can
f725e3
remove link to directory.
f725e3
f725e3
Make it more clear in message that we are checking "ln -s".
f725e3
---
f725e3
 ChangeLog    | 5 +++++
f725e3
 acinclude.m4 | 6 +++---
f725e3
 2 files changed, 8 insertions(+), 3 deletions(-)
f725e3
f725e3
diff --git a/ChangeLog b/ChangeLog
f725e3
index cff9386d3d2..c3bfa9fcb1b 100644
f725e3
--- a/ChangeLog
f725e3
+++ b/ChangeLog
f725e3
@@ -1,3 +1,8 @@
f725e3
+2014-01-18  Andrey Borzenkov <arvidjaar@gmail.com>
f725e3
+
f725e3
+	* acinclude.m4 (grub_CHECK_LINK_DIR): Check that we can also remove
f725e3
+	symbolic link to directory. It fails in Msys shell on Windows 2003.
f725e3
+
f725e3
 2014-01-18  Vladimir Serbinenko  <phcoder@gmail.com>
f725e3
 
f725e3
 	* Makefile.am (default_payload.elf): Add modules
f725e3
diff --git a/acinclude.m4 b/acinclude.m4
f725e3
index 32d5477d100..b2bb88d838e 100644
f725e3
--- a/acinclude.m4
f725e3
+++ b/acinclude.m4
f725e3
@@ -418,15 +418,15 @@ else
f725e3
 [fi]
f725e3
 ])
f725e3
 
f725e3
-dnl Check if ln can handle directories properly (mingw).
f725e3
+dnl Check if ln -s can handle directories properly (mingw).
f725e3
 AC_DEFUN([grub_CHECK_LINK_DIR],[
f725e3
-AC_MSG_CHECKING([whether ln can handle directories properly])
f725e3
+AC_MSG_CHECKING([whether ln -s can handle directories properly])
f725e3
 [mkdir testdir 2>/dev/null
f725e3
 case $srcdir in
f725e3
 [\\/$]* | ?:[\\/]* ) reldir=$srcdir/include/grub/util ;;
f725e3
     *) reldir=../$srcdir/include/grub/util ;;
f725e3
 esac
f725e3
-if ln -s $reldir testdir/util 2>/dev/null ; then]
f725e3
+if ln -s $reldir testdir/util 2>/dev/null && rm -f testdir/util 2>/dev/null ; then]
f725e3
   AC_MSG_RESULT([yes])
f725e3
   [link_dir=yes
f725e3
 else