On 03/01/2016 10:46 AM, Lukas Slebodnik wrote:
On (29/02/16 20:30), Nikolai Kondrashov wrote:
> On 02/29/2016 07:27 PM, Lukas Slebodnik wrote:
>> On (29/02/16 18:54), Nikolai Kondrashov wrote:
>>> keeping the "if" branches consistent and somewhat easier to
interpret.
>>> However, if you and others are more comfortable reading and using regex(3)
>>> regexes, then it's fine.
>>>
>>>> + [ $# != 0 ] && sudo -p "$prompt" \
>>>> + yum-deprecated --assumeyes install --
"$@" |&
>>>> + awk 'BEGIN {s=0}
>>>> + /^No package .* available.$/ {s=1}
>>>> + {print}
>>>> + END {exit s}'
>>>> + elif [[ "$DISTRO_BRANCH" == -redhat-* ]]; then
>>>> [ $# != 0 ] && sudo -p "$prompt" yum
--assumeyes install -- "$@" |&
>>>> # Pass input to output, fail if a missing package is
reported
>>>> # TODO Remove and switch to DNF once
>>>
>>> I see that avoiding copy-pasting here would produce more complicated code,
so
>>> it's perhaps OK. However, it would be good then to copy-paste the
comment
>>> along with the TODO as well, and then perhaps add a note and a TODO
regarding
>>> BZ1215208.
>>>
>> We will still need awk trick for old style yum on el{6,7}. Therefore
>> I moved TODO to the 1st branch.
>
> Well, yeah, the bug is Fedora-specific, but we still need to have a reminder
> to remove the hack on RHEL as well. It will get fixed eventually.
>
Correct me if I'm wrong.
We need to awk workaround because yum does not fail if you want to install
unknown packages and there is not a bug for yum and I doubt they would
fix/change it in stable distributions. Therefore we will need to have
this solution there for yum anyway.
Yes. IIRC I reported this for yum originally, but the developers moved the bug
to dnf (fixing it later) and refused to fix it in yum.
I too doubt they'll fix it in stable distributions. However I expect they will
get dnf into RHEL (which is handled by the bottom branch) eventually (RHEL8?),
and will also fix that '--' bug. That's when a note would come in handy.
dnf behaves correctly in this manner. However it ignores separator
"--"
between arguments and packages which is tracked in BZ1215208.
Yes, exactly.
Nick