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

Bug#770110: debian-edu-install: Bogus error logged from edu-eatmydata-install



Package: debian-edu-profile-udeb
Version: 1.817
Severity: important
Tags: patch pending

During installation when the quick installation using eatmydata is
enabled, an error is logged stating "unable to find /usr/bin/eatmydata
after installing the eatmydata package".  This is logged from pre-pkgsel
even if eatmydata was successfully installed in the post-baseinstaller
step.  When doing test installs, all errors in the log is presented to
the user in a popup dialog, and this bogus error is confusing at best
and hurting our reputation at worst.

The reason for the problem is this incorrect if test in
edu-eatmydata-install:

    if [ -x /target/usr/bin/eatmydata ] && \
       [ ! -f /target/etc/apt/apt.conf.d/95debian-edu-install-dpkg-eatmydata ]; then

When this test fail, the error is logged.  But the error should only be
logged when the first part of the test fail.  If the second part hit,
only an informational message stating that eatmydata is already active
is needed.  The following patch solve the problem:

diff --git a/tools/edu-eatmydata-install b/tools/edu-eatmydata-install
index da82d6d..9ab19c2 100755
--- a/tools/edu-eatmydata-install
+++ b/tools/edu-eatmydata-install
@@ -19,8 +19,8 @@ trap at_exit INT TERM EXIT
 
 enable_override() {
     apt-install eatmydata || true
-    if [ -x /target/usr/bin/eatmydata ] && \
-       [ ! -f /target/etc/apt/apt.conf.d/95debian-edu-install-dpkg-eatmydata ]; then
+    if [ -x /target/usr/bin/eatmydata ] ; then
+      if [ ! -f /target/etc/apt/apt.conf.d/95debian-edu-install-dpkg-eatmydata ]; then
         info "Adding apt config to call dpkg via eatmydata"
         printf "#!/bin/sh\nexec eatmydata dpkg \"\$@\"\n" \
             > /target/var/tmp/dpkg-eatmydata
@@ -28,6 +28,9 @@ enable_override() {
         cat > /target/etc/apt/apt.conf.d/95debian-edu-install-dpkg-eatmydata <<EOF
 Dir::Bin::dpkg "/var/tmp/dpkg-eatmydata";
 EOF
+      else
+           info "apt redirect for eatmydata already in place"
+      fi
     else
         error "unable to find /usr/bin/eatmydata after installing the eatmydata package"
     fi

I'll commit the patch to git.

-- 
Happy hacking
Petter Reinholdtsen


Reply to: