Comment # 14 on bug 1191260 from
We have different taste wrt what code is easy to understand and read. I guess
we will have to deal with that somehow. Being adults, we should be able to
figure it out.

If we need a different tool for enrolling certificates on Power/s390, I expect
that we will not work with explicit conditionals everywhere. Instead we'll add
some abstraction layer that hides the architecture specifics and let us do high
level operations like "enroll" or "delete"; and "is_supported", too.

The code will then look like this:

is_supported() {
   case $arch in
   power) ...;;
   s390x) ...;;
   *) mokutil --sb-state;;
   esac
}

if ! is_supported; then 
    exit 0
fi

case $op in
post) 
    enroll;;
postun)
    delete;;
...
esac


... which is nice and clean, IMHO. We can simplify the conditionals inside the
last case statement because we don't need to worry whether certificates are
generally supported in the first place.


You are receiving this mail because: