Skip to content

Commit

Permalink
Skip ignored snapshots during generating entries, not after
Browse files Browse the repository at this point in the history
  • Loading branch information
maximbaz committed Apr 6, 2018
1 parent f0b5d19 commit c44eda0
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions 41_snapshots-btrfs
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,21 @@ snapshot_list()
IFS=$oldIFS
snap=($snap)
local snap_path_name=${snap[@]:13:${#snap[@]}}

# Discard deleted snapshots
if [ "$snap_path_name" = "DELETED" ]; then continue; fi
[[ ${snap_path_name%%"/"*} == "<FS_TREE>" ]] && snap_path_name=${snap_path_name#*"/"}

### ignore specific path during run "grub-mkconfig"
if [ ! -z "${ignore_specific_path}" ] ; then
for isp in ${ignore_specific_path[@]} ; do
[[ "${snap_path_name}" == "${isp}"/* ]] && continue 2;
done
fi

### detect if /boot directory exists
[[ ! -d "$gbgmp/$snap_path_name/boot" ]] && continue;

local id="${snap_path_name//[!0-9]}" # brutal way to get id: remove everything non-numeric
ids+=("$id")

Expand Down Expand Up @@ -417,14 +428,6 @@ list_kernels_initramfs()
snap_dir_name="$(echo "$item" | cut -d'|' -f2)"
snap_dir_name="$(trim "$snap_dir_name")"

### ignore specific path during run "grub-mkconfig"
if [ ! -z "${ignore_specific_path}" ] ; then
for isp in ${ignore_specific_path[@]} ; do
[[ "${gbgmp}"/"${snap_dir_name}" == "${gbgmp}"/"${isp}"/* ]] && continue 2;
done
fi
### detect if /boot directory exists
[[ ! -d "$gbgmp/$snap_dir_name/boot" ]] && continue;
### show snapshot found during run "grub-mkconfig"
snap_date_time="$(echo "$item" | cut -d' ' -f1-2)"
snap_date_time="$(trim "$snap_date_time")"
Expand Down

0 comments on commit c44eda0

Please sign in to comment.