Bug#707230: apticron: notifies me about packages on hold even with NOTIFY_HOLDS=0

2013-07-26 Thread Rémi Hérilier

Hello,

I have the same problem as Kiko Piris.

IMHO, I think a better patch could be used.


---8---
--- /usr/sbin/apticron~ 2012-05-23 03:21:09.0 +0200
+++ /usr/sbin/apticron  2013-05-08 13:03:09.241452805 +0200
@@ -124,7 +124,7 @@ for p in $PKGNAMES; do
 done

 # workaround to handle apt-get installing packages hold by aptitude. See 
#137771.
-APTITUDE_HOLDS=`grep ^State: 2 -B 2 /var/lib/aptitude/pkgstates 2/dev/null |grep 
^Package: .*$ |cut -d  -f 2`
+APTITUDE_HOLDS=`grep ^State: 2 -B 3 /var/lib/aptitude/pkgstates 2/dev/null |grep 
^Package: .*$ |cut -d  -f 2`
 DSELECT_HOLDS=`dpkg --get-selections |grep hold$ |cut -f1`

 if [ $NOTIFY_HOLDS = 0 ]; then
---8---


Using a constant distance between the entries Package: and State: 
will not survive to the next format change of 
/var/lib/aptitude/pkgstates (add of a new entry between those 2, the 
reordering of entries, etc.).


As the lone strong hypothesis is: « a State: entry always follows its 
Package: entry »,  why not greping those 2 entries before extracting 
the package list on hold?


The patch would look like:

---8---
--- apticron.orig   2013-07-26 10:06:11.773698290 +0200
+++ apticron2013-07-26 10:06:40.957691347 +0200
@@ -124,7 +124,7 @@
 done

 # workaround to handle apt-get installing packages hold by aptitude. 
See #137771.
-APTITUDE_HOLDS=`grep ^State: 2 -B 2 /var/lib/aptitude/pkgstates 
2/dev/null |grep ^Package: .*$ |cut -d  -f 2`
+APTITUDE_HOLDS=`egrep ^(Package|State): /var/lib/aptitude/pkgstates 
2/dev/null |grep ^State: 2 -B 1 |grep ^Package: .*$ |cut -d  -f 2`

 DSELECT_HOLDS=`dpkg --get-selections |grep hold$ |cut -f1`

 if [ $NOTIFY_HOLDS = 0 ]; then
---8---

I hope it could help.


best regards

Rémi Hérilier


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#707230: apticron: notifies me about packages on hold even with NOTIFY_HOLDS=0

2013-05-08 Thread Kiko Piris
Package: apticron
Version: 1.1.55
Severity: normal
Tags: patch

I have two packages on hold (with aptitude) and apticron keeps notifying me
about them even with NOTIFY_HOLDS=0

I guess this is because now /var/lib/aptitude/pkgstates now has a new line
for “Architecture:”.

The following patch fixes this for me:

---8---
--- /usr/sbin/apticron~ 2012-05-23 03:21:09.0 +0200
+++ /usr/sbin/apticron  2013-05-08 13:03:09.241452805 +0200
@@ -124,7 +124,7 @@ for p in $PKGNAMES; do
 done
 
 # workaround to handle apt-get installing packages hold by aptitude. See 
#137771.
-APTITUDE_HOLDS=`grep ^State: 2 -B 2 /var/lib/aptitude/pkgstates 2/dev/null 
|grep ^Package: .*$ |cut -d  -f 2`
+APTITUDE_HOLDS=`grep ^State: 2 -B 3 /var/lib/aptitude/pkgstates 2/dev/null 
|grep ^Package: .*$ |cut -d  -f 2`
 DSELECT_HOLDS=`dpkg --get-selections |grep hold$ |cut -f1`
 
 if [ $NOTIFY_HOLDS = 0 ]; then
---8---

Thank you.

-- System Information:
Debian Release: 7.0
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'proposed-updates'), (500, 
'stable')
Architecture: i386 (i686)

Kernel: Linux 3.2.0-4-686-pae (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages apticron depends on:
ii  apt0.9.7.8
ii  bsd-mailx [mailx]  8.1.2-0.2006cvs-1
ii  bzip2  1.0.6-4
ii  cron   3.0pl1-124
ii  debconf [debconf-2.0]  1.5.49
ii  dpkg   1.16.10
ii  ucf3.0025+nmu3

Versions of packages apticron recommends:
ii  apt-listchanges  2.85.11
ii  iproute  20120521-3+b3

apticron suggests no packages.

-- debconf information:
* apticron/notification: fpi...@portsdebalears.com


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org