Package: corekeeper
Version: 1.6
Severity: wishlist
Tags: patch

This line:

    sort current current next | uniq -u > new

corresponds to this set operation:

    new = next - current

and this line:

    sort deleted deleted new new next | uniq -u > old

corresponds to this set operation:

    old = (next - deleted) - new

by substitution:

    old = (next - deleted) - (next - current)

hence:

    old = current - deleted

So this line:

    sort deleted deleted new new next | uniq -u > old

can be replaced by this line:

    sort deleted deleted current | uniq -u > old

which does the same thing more simply and without relying on the previously calculated file.

A patch is attached.


Sincerely,

Nathaniel Beaver

-- System Information:
Debian Release: 9.4
  APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable-debug'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.14.0-0.bpo.3-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to en_US.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages corekeeper depends on:
ii  procps  2:3.3.12-3

corekeeper recommends no packages.

corekeeper suggests no packages.

-- Configuration Files:
/etc/sysctl.d/corekeeper.conf changed [not included]

-- no debconf information
diff --git a/debian/corekeeper.cron.daily b/debian/corekeeper.cron.daily
index 9457927..4c6d4fc 100755
--- a/debian/corekeeper.cron.daily
+++ b/debian/corekeeper.cron.daily
@@ -7,7 +7,7 @@ fi
 cd /var/cache/corekeeper/
 find /var/crash -name '*.core' \( \( -mtime +7 -delete -fprint /dev/stderr \) -o \( -print \) \) > next 2> deleted
 sort current current next | uniq -u > new
-sort deleted deleted new new next | uniq -u > old
+sort deleted deleted current | uniq -u > old
 
 if [ -s new ] ; then
 	echo 'New core file(s):'

Reply via email to