Your message dated Tue, 13 Feb 2018 17:34:29 +0000
with message-id <e1eleto-000ii5...@fasolo.debian.org>
and subject line Bug#845546: fixed in sarg 2.3.11-1
has caused the Debian Bug report #845546,
regarding sarg: Proposal for lastlog feature in sarg-reports - patch provided
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
845546: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=845546
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: sarg
Version: 2.3.10-2
Severity: wishlist

Dear Maintainer,


The patches below (two of which are diffs from the revised versions I proposed 
in bug 845455) include the following proposed changes:

1. Configuration option for number of saved logs per report type

It seems to me that surely I'm not the only one who would like to keep 
different numbers of different types of report.
At the same time, different people will have different history requirements.
sarg-reports uses the same sarg.conf for all types of reports, but sarg allows 
override of the lastlog setting by using the --lastlog= switch.
The change made in 2.3.10-2 does allow a user (should he/she wish) to pass this 
switch to sarg by adjusting the cron jobs which the Debian sarg package 
installs for sarg-reports.
However, I reckon that this is a common-enough requirement to justify adding 
dedicated settings in sarg-reports.conf.

2. Setting of distinct temporary directory for each run of the script, per 
recommendation from Frederic Marchal in case of overlap of cron jobs.

References:
https://sourceforge.net/p/sarg/discussion/363374/thread/efb2f9e9/#3cf7
https://sourceforge.net/p/sarg/discussion/363374/thread/efb2f9e9/#7d4d



I acknowledge that my "rm -rf $TMPDIR" may be a bad idea - I'm not sure how 
best to make that safe.

Further, I suspect that my patch in the previous bug may have been faulty as I 
had problems applying it - I hope you could work with it and that these ones 
are also good enough.




--------------------------<snip><Start of 
patch><snip>----------------------------
--- sarg-reports.proposed
+++ sarg-reports.proposed-with-lastlog
@@ -6,7 +6,7 @@
 # - martijn
 # - Stas Degteff https://sourceforge.net/users/stas_degteff/

-VER=debian-sarg-2.3.10-2
+VER=debian-sarg-2.3.10-2-with-lastlog

 ## What is this?
 # sarg-reports (this file) is a simple bash script written to automate
@@ -55,6 +55,9 @@
 #        (SARG) The sarg executable location
 #      (CONFIG) The sarg main configuration file location
 #     (HTMLOUT) Location where will be saved the reports
+# (LASTLOGDAILY)   Number of previous daily reports to keep (affects "today" 
and "manual" logs too)
+# (LASTLOGWEEKLY)  Number of previous weekly reports to keep
+# (LASTLOGMONTHLY) Number of previous monthly reports to keep
 #   (PAGETITLE) The title of main index page
 #     (LOGOIMG) Image logo to view in main index page
 #    (LOGOLINK) HTTP web page link of logo
@@ -110,6 +113,7 @@
 # TEMP Files
 TMPFILE=`/bin/mktemp`
  ERRORS="${TMPFILE}.errors"
+TMPDIR=`/bin/mktemp -d`

 # Date Calc
 MANUALDATE=$2
@@ -210,10 +214,15 @@
 {
   cat $ERRORS | grep -v "$EXCLUDELOG1" | grep -v "$EXCLUDELOG2"
   rm -f $TMPFILE*
+  rm -rf $TMPDIR
 }

 manual ()
 {
+  if [ -n "$LASTLOGDAILY" ]
+    then
+      LASTLOG="--lastlog=$LASTLOGDAILY"
+  fi
   DAILYOUT=$HTMLOUT/$DAILY
   mkdir -p $DAILYOUT
   create_index_html
@@ -221,43 +230,59 @@
     then
       echo "No date given, please specify a valid date (DD/MM/YYYY)"
     else
-      $SARG -f $CONFIG -d $MANUALDATE -o $DAILYOUT ${@} ${ACCESS_LOG}*
+      $SARG -f $CONFIG -w $TMPDIR -d $MANUALDATE -o $DAILYOUT $LASTLOG ${@} 
${ACCESS_LOG}*
   fi
 }

 today ()
 {
+  if [ -n "$LASTLOGDAILY" ]
+    then
+      LASTLOG="--lastlog=$LASTLOGDAILY"
+  fi
   DAILYOUT=$HTMLOUT/$DAILY
   mkdir -p $DAILYOUT
   create_index_html
-  $SARG -f $CONFIG -d $TODAY -o $DAILYOUT ${@} ${ACCESS_LOG}* >$ERRORS 2>&1
+  $SARG -f $CONFIG -w $TMPDIR -d $TODAY -o $DAILYOUT $LASTLOG ${@} 
${ACCESS_LOG}* >$ERRORS 2>&1
   exclude_from_log
 }

 daily ()
 {
+  if [ -n "$LASTLOGDAILY" ]
+    then
+      LASTLOG="--lastlog=$LASTLOGDAILY"
+  fi
   DAILYOUT=$HTMLOUT/$DAILY
   mkdir -p $DAILYOUT
   create_index_html
-  $SARG -f $CONFIG -d day-1 -o $DAILYOUT ${@} ${ACCESS_LOG}* >$ERRORS 2>&1
+  $SARG -f $CONFIG -w $TMPDIR -d day-1 -o $DAILYOUT $LASTLOG ${@} 
${ACCESS_LOG}* >$ERRORS 2>&1
   exclude_from_log
 }

 weekly ()
 {
+  if [ -n "$LASTLOGWEEKLY" ]
+    then
+      LASTLOG="--lastlog=$LASTLOGWEEKLY"
+  fi
   WEEKLYOUT=$HTMLOUT/$WEEKLY
   mkdir -p $WEEKLYOUT
   create_index_html
-  $SARG -f $CONFIG -d week-1 -o $WEEKLYOUT ${@} ${ACCESS_LOG}* >$ERRORS 2>&1
+  $SARG -f $CONFIG -w $TMPDIR -d week-1 -o $WEEKLYOUT $LASTLOG ${@} 
${ACCESS_LOG}* >$ERRORS 2>&1
   exclude_from_log
 }

 monthly ()
 {
+  if [ -n "$LASTLOGMONTHLY" ]
+    then
+      LASTLOG="--lastlog=$LASTLOGMONTHLY"
+  fi
   MONTHLYOUT=$HTMLOUT/$MONTHLY
   mkdir -p $MONTHLYOUT
   create_index_html
-  $SARG -f $CONFIG -d month-1 -o $MONTHLYOUT ${@} ${ACCESS_LOG}* >$ERRORS 2>&1
+  $SARG -f $CONFIG -w $TMPDIR -d month-1 -o $MONTHLYOUT $LASTLOG ${@} 
${ACCESS_LOG}* >$ERRORS 2>&1
   exclude_from_log
 }

@@ -302,6 +327,7 @@


 ## HISTORY:
+# debian-sarg-2.3.10-2-with-lastlog - add lastlog option to keep different 
numbers of previous reports per type, private temporary directory
 # debian-sarg-2.3.10-2 - use all rotated log files, pass through options from 
command line
 # debian-sarg-? - added reports_autorm function (not used)
 # ... - ?
---------------------------<snip><End of 
patch><snip>-----------------------------





--------------------------<snip><Start of 
patch><snip>----------------------------
--- sarg-reports.conf
+++ sarg-reports.conf.proposed-with-lastlog
@@ -1,6 +1,9 @@
        SARG=/usr/bin/sarg
      CONFIG=/etc/sarg/sarg.conf
     HTMLOUT=/var/lib/sarg
+  LASTLOGDAILY=31
+ LASTLOGWEEKLY=4
+LASTLOGMONTHLY=12
   PAGETITLE="Access Reports on $(hostname)"
     LOGOIMG=/sarg/images/sarg.png
    LOGOLINK="http://$(hostname)/"
---------------------------<snip><End of 
patch><snip>-----------------------------




--------------------------<snip><Start of 
patch><snip>----------------------------
--- sarg-reports-manpage.proposed
+++ sarg-reports-manpage.proposed-with-lastlog
@@ -61,6 +61,15 @@
        HTMLOUT
               Location where will be saved the reports

+       LASTLOGDAILY
+              Set the number of previous daily/today/manual reports to keep
+
+       LASTLOGWEEKLY
+              Set the number of previous weekly reports to keep
+
+       LASTLOGMONTHLY
+              Set the number of previous monthly reports to keep
+
        PAGETITLE
               The title of main index page


---------------------------<snip><End of 
patch><snip>-----------------------------

--- End Message ---
--- Begin Message ---
Source: sarg
Source-Version: 2.3.11-1

We believe that the bug you reported is fixed in the latest version of
sarg, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 845...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Luigi Gangitano <lu...@debian.org> (supplier of updated sarg package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Tue, 13 Feb 2018 17:12:57 +0100
Source: sarg
Binary: sarg
Architecture: source amd64
Version: 2.3.11-1
Distribution: unstable
Urgency: medium
Maintainer: Luigi Gangitano <lu...@debian.org>
Changed-By: Luigi Gangitano <lu...@debian.org>
Description:
 sarg       - squid analysis report generator
Closes: 845455 845546 850624 853651 872425
Changes:
 sarg (2.3.11-1) unstable; urgency=medium
 .
   * New upstream version
      - Fixes FTBFS with GCC 7 (Closes: #853651)
      - Removed gettext patch integrated upstream
 .
   * debian/control
     - Fix man directory (Closes: #850624, thanks to Michael Stapelberg)
 .
   * debian/sarg-reports{,.1,.conf}
     - Added EXCLUDELOG3 filter (Closes: #872425, thanks to Matus UHLAR)
     - Added documentation (Closes: #845455, thanks to r...@chardmore.net)
     - Added lastlog options (Closes: #845546, thanks to r...@chardmore.net)
 .
   * debian/patches/0002-fix-build-errors.patch
     - Fix more build errors
 .
   * debian/rules
     - Removed autotools-dev debhelper calls
Checksums-Sha1:
 0e9ef41a7457015a36854ed1e16c57cb34be3b24 1758 sarg_2.3.11-1.dsc
 c535d1534dd0c7e3a3725d98eb0dd50246e489b0 1344002 sarg_2.3.11.orig.tar.gz
 96100cefaccd0a9f546056371ca88c5d32a06cd2 21800 sarg_2.3.11-1.debian.tar.xz
 90813f1297d66db578473672500d1f7c27ca4620 281712 sarg-dbgsym_2.3.11-1_amd64.deb
 a131c6cff9cc8c15f6d2fa9c2f9cfb3b8910f8a0 6818 sarg_2.3.11-1_amd64.buildinfo
 1cc299b32e03878ac1435e6454db579ad4ffaa72 170176 sarg_2.3.11-1_amd64.deb
Checksums-Sha256:
 d220cbb646733a343f69ea4d3f0f3760ac93fabe15cc3dc716a63aea94253bf5 1758 
sarg_2.3.11-1.dsc
 499f698d4bba7d116dada83232a414adb2727fd8f6c048a022208848116fe4f3 1344002 
sarg_2.3.11.orig.tar.gz
 6afbf233acfebe38a934df2a2f10783b42dab7ec87f59665595dd8b0da8a727a 21800 
sarg_2.3.11-1.debian.tar.xz
 ba062bd2bea7fe082935ddc98219073c56d9ff61e0179a5bd88a84441017f945 281712 
sarg-dbgsym_2.3.11-1_amd64.deb
 6a0ba52effaded9cf49154c9e1ac60d2b337e6963dc42a6b7a82a3dc3c6771e7 6818 
sarg_2.3.11-1_amd64.buildinfo
 ddae2b881c10ac95d7d54b09ca50a7c300a0003d9fad4df529db96c7e8e65b2d 170176 
sarg_2.3.11-1_amd64.deb
Files:
 12deda90f9a61d8d58c58f637027e2e4 1758 web optional sarg_2.3.11-1.dsc
 5366f3a9fe4354043b43700362c5e84e 1344002 web optional sarg_2.3.11.orig.tar.gz
 d8ed7f0c614434a60e6e5106b4f78abd 21800 web optional sarg_2.3.11-1.debian.tar.xz
 017f2b0241f7598da7d6c1bf073a761c 281712 debug optional 
sarg-dbgsym_2.3.11-1_amd64.deb
 2feb7183197f718bdffc883d694d7a2c 6818 web optional 
sarg_2.3.11-1_amd64.buildinfo
 19db5157bd868e6b084b297818ff8c04 170176 web optional sarg_2.3.11-1_amd64.deb

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEjUhaNf8ebreQ5Q9tAoTyDCupfO0FAlqDHjQACgkQAoTyDCup
fO1nVxAAqjkpS6brbEMiMe+GIjjrnIU16QfMBWo5EVUZr2roMWcCp/90V+dkDyiB
Qjscacyj3KUSB6kkHQfqEM2hauoNsC2H1feIFvaSnYhhB2CNFHvvLF9vmtomDApc
i3Nc9w3t1aSTeytOkDYDVRFXWZA7gbw99/zDBq1K4gyF7RIzxHxCH9qEa5QDRXau
mQ5RgSy7X5n0Ff/RTsye5f9CxxxfPVAfASom2TviBcC1DFjFE08o8v7oV+DssNaN
B7pjxenZGDdMdXyPXf37a2yh8CMzSIH9LihDd7dfvce2ovs4iNU0loM93KyFDUJs
RM633iK7rM/J0peIi1n4y8gCJ+qg9ucr/w8L3eXVyCUSZkAqjV9NT3O7Pldaga8p
/MkYmH6p91iX0uyjR7GRW9r/t+2qecA5G6F9e/8r6r3wiCrq4WPm8fIUI2apAXCo
zAhOZ7jukJZvcSa6m408IryrMmJmq9iSqyiPZJKcZgT9GhdEVcFk98Iu1rl0xBcD
ukeyGJ2U+Q18ilUeRGzIW8TxVcHTSSQHxVOQ50E91dN21AdtfcpPFkC4IWbzqP6j
8HhNFdcWb1a6onFWbqsxWVyLCEs5JbD25ztYRY2MRMvknMgJt5Jh3z4rQwVhFYpn
Ocv3q1IYUKRefdtX9gXyQrj6tMmAJTcxO4uQhy4oDqhKFy1SgL0=
=l00p
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to