kisslinux / kiss

KISS Linux - Package Manager
https://kisslinux.github.io
MIT License
464 stars 62 forks source link

endless blocking during conflict resolution if no packages installed ( no manifest found ) #182

Closed magenbluten closed 4 years ago

magenbluten commented 4 years ago

if no manifest file got found "$@" might be empty and grep reads from stdin thus blocks forever.

https://github.com/kisslinux/kiss/blob/0f054313e35d86cf0f7eca485cb9c2f4b1732422/kiss#L800

Akeboshiwind commented 4 years ago

A simple fix for this is to quote the $@ inside the double quotes.

i.e.

grep -Fxf "$mak_dir/$pid-m" -- "'$@'" 2>/dev/null > "$mak_dir/$pid-c" ||: 

At least, this worked for me when I tested it 😁

Akeboshiwind commented 4 years ago

Hmm, scratch that it just breaks it but the error get's ignored thanks to 2>/dev/null.

I guess a better solution might be to append a /dev/null to the list of manifests to ensure the list is never empty:

set -- "$@" "/dev/null"
grep -Fxf "$mak_dir/$pid-m" -- "$@" 2>/dev/null > "$mak_dir/$pid-c" ||: