On (29/02/16 18:54), Nikolai Kondrashov wrote:
On 02/29/2016 06:31 PM, Lukas Slebodnik wrote:
>On (28/02/16 20:12), Dan Lavu wrote:
>>>Rereading the initial message, what I wrote previously is a little unclear.
>>>So this is my effort to clarify what I'm running into and get help. So
>>>setting up CI tests upstream, the complete run and setup is done by issuing
>>>
>>>sssd.git/contrib/ci/run
>>>
>>>This command fails and must be ran by appending -n, so it ignores the
>>>dependencies. So I tracked it down to the second iteration of yum install,
>>>the second run has syntax errors; missing single quotes and it appends an
>>>extra double dash before the first package and can't find package --.
I'm
>>>trying to trace down the problem but I've seeing variables where i
can't seem
>>>to find out where they are being defined. @VARIABLE@ on line 48 of
>>>contrib/ci/deps.sh
>>>
>>>If anybody can provide some insight, that would be great, thank you.
>>>
>Attached patch should fix issues with installation of package on fedora.
>
>http://sssd-ci.duckdns.org/logs/job/38/32/summary.html
Thanks, Lukas! I'm fine with the idea, but please see my comments below.
> The rest of the required packages CI will attempt to install itself, using
>-the distribution's package manager invoked through sudo.
>+the distribution's package manager invoked through sudo. We need to use
>+yum-deprecated instead of yum on Fedora >= 22 due to bug in dnf BZ1215208.
>
> A sudo rule can be employed to selectively avoid password prompts on Red Hat
> distros:
>
> <USER> ALL=(ALL:ALL) NOPASSWD: /usr/bin/yum --assumeyes install -- *
>+ <USER> ALL=(ALL:ALL) NOPASSWD: /usr/bin/yum-deprecated --assumeyes install
-- *
It would be good to mention the different rule required on RHEL here (CI still
invokes "yum" there). Otherwise the instructions would be wrong and confusing.
It looks like I'm brainwashed today. I'm out of ideas for reasonable
sentence.
Could you suggest something.
> and Debian-based distros:
>
>diff --git a/contrib/ci/distro.sh b/contrib/ci/distro.sh
>index
da797d02f4b110f9e2c074fc2c97f092ae7200af..23d11de7ab0394a948fc5ed10899ae3a7565cf44 100644
>--- a/contrib/ci/distro.sh
>+++ b/contrib/ci/distro.sh
>@@ -50,7 +50,14 @@ function distro_pkg_install()
> {
> declare prompt=$'Need root permissions to install packages.\n'
> prompt+="Enter sudo password for $USER: "
>- if [[ "$DISTRO_BRANCH" == -redhat-* ]]; then
>+ if [[ "$DISTRO_BRANCH" =~ -redhat-fedora-2[2-9] ]]; then
This can also be expressed with the regular shell globs as such:
if [[ "$DISTRO_BRANCH" == -redhat-fedora-2[2-9]* ]]; then
done
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.
LS