* util/grub-mkconfig_lib.in (make_system_path_relative_to_its_root):

Remove broken Cygwin path conversion.
	* util/misc.c: [__CYGWIN__] Add include and define.
	[__CYGWIN__] (get_win32_path): Copy function from getroot.c, modify
	for Cygwin 1.7.
	(make_system_path_relative_to_its_root): Simplify loop, replace early
	return by break.
	[__CYGWIN__] Add conversion to win32 path.
	Include "/" case in trailing slash removal.
This commit is contained in:
Christian Franke 2010-05-01 21:39:32 +02:00 committed by Vladimir 'phcoder' Serbinenko
parent 3558c6e93c
commit d1b61374ed
3 changed files with 58 additions and 33 deletions

View file

@ -1,5 +1,5 @@
# Helper library for grub-mkconfig
# Copyright (C) 2007,2008,2009 Free Software Foundation, Inc.
# Copyright (C) 2007,2008,2009,2010 Free Software Foundation, Inc.
#
# GRUB is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -44,21 +44,7 @@ grub_warn ()
make_system_path_relative_to_its_root ()
{
path="`${grub_mkrelpath} $1`"
case "`uname 2>/dev/null`" in
CYGWIN*)
# Cygwin: Check if regular or emulated mount.
if [ -z "$dir" ] || [ "`stat -c %D "$dir/.."`" != 620000 ] ; then
# Reached some mount point not below /cygdrive.
# GRUB does not know Cygwin's emulated mounts,
# convert to Win32 path and remove drive letter.
path=`cygpath -m "$path" | sed -n 's,^[A-Za-z]:,,p'`
test ! -z "$path" || return 1
fi ;;
esac
echo "$path"
${grub_mkrelpath} $1
}
is_path_readable_by_grub ()