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

Bug#994081: [PATCH] Dry run apt check, no abort on fail.



From: Geert Stappers <stappers@debian.org>

Fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=994081
 "Upgrade Results in 'apt-get check' Failure"

It is fairly nasty bug. Nasty because it hides well.
Thing is that the `apt check` is during development never called
as a child proces of `apt`.  It reveals it self only during
an upgrade by `apt` or `apt-get`, not during a `dpkg --install`.

Adding '--dry-run' is to prevent bail out on
  E: Could not get lock /var/lib/dpkg/lock-frontend.
     It is held by process PID (apt)
  E: Unable to acquire the dpkg frontend lock

Manual page of `apt-get` says about `--dry-run`
  Locking will be disabled (Debug::NoLocking) so the system
  state could change while apt-get is running.

The removal of 'exit 0' makes it possible that the (build) script
continues. Frankly, I think the whole `apt check` part should
be removed. It is not up to /usr/lib/libdvd-pkg/b-i_libdvdcss.sh
to judge the sanity of the build system.

--dry-run suggested by Alban Browaeys in Message #37

'What does the apt check?' by The Wanderer in Message #10
---
 debian/b-i_libdvdcss.sh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/debian/b-i_libdvdcss.sh b/debian/b-i_libdvdcss.sh
index 536614c..6d77a50 100755
--- a/debian/b-i_libdvdcss.sh
+++ b/debian/b-i_libdvdcss.sh
@@ -43,10 +43,9 @@ if [ $? -ne 0 ]; then
     exit 1
 fi
 
-apt-get check >/dev/null 2>&1
+apt-get --dry-run check >/dev/null 2>&1
 if [ "$?" -ne 0 ]; then
-    echo "${PKGI}: \`apt-get check\` failed, you may have broken packages. Aborting..."
-    exit 0
+    echo "${PKGI}: \`apt-get --dry-run check\` failed, you may have broken packages."
 fi
 
 set -e
-- 
2.40.1


Reply to: