bindep, pacman, and PyPI release
Dear developers, I'm trying to use bindep on Arch but hitting a problem with the output handling. It seems that 'pacman -Q' may output warning lines if you have a file with the same name as the package. E.g.,: $ mkdir cmake $ pacman -Q cmake error: package 'cmake' was not found warning: 'cmake' is a file, you might want to use -p/--file. The current detection assumes the "was not found" is the last part of the output. Applying the patch below seems to fix it. After applying this patch, or whichever change you deem reasonable to fix the issue, it would be great if you could make a new release on PyPI. Thanks, Jakob diff --git a/bindep/depends.py b/bindep/depends.py index bb9553f..cacc863 100644 --- a/bindep/depends.py +++ b/bindep/depends.py @@ -558,7 +558,8 @@ class Pacman(Platform): stderr=subprocess.STDOUT).decode(getpreferredencoding(False)) except subprocess.CalledProcessError as e: eoutput = e.output.decode(getpreferredencoding(False)) - if e.returncode == 1 and eoutput.strip().endswith('was not found'): + s = "error: package '{}' was not found".format(pkg_name) + if e.returncode == 1 and s in eoutput: return None raise # output looks like
On 2020-12-13 11:43:35 +0100 (+0100), Jakob Lykke Andersen wrote:
I'm trying to use bindep on Arch but hitting a problem with the output handling. It seems that 'pacman -Q' may output warning lines if you have a file with the same name as the package. E.g.,:
$ mkdir cmake $ pacman -Q cmake error: package 'cmake' was not found warning: 'cmake' is a file, you might want to use -p/--file.
The current detection assumes the "was not found" is the last part of the output. Applying the patch below seems to fix it.
Apologies for taking this long to reply, I've proposed the patch you submitted here and listed you as co-author: https://review.opendev.org/771108
After applying this patch, or whichever change you deem reasonable to fix the issue, it would be great if you could make a new release on PyPI. [...]
Yes, once that patch is approved by other reviewers for bindep, I'll make sure to tag a new release so it will appear on PyPI. Thanks for providing this fix! -- Jeremy Stanley
On 2020-12-13 11:43:35 +0100 (+0100), Jakob Lykke Andersen wrote:
I'm trying to use bindep on Arch but hitting a problem with the output handling. It seems that 'pacman -Q' may output warning lines if you have a file with the same name as the package. [...] After applying this patch, or whichever change you deem reasonable to fix the issue, it would be great if you could make a new release on PyPI. [...]
The 2.9.0 release of bindep, uploaded to PyPI a few hours ago, incorporates your fix. Thanks again! See the release announcement here: http://lists.opendev.org/pipermail/service-announce/2021-February/000015.htm... -- Jeremy Stanley
participants (2)
-
Jakob Lykke Andersen
-
Jeremy Stanley