You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Reading database ... 646934 files and directories currently installed.)
Preparing to unpack .../X.deb ...
Unpacking X (2021-01-25-f3d0708) over (2021-01-15-b32d8c8) ...
Setting up X (2021-01-25-f3d0708) ...
/var/lib/dpkg/info/X.postinst: 34: Syntax error: "else" unexpected
dpkg: error processing package X (--configure):
installed X package post-installation script subprocess returned error exit status 2
Processing triggers for mime-support (3.64ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu1) ...
Processing triggers for desktop-file-utils (0.24+linuxmint1) ...
Errors were encountered while processing:
X
E: Sub-process /usr/bin/dpkg returned an error code (1)
And a shellcheck output to confirm that bash/dash/sh can't handle the above if-test:
-> $ shellcheck test.sh
In test.sh line 5:
if ! systemctl is-enabled device-agent-helper >/dev/null
^-- SC1009: The mentioned syntax error was in this if expression.
In test.sh line 6:
then
^-- SC1073: Couldn't parse this then clause. Fix to allow more checks.
In test.sh line 7:
else
^-- SC1048: Can't have empty then clauses (use 'true' as a no-op).
^-- SC1072: Unexpected keyword/token. Fix any mentioned problems and try again.
For more information:
https://www.shellcheck.net/wiki/SC1048 -- Can't have empty then clauses (us...
https://www.shellcheck.net/wiki/SC1072 -- Unexpected keyword/token. Fix any...
https://www.shellcheck.net/wiki/SC1073 -- Couldn't parse this then clause. ...
It's obvious to me this can currently happen on latest version (this commit) of templates/deb/postinst_upgrade.sh.erb.
Ref:
if ! systemctl is-enabled <%= service %>>/dev/null
then
<%ifattributes[:deb_systemd_enable?]-%>
systemctl enable <%=service%>>/dev/null || true
<%end-%><%ifattributes[:deb_systemd_auto_start?]-%>
$debsystemctl start <%=service%>>/dev/null || true
<%end-%><%ifattributes[:deb_systemd_restart_after_upgrade?]-%>
else
$debsystemctl restart <%=service%>>/dev/null || true
<%end-%>
fi
The text was updated successfully, but these errors were encountered:
Ref. PR #1498, we've experienced this when utilizing the below flags for
fpm
:`fpm` invocation
Package install log
X.postinst, lines 30-36:
And a
shellcheck
output to confirm that bash/dash/sh can't handle the aboveif
-test:It's obvious to me this can currently happen on latest version (this commit) of
templates/deb/postinst_upgrade.sh.erb
.Ref:
The text was updated successfully, but these errors were encountered: