Syntax error in postinstall script

Bug #1664481 reported by Anton
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
uwsgi (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Installation output:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  python3-uwsgidecorators
The following NEW packages will be installed:
  uwsgi-plugin-python3
0 upgraded, 1 newly installed, 0 to remove and 11 not upgraded.
Need to get 73.7 kB of archives.
After this operation, 259 kB of additional disk space will be used.
Get:1 http://mirror.yandex.ru/ubuntu xenial/universe amd64 uwsgi-plugin-python3 amd64 2.0.12-5ubuntu3 [73.7 kB]
Fetched 73.7 kB in 0s (1,196 kB/s)
Selecting previously unselected package uwsgi-plugin-python3.
(Reading database ... 62209 files and directories currently installed.)
Preparing to unpack .../uwsgi-plugin-python3_2.0.12-5ubuntu3_amd64.deb ...
Unpacking uwsgi-plugin-python3 (2.0.12-5ubuntu3) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up uwsgi-plugin-python3 (2.0.12-5ubuntu3) ...
/var/lib/dpkg/info/uwsgi-plugin-python3.postinst: line 61: [: : integer expression expected

File content:
/var/lib/dpkg/info/uwsgi-plugin-python3.postinst[57:61]

      BINARY_IS_UWSGI_ALTERNATIVE="$(\
        update-alternatives --list uwsgi 2>/dev/null \
        | grep -c '/uwsgi_python3$' | true \
      )"
      if [ "$BINARY_IS_UWSGI_ALTERNATIVE" -eq 0 ]; then

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in uwsgi (Ubuntu):
status: New → Confirmed
Revision history for this message
Walter (wdoekes) wrote :

That should be `; true` or ` || true`, but not ` | true`.

Reproduced on Xenial machine where I first installed uwsgi and then uwsgi-plugin-python3 2.0.12-5ubuntu3.

Revision history for this message
Walter (wdoekes) wrote :

I see it has been fixed in later versions (e.g. on Zesty):

uwsgi-2.0.14+20170111/debian$ grep BINARY_IS_UWSGI_ALTERNATIVE= -A3 uwsgi-plugin-__PLUGIN__.postinst.in*
uwsgi-plugin-__PLUGIN__.postinst.in.pri: BINARY_IS_UWSGI_ALTERNATIVE="$(\
uwsgi-plugin-__PLUGIN__.postinst.in.pri- update-alternatives --list uwsgi 2>/dev/null \
uwsgi-plugin-__PLUGIN__.postinst.in.pri- | grep -c '/uwsgi_@@plugin_alternatives_stem@@$' || true \
uwsgi-plugin-__PLUGIN__.postinst.in.pri- )"
--
uwsgi-plugin-__PLUGIN__.postinst.in.pri-py: BINARY_IS_UWSGI_ALTERNATIVE="$(\
uwsgi-plugin-__PLUGIN__.postinst.in.pri-py- update-alternatives --list uwsgi 2>/dev/null \
uwsgi-plugin-__PLUGIN__.postinst.in.pri-py- | grep -c '/uwsgi_@@plugin_alternatives_stem@@$' || true \
uwsgi-plugin-__PLUGIN__.postinst.in.pri-py- )"

Revision history for this message
Adrien Beau (adrienbeau) wrote :

Came here to report this very bug, which I encountered when upgrading to 2.0.12-5ubuntu3.1.

summary: - incorrect postinstall script
+ Syntax error in postinstall script
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.