[Bug 262862] devel/qt5: POST-DEINSTALL errors when deinstalling

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Apr 14 16:37:41 BST 2022


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262862

Adriaan de Groot <adridg at freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |adridg at freebsd.org
             Status|New                         |In Progress

--- Comment #1 from Adriaan de Groot <adridg at freebsd.org> ---
Similarly, removing qt5-declarative shows POST-DEINSTALL script failed as well.
Actually all of the Qt5 packages do this. I guess it's a recent(ish) change to
pkg to print the failure message.

The post-deinstall script looks like this (extracted from the pkg database):

```
#!/bin/sh
qi="/usr/local/include/qt5"
qc="$qi/QtCore/qconfig-modules.h"
qm="declarative-test"
case $2 in
POST-DEINSTALL)
[ \! -e "$qc" ] && touch "$qc"
sed  "/qconfig-$qm\.h/ d" "$qc"
[ \! -e "$qi/QtCore/qconfig.h" ] && \
[ \! -s "$qc" ] && (
rm -f "$qc"
rmdir "$qi/QtCore"
rmdir "$qi"
) > /dev/null 2>&1
;;
esac
```

What's going "wrong" is after the sed, it checks if QtCore/qconfig.h
no-longer-exists. It does, so `[ ! -e "$qi/QtCore/qconfig.h" ]` is false; that
pipeline exits with a non-zero code. There's nothing **after** that pipeline to
reset the exit code, and so the result of the whole script is non-zero -- and
pkg prints a failure.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.


More information about the kde-freebsd mailing list