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

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