Package: ucf
Version: 3.0036
Severity: important

Dear Maintainer,

   * What led up to the situation?
Trying to manually install a debian package while building a custom ISO
`sudo chroot squashfs-root dpkg --force-confnew -i
tmp/my-package_0.1.0_amd64.deb`
Unfortunatly `dpkg` does not pass `--force-confnew` to `ucf`

`ucf` prompts for user input during install
```
A new version (/usr/share/my-package/config) of configuration file
/etc/xdg/autostart/gnome-keyring-ssh.desktop is available, but the
version installed currently has been locally modified.
```

`UCF_FORCE_CONFFNEW` silences the config compare/selection dialog and
installs the config file, but
somehow it does not create a
`/etc/xdg/autostart/gnome-keyring-ssh.desktop.ucf-old` file. Without
setting `UCF_FORCE_CONFFNEW` the package installs correctly, but it
requires that `install the package maintainer's version` is selected
manually.

```console
$ more debian/postinst
#!/bin/sh
set -e

case "$1" in
    configure)
        UCF_FORCE_CONFFNEW=1 ucf /usr/share/my-package/config
/etc/xdg/autostart/gnome-keyring-ssh.desktop
```

   * What exactly did you do (or not do) that was effective (or
     ineffective)?

`sudo chroot squashfs-root /usr/bin/env DEBIAN_FRONTEND=noninteractive
dpkg --force-confnew -i tmp/my-package_0.1.0_amd64.deb`
This creates `/etc/xdg/autostart/gnome-keyring-ssh.desktop.ucf-dist`
which I suppose means it is defaulting to the old config file.
`sudo chroot squashfs-root /usr/bin/env DEBIAN_FRONTEND=noninteractive
UCF_FORCE_CONFFNEW=1 dpkg --force-confnew -i
tmp/my-package_0.1.0_amd64.deb` installs the new version but no backup
is created, as mentioned above.

   * What was the outcome of this action?
Nothing really works right here, I'm going back to diversions. Hopefully
this bug report helps.

   * What outcome did you expect instead?
`dpkg --force-confnew` should be passed to ucf somehow
`UCF_FORCE_CONFFNEW=1` should perform the same as manually selecting the
new conffile

Maybe this is more than one bug. Maybe `dpkg` should set
UCF_FORCE_CONFFNEW when --force-confnew is set.
Maybe ucf should just accept --force-confnew, I don't know.
UCF_FORCE_CONFFNEW definatly seems buggy though.

-- System Information:
Debian Release: stretch/sid
  APT prefers xenial-updates
  APT policy: (500, 'xenial-updates'), (500, 'xenial-security'), (500,
'xenial'), (100, 'xenial-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.15.0-46-generic (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
Init: systemd (via /run/systemd/system)

Versions of packages ucf depends on:
ii  coreutils  8.25-2ubuntu3~16.04
ii  debconf    1.5.58ubuntu1

ucf recommends no packages.

ucf suggests no packages.

-- debconf information:
  ucf/conflicts_found:
  ucf/changeprompt_threeway: keep_current
  ucf/changeprompt: keep_current
  ucf/show_diff:
  ucf/title:

Reply via email to