Package: steam
Version: 1.0.0.49-1
Severity: normal
Tags: patch

Hi maintainer,

I'm trying to automate the installation of the steam package by
preseeding the debconf selections needed to accept the license
agreement. The installation fails every time I try:

    root@eruption:~# cat selections
    steam   steam/question  select  I AGREE
    steam   steam/license   note
    root@eruption:~# debconf-set-selections < selections
    root@eruption:~# apt-get install steam
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following NEW packages will be installed:
      steam:i386
    0 upgraded, 1 newly installed, 0 to remove and 149 not upgraded.
    Need to get 0 B/835 kB of archives.
    After this operation, 2,689 kB of additional disk space will be used.
    Preconfiguring packages ...
    Selecting previously unselected package steam.
    (Reading database ... 260307 files and directories currently installed.)
    Preparing to unpack .../steam_1.0.0.49-1_i386.deb ...
    dpkg: error processing archive 
/var/cache/apt/archives/steam_1.0.0.49-1_i386.deb (--unpack):
     subprocess new pre-installation script returned error exit status 30
    Installation terminated: Steam License Agreement was DECLINED.
    Errors were encountered while processing:
     /var/cache/apt/archives/steam_1.0.0.49-1_i386.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)

I'm not prompted to accept the license agreement; the install just fails
immediately.

Bug #757524 had a similar issue, but I believe the resolution ("You have
two spaces between select and I") was incorrect, as using a single space
doesn't fix the problem. Additionally, I generated the selections from
debconf-get-selections, so the formatting should be correct.

My understanding of debconf might be flawed, but I believe this is
because the db_input prompts will fail if the selection has already been
preseeded (or if the user can't be prompted).

The ``Debconf Programmer's Tutorial'' [1] uses `|| true` after each
invocation of db_input. I've attached a patch that updates the steam
package source to do this.

With the patch applied, I am able to install steam both normally (no
preseeds) and with the preseeded selections.

Many thanks!
Chris

[1] http://www.fifi.org/doc/debconf-doc/tutorial.html



-- System Information:
Debian Release: jessie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.16.0-4-amd64 (SMP w/8 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 steam depends on:
ii  debconf [debconf-2.0]                 1.5.54
ii  libc6                                 2.19-13
ii  libgl1-mesa-dri                       10.3.2-1
ii  libgl1-mesa-glx                       10.3.2-1
ii  libstdc++6                            4.9.1-19
ii  libtxc-dxtn-s2tc0 [libtxc-dxtn0]      0~git20131104-1.1
ii  libudev1                              215-7
ii  libx11-6                              2:1.6.2-3
ii  libxinerama1                          2:1.1.3-1+b1
ii  xfce4-terminal [x-terminal-emulator]  0.6.3-1+b1
ii  xterm [x-terminal-emulator]           312-1
ii  xz-utils                              5.1.1alpha+20120614-2+b2

Versions of packages steam recommends:
ii  fonts-liberation  1.07.4-1
ii  zenity            3.14.0-1

steam suggests no packages.

-- debconf information:
* steam/question: I AGREE
  steam/purge:
* steam/license:
From: Chris Kuehl <cku...@ocf.berkeley.edu>
Date: Mon, 8 Dec 2014 14:58:01 -0800
Subject: [PATCH] Allow dh_input to fail without aborting install

dh_input will fail if the user has already preseeded debconf selections,
or if the user can't be prompted during installation.

Rather than fail the install script (since we set -e), we should proceed
normally and allow the "I AGREE" check to fail (in case the user really
couldn't be prompted).

Without this change, preseeding debconf selections results in the
install failing immediately every time.
---
 debian/postrm  | 2 +-
 debian/preinst | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/debian/postrm b/debian/postrm
index 9b38aec..2440320 100644
--- a/debian/postrm
+++ b/debian/postrm
@@ -10,7 +10,7 @@ if [ "$1" = "abort-install" ]; then
 fi
 
 if [ "$1" = "purge" ]; then
-    db_input high steam/purge
+    db_input high steam/purge || true
     db_go
 fi
 
diff --git a/debian/preinst b/debian/preinst
index e8479e6..36a330a 100644
--- a/debian/preinst
+++ b/debian/preinst
@@ -4,8 +4,8 @@ set -e
 . /usr/share/debconf/confmodule
 
 if [ "$1" = "install" ]; then
-    db_input high steam/license
-    db_input high steam/question
+    db_input high steam/license || true
+    db_input high steam/question || true
     db_go
     db_get steam/question
     test "$RET" = "I AGREE"
-- 
2.1.3

Reply via email to