You are not logged in.

#1 2021-09-03 18:33:40

Maniaxx
Member
Registered: 2014-05-14
Posts: 732

[solved] yay scripting - passing arguments/packages by xargs fails

Hallo,
i want to replace 'pipewire' with 'pipewire-git' by using yay -Qs, printf (to add the '-git' suffix) and xarg. The corresponding pipewire packages dependencies do not always point to the git version so i have to explicitly specify every package. I've created the one-liner below but it fails due to an additional 'EOF' argument that gets passed to the provider selection for libcamera-git. I've tried several things on xargs (-0 -d' ', -E '') but nothing helps. Where is this 'EOF' coming from and how can i remove it?

Edit: Even if this problem is solved it fails due to not finding 'pipewire-jack-dropin-git'. That's correct as there is no git package for that. How can i ignore not existing packages?

$ yay -Qsq pipewire
lib32-pipewire
lib32-pipewire-jack
pipewire
pipewire-alsa
pipewire-jack
pipewire-jack-dropin
pipewire-media-session
pipewire-pulse
$ printf '%s-git ' $(yay -Qsq pipewire) | xargs echo
lib32-pipewire-git lib32-pipewire-jack-git pipewire-git pipewire-alsa-git pipewire-jack-git pipewire-jack-dropin-git pipewire-media-session-git pipewire-pulse-git
$ printf '%s-git ' $(yay -Qsq pipewire) | xargs yay --needed -S
:: There are 2 providers available for libcamera-git:
:: Repository AUR
    1) libcamera-git 2) libcamera-clang-git 

Enter a number (default=1): EOF
:: There are 2 providers available for libcamera-git:
:: Repository AUR
    1) libcamera-git 2) libcamera-clang-git 

Enter a number (default=1): EOF
 -> Could not find all required packages:
	libcamera-git (Wanted by: pipewire-git -> alsa-card-profiles-git)
	libcamera-git (Wanted by: pipewire-git)
	libcamera-git (Wanted by: pipewire-alsa-git -> pipewire-media-session-git -> pipewire-git)
	libcamera-git (Wanted by: pipewire-alsa-git -> pipewire-media-session-git)
	libcamera-git (Wanted by: pipewire-alsa-git)
	libcamera-git (Wanted by: pipewire-jack-git)
	libcamera-git (Wanted by: pipewire-media-session-git)
	libcamera-git (Wanted by: pipewire-pulse-git)
	pipewire-jack-dropin-git (Target)

Last edited by Maniaxx (2021-09-03 19:32:45)


sys2064

Offline

#2 2021-09-03 18:49:47

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [solved] yay scripting - passing arguments/packages by xargs fails

See

man -P 'less -p open-tty' xargs

or forget the pipe+xargs and use another level of command substitution to pass the printf output directly to yay as arguments.

Offline

#3 2021-09-03 19:32:09

Maniaxx
Member
Registered: 2014-05-14
Posts: 732

Re: [solved] yay scripting - passing arguments/packages by xargs fails

Thanks. I guess that will do it (next time). I cannot confirm it at the moment as i have installed it manually in the meantime.

Last edited by Maniaxx (2021-09-03 19:32:24)


sys2064

Offline

Board footer

Powered by FluxBB