[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#459344: closed by Otavio Salvador <otavio@debian.org> (Bug#459344: fixed in apt 0.7.13)



reopen 459344 !
found 459344 0.7.13
tags 459344 patch
thanks


On Fri, 2 May 2008 22:48:22 +0200 Francesco Poli wrote:

> On Fri, 02 May 2008 19:45:05 +0000 Debian Bug Tracking System wrote:
> 
> [...]
> >    * Make cron script quiet if cache is locked. Thanks to Ted Percival
> >      <ted@midg3t.net> for the patch. Closes: #459344
> 
> I don't quite agree with the way this patch is supposed to fix the
> issue.
> 
> If /etc/cron.daily/apt has something to do on the system (because APT
> was configured accordingly), then, when the cache cannot be
> locked, /etc/cron.daily/apt cannot do its job and it should indeed exit
> *with errors* to alert the administrator that something went wrong!
> 
> Only if /etc/cron.daily/apt has absolutely nothing to do on the system
> (because of APT configuration), it should do absolutely nothing and
> exit successfully, without even checking whether the cache can be
> locked!

What I had in mind is something like the attached patch (generated
against apt version 0.7.11, and therefore to be applied instead of the
patch by Ted).

Please consider applying this patch.


Legal details:
I don't know if my patch constitutes a contribution creative enough to
be copyrighted, but anyway, should it turn out to be actually
copyrighted, I hereby release it under the same terms of
/etc/cron.daily/apt, that is to say, under the terms of the GNU General
Public License (GPL), version 2 or later, as published by the Free
Software Foundation.


-- 
 http://frx.netsons.org/doc/index.html#nanodocs
 The nano-document series is here!
..................................................... Francesco Poli .
 GnuPG key fpr == C979 F34B 27CE 5CD8 DC12  31B5 78F4 279B DD6D FCF4
diff -ruN a/etc/cron.daily/apt b/etc/cron.daily/apt
--- a/etc/cron.daily/apt	2008-02-17 01:15:20.000000000 +0100
+++ b/etc/cron.daily/apt	2008-05-02 23:20:48.000000000 +0200
@@ -173,10 +173,16 @@
     fi
 fi
 
-# check if we can lock the cache and if the cache is clean
-if ! apt-get check -q -q 2>/dev/null; then
-    echo "$0: could not lock the APT cache"
-    exit 1
+# if needed...
+if [ ! $UpdateInterval -eq 0 ] ||
+   [ ! $DownloadUpgradeableInterval -eq 0 ] ||
+   [ ! $UnattendedUpgradeInterval -eq 0 ] ||
+   [ ! $AutocleanInterval -eq 0 ]; then
+    # check if we can lock the cache and if the cache is clean
+    if ! apt-get check -q -q 2>/dev/null; then
+        echo "$0: could not lock the APT cache"
+        exit 1
+    fi
 fi
 
 

Attachment: pgpqMNDVoCyW5.pgp
Description: PGP signature


Reply to: