Dear Francesco,
Am 08.05.21 um 14:19 schrieb Francesco P. Lovergine:
Thanks for the report, but I can't see why a line like:
if [ ! -z "$PREV_VER" -a $(dpkg --compare-versions "$PREV_VER" lt '4~';
echo $?) -eq 0 ]
should fail under dash (which is even the default shell on Debian). You
are trying to upgrade 4.2 to 4.2 in this case.
That was only to reproduce the issue. Originally I upgrade from 3.17.1-5.
2021-05-06 08:52:34 upgrade nis:ppc64el 3.17.1-5 4.2
Then it should run like:
if [ ! -z "4.2" -a $(dpkg --compare-versions "4.2" lt '4~'; echo $?) -eq 0 ]
and it works perfectly fine under dash. :-?
With `set -xe` in `/var/lib/dpkg/info/nis.postinst`:
$ sudo /var/lib/dpkg/info/nis.postinst configure 4.2
+ umask 022
+ PREV_VER=4.2
+ dpkg --compare-versions 4.2 lt 4~
+ [ ! -z 4.2 -a -eq 0 ]
/var/lib/dpkg/info/nis.postinst: 78: [: -eq: unexpected operator
+ rm -f /etc/init.d/nis
Could you please verify that /bin/sh links /bin/dash and what is the
dash version via dpkg -l ?
```
$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Jan 5 17:47 /bin/sh -> dash
$ dpkg -l dash
Desired=Unknown/Install/Remove/Purge/Hold
|
Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version
Architecture Description
+++-==============-====================================================================-============-=================================
ii dash
0.5.11+git20200708+dd9ef66+really0.5.11+git20200708+dd9ef66-5ubuntu1
ppc64el POSIX-compliant shell
```
Kind regards,
Paul