SHA256
1
0
forked from pool/grub2

Accepting request 311735 from home:michael-chang:branches:Base:System

- If we have a post entry and the description field is empty, we should use the
  "Pre" number and add that description to the post entry. (fate#317972)
- Show user defined comments in grub2 menu for snapshots (fate#318101)
  * modified grub2-snapper-plugin.sh

OBS-URL: https://build.opensuse.org/request/show/311735
OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=167
This commit is contained in:
Michael Chang 2015-06-15 09:44:44 +00:00 committed by Git OBS Bridge
parent de144dc272
commit eae0d17794
2 changed files with 27 additions and 3 deletions

View File

@ -62,12 +62,28 @@ snapshot_submenu () {
kernel_ver=`readlink ${snapshot}/boot/image | sed -e 's/^image-//' -e 's/-default$//'`
fi
eval `cat ${snapshot}/etc/os-release`
# FATE#318101
# Show user defined comments in grub2 menu for snapshots
# Use userdata tag "bootloader=[user defined text]"
desc=`xmllint --xpath "/snapshot/userdata[key='bootloader']/value/text()" "${s_dir}/info.xml" 2>/dev/null || echo ""`
test -z "$desc" && desc=`xmllint --xpath '/snapshot/description/text()' "${s_dir}/info.xml" 2>/dev/null || echo ""`
# FATE#317972
# If we have a post entry and the description field is empty,
# we should use the "Pre" number and add that description to the post entry.
if test -z "$desc" -a "$stype" = "post"; then
pre_num=`xmllint --xpath '/snapshot/pre_num/text()' "${s_dir}/info.xml" 2>/dev/null || echo ""`
if test -n "$pre_num"; then
if test -f "${snapper_snapshot_path}/${pre_num}/info.xml" ; then
desc=`xmllint --xpath '/snapshot/description/text()' "${snapper_snapshot_path}/${pre_num}/info.xml" 2>/dev/null || echo ""`
fi
fi
fi
test "$important" = "yes" && important="*" || important=" "
test "$stype" = "single" && stype=""
test -z "$stype" || stype=",$stype"
desc=`xmllint --xpath '/snapshot/description/text()' "${s_dir}/info.xml" 2>/dev/null || echo ""`
#test "$desc" = "timeline" && return 1
test -z "$desc" || desc=",$desc"
title="${important}${NAME} $VERSION ($kernel_ver,$date$stype$desc)"

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Fri Jun 12 07:20:00 UTC 2015 - mchang@suse.com
- If we have a post entry and the description field is empty, we should use the
"Pre" number and add that description to the post entry. (fate#317972)
- Show user defined comments in grub2 menu for snapshots (fate#318101)
* modified grub2-snapper-plugin.sh
-------------------------------------------------------------------
Sun Jun 7 04:00:56 UTC 2015 - arvidjaar@gmail.com