Package: cron-apt
Version: 0.11.0
Severity: wishlist
Tags: patch

Please consider the attached patch that places a marker at the beginning
of an attached diff to ease automatic processing, and cleans up a minor
issue with the diff file handling.

Greetings
Marc
>From c9b3887d75bd08a9fdf44e19cd4f609204a165b4 Mon Sep 17 00:00:00 2001
From: Marc Haber <[email protected]>
Date: Wed, 29 Nov 2017 09:05:35 +0100
Subject: [PATCH 2/3] prepend diff with a marker, clean up diff file in all
 cases

---
 src/cron-apt | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/cron-apt b/src/cron-apt
index 95f7692..a3b13cf 100755
--- a/src/cron-apt
+++ b/src/cron-apt
@@ -460,7 +460,8 @@ for ACTION in $(run_parts "$ACTIONDIR") ; do
                    if [ -n "$DIFFIGNORE" ]; then
                        DIFFIGNORELINE="--ignore-matching-lines=$DIFFIGNORE"
                    fi
-                   if [ ! -r "$MAILCHDIR/$ACTIONF-$TLINE" ] || ! diff 
$DIFFIGNORELINE -u "$MAILCHDIR/$ACTIONF-$TLINE" "$TEMP" > "$DIFF" ; then
+                   echo "CRON-APT DIFF" > "$DIFF"
+                   if [ ! -r "$MAILCHDIR/$ACTIONF-$TLINE" ] || ! diff 
$DIFFIGNORELINE -u "$MAILCHDIR/$ACTIONF-$TLINE" "$TEMP" >> "$DIFF" ; then
                        cp "$TEMP" "$MAILCHDIR/$ACTIONF-$TLINE"
                        # What to do with diff
                        # OBS! FROM NOW ON "$TEMP" CAN HAVE DIFF INFORMATION IN 
IT!
@@ -474,7 +475,6 @@ for ACTION in $(run_parts "$ACTIONDIR") ; do
                                cat "$TEMP" >> "$DIFF"
                                mv "$DIFF" "$TEMP"
                            fi
-                           rm -f "$DIFF"
                        fi
                        # ---
                        # We have changes
@@ -492,6 +492,7 @@ for ACTION in $(run_parts "$ACTIONDIR") ; do
                            createloginfo $ACTIONF
                        fi
                    fi
+                   rm -f "$DIFF"
                done
                #exit
            }
-- 
2.15.0

Reply via email to