This is some minor cleanup which I noticed when adding support for slackware. This should be just as portable if not more so than before.
Some things to note:
PKG_CONFIG_32 and PKG_CONFIG_64 are set as blank variables instead of unset variables. Its better to not rely on unset variables.
The main loop is refactored to combine two similar conditionals and move them after the loop. After the loop breaks $i will conveniently be the found distro.
Uses printf instead of echo which is suggested in the posix spec, echo is not neccesarily portable with anything beyond plain text in single quotes.
This is some minor cleanup which I noticed when adding support for slackware. This should be just as portable if not more so than before.
Some things to note:
PKG_CONFIG_32
andPKG_CONFIG_64
are set as blank variables instead of unset variables. Its better to not rely on unset variables.$i
will conveniently be the found distro.printf
instead ofecho
which is suggested in the posix spec,echo
is not neccesarily portable with anything beyond plain text in single quotes.