From f67d8dab2cd9a613a8bc6093e8808a907f296a8e Mon Sep 17 00:00:00 2001 From: James Barnett Date: Tue, 18 Apr 2017 20:17:21 -0500 Subject: [PATCH] debugging --- scripts/snap-pac | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/snap-pac b/scripts/snap-pac index 63a24f8..a23a012 100755 --- a/scripts/snap-pac +++ b/scripts/snap-pac @@ -24,8 +24,6 @@ while read -r f; do kernel_updated="yes" fi done -#FIXME -printf "Kernel updated: %s\n" $kernel_updated declare -r SNAPPER_CONFIG_FILE=/etc/conf.d/snapper declare -r DESC_LIMIT=48 @@ -68,7 +66,6 @@ trap kill_exit SIGTERM SIGINT source "$SNAPPER_CONFIG_FILE" #FIXME -printf "PACMAN_KEEP_OLD_KERNELS: %s\n" $PACMAN_KEEP_OLD_KERNELS for CONFIG in $SNAPPER_CONFIGS; do @@ -83,7 +80,11 @@ for CONFIG in $SNAPPER_CONFIGS; do if [[ "$pre_or_post" == "pre" ]]; then x=$($snapper_cmd "$(truncate_description $PACMAN_PRE_DESCRIPTION)") printf "==> %s: $(echo $x | tee "$prefile")\n" "$CONFIG" - if [[ $CONFIG == "root" && $PACMAN_KEEP_OLD_KERNELS == "yes" && $kernel_updated == "yes" ]]; then +#FIXME + printf "Kernel updated: %s\n" $kernel_updated + printf "PACMAN_KEEP_OLD_KERNELS: %s\n" $PACMAN_KEEP_OLD_KERNELS + printf "CONFIG: %s\n" $CONFIG + if [[ "$CONFIG" == "root" -a "$PACMAN_KEEP_OLD_KERNELS" == "yes" -a "$kernel_updated" == "yes" ]]; then printf "==> Linking old kernels and modules...\n" find /usr/lib/modules -xtype l -delete find /boot/old -xtype l -delete @@ -91,7 +92,11 @@ for CONFIG in $SNAPPER_CONFIGS; do ln -s /.snapshots/$x/snapshot/usr/lib/modules/$(uname -r) /usr/lib/modules/ fi elif [[ -f $prefile && "$pre_or_post" == "post" ]]; then - if [[ $CONFIG == "root" && $PACMAN_KEEP_OLD_KERNELS == "yes" && $kernel_updated == "yes" ]]; then +#FIXME + printf "Kernel updated: %s\n" $kernel_updated + printf "PACMAN_KEEP_OLD_KERNELS: %s\n" $PACMAN_KEEP_OLD_KERNELS + printf "CONFIG: %s\n" $CONFIG + if [[ "$CONFIG" == "root" -a "$PACMAN_KEEP_OLD_KERNELS" == "yes" -a "$kernel_updated" == "yes" ]]; then [[ -d /boot/old ]] && mkdir -p /boot/old printf "==> Linking old kernels and modules...\n" kver=$(pacman -Q linux | awk '{print $2}')-ARCH