pacutils icon indicating copy to clipboard operation
pacutils copied to clipboard

--sync not allowed for pacsift even without packages on stdin

Open AladW opened this issue 9 years ago • 5 comments

When pacsift is used with arguments, but inside a bash function - which itself takes stdin from a pipe - it assumes taking packages from stdin as well. As a result, --sync isn't accepted.

Example code: https://ptpb.pw/~aurqueue/sh#L-52

Maybe there's a flaw in my logic, if so, consider this a simple question. :)

AladW avatar Feb 21 '16 17:02 AladW

That is an unfortunate consequence of having everything read from stdin whenever it's available. I think your current solution using <&- is the correct one, for the time being. I'll try to come up with a better way to control reading from stdin that I can make reasonably consistent across the various tools. In the meantime, I've added caveats to the relevant man pages.

andrewgregory avatar Feb 29 '16 16:02 andrewgregory

Wouldn't using a - marker for stdin be a simple solution here?

AladW avatar Mar 08 '19 11:03 AladW

Apparently with pacman 6, the workaround <&- is no longer functional (@kattjevfel)

AladW avatar Jan 24 '21 18:01 AladW

A mere 7 years later, I'm looking to finally resolve this. I intend to remove the auto-detection and add --read-fd and --read-file options to the relevant programs with - as a shortcut for --read-fd=0.

andrewgregory avatar Nov 08 '23 03:11 andrewgregory