diff --git a/grub2-snapper-plugin.sh b/grub2-snapper-plugin.sh index 10d3c44..324283e 100644 --- a/grub2-snapper-plugin.sh +++ b/grub2-snapper-plugin.sh @@ -104,12 +104,20 @@ snapper_snapshots_cfg_refresh () { snapshot="${s_dir}/snapshot" # list only read-only snapshot (bnc#878528) - if [ -w "$snapshot" ]; then + if [ ! -d ${s_dir} -o -w "$snapshot" ]; then continue fi if [ -r "${s_dir}/info.xml" -a -r "${s_dir}/snapshot/boot/grub2/grub.cfg" ]; then cs="${s_dir} ${cs}" + else + # cleanup any grub-snapshot.cfg without associated snapshot info + snapper_cfg="${s_dir}/${snapshot_submenu_name}" + if [ -f "$snapper_cfg" ]; then + rm -f "$snapper_cfg" + rmdir "$s_dir" 2>/dev/null || true + fi + continue fi done diff --git a/grub2.changes b/grub2.changes index a64f388..432f597 100644 --- a/grub2.changes +++ b/grub2.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Dec 25 08:52:12 UTC 2014 - mchang@suse.com + +- grub2-snapper-plugin.sh: cleanup grub-snapshot.cfg not referring + to any snapshot (boo#909359) + ------------------------------------------------------------------- Thu Dec 25 08:34:49 UTC 2014 - mpluskal@suse.com