debian/{postinst,config}.in: Don't fail if /etc/default/grub.d

configuration snippets exist, but /etc/default/grub does not.
This commit is contained in:
Adam Conrad 2013-01-04 14:17:14 -07:00
parent 92b1137f35
commit 7a110bd08d
3 changed files with 24 additions and 15 deletions

7
debian/changelog vendored
View File

@ -1,3 +1,10 @@
grub2 (2.00-11) UNRELEASED; urgency=low
* debian/{postinst,config}.in: Don't fail if /etc/default/grub.d
configuration snippets exist, but /etc/default/grub does not.
-- Adam Conrad <adconrad@debian.org> Fri, 04 Jan 2013 13:11:42 -0700
grub2 (2.00-10) experimental; urgency=low
* Support parallel builds.

14
debian/config.in vendored
View File

@ -36,14 +36,14 @@ case @PACKAGE@ in
;;
esac
if test -e /etc/default/grub ; then
. /etc/default/grub
for x in /etc/default/grub.d/*.cfg ; do
if [ -e "$x" ]; then
. "$x"
fi
done
for x in /etc/default/grub /etc/default/grub.d/*.cfg ; do
if [ -e "$x" ]; then
DEFAULT_FOUND="yes"
. "$x"
fi
done
if [ "$DEFAULT_FOUND" = "yes" ]; then
db_set grub2/linux_cmdline "$GRUB_CMDLINE_LINUX"
db_set grub2/linux_cmdline_default "$GRUB_CMDLINE_LINUX_DEFAULT"
fi

18
debian/postinst.in vendored
View File

@ -281,15 +281,17 @@ get_mountpoint()
config_item()
{
if [ -f /etc/default/grub ]; then
. /etc/default/grub || return
for x in /etc/default/grub.d/*.cfg; do
if [ -e "$x" ]; then
. "$x"
fi
done
for x in /etc/default/grub /etc/default/grub.d/*.cfg; do
if [ -e "$x" ]; then
DEFAULT_FOUND="yes"
. "$x"
fi
done
if [ "$DEFAULT_FOUND" = "yes" ]; then
eval echo "\$$1"
else
return
fi
eval echo "\$$1"
}
case "$1" in