Find data-files in the correct order (#727)

Squashed commit of the following:

commit 136484f3ed28d57bf4244d9c716b8daa1cd9a8a7
Merge: 2083fb2 cae6357
Author: Richard T Bonhomme <tincantech@protonmail.com>
Date:   Tue Oct 18 19:44:17 2022 +0100

    Merge branch 'fix-order-725' of ssh://github.com/TinCanTech/easy-rsa into TinCanTech-fix-order-725

    Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>

commit cae6357c63b473e33e31620264bef4ede596ffac
Author: Richard T Bonhomme <tincantech@protonmail.com>
Date:   Sun Oct 16 22:52:44 2022 +0100

    Find data-files in the correct order

    With this change the PKI becomes the 'preferred' location for data-files.

    All other supported locations are searched by specific order.

    While this new order is the correct 'preferred' order, the associated code
    install_data_to_pki() needs to be simplified.

    Closes: #725
    Closes: #723

    Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>

Signed-off-by: Richard T Bonhomme <tincantech@protonmail.com>
This commit is contained in:
Richard T Bonhomme 2022-10-18 19:44:56 +01:00
parent 2083fb29b5
commit 02f13f6064
No known key found for this signature in database
GPG Key ID: 2D767DB92FB6C246

View File

@ -1093,12 +1093,14 @@ find_x509_types_dir() {
# Find x509-types dir, in specific order
for area in \
"$EASYRSA_PKI" \
"$EASYRSA" \
"$PWD" \
"${0%/*}" \
'/usr/local/share/easy-rsa' \
'/usr/share/easy-rsa' \
"${0%/*}" \
'/etc/easy-rsa' \
# EOL - # Add more distros here
# EOL
do
# Find x509-types
[ -e "${area}/$x509_types_dir" ] || continue
@ -1164,12 +1166,14 @@ install_data_to_pki () {
# Find and copy data-files, in specific order
for area in \
'/usr/local/share/easy-rsa' \
'/usr/share/easy-rsa' \
"$EASYRSA_PKI" \
"$EASYRSA" \
"$PWD" \
"${0%/*}" \
'/usr/local/share/easy-rsa' \
'/usr/share/easy-rsa' \
'/etc/easy-rsa' \
# EOL - # Add more distros here
# EOL
do
# Omitting "$vars_file"
for source in \