diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-06-17 17:55:18 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-06-17 17:55:18 (EDT) |
commit | dfb9fee82413a682f3c6ba7484bd80494c6df80e (patch) | |
tree | ade817d7f836dd23fb56abebe3116f2730805e23 /src | |
parent | ee2aef87d9bc356f29e0e6f3b3c6ad92ffafcf2d (diff) |
ob-installplatconf: Match upstream version patterns
Diffstat (limited to 'src')
-rw-r--r-- | src/ob-installplatconf.sh | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/ob-installplatconf.sh b/src/ob-installplatconf.sh index 190df42..26822b3 100644 --- a/src/ob-installplatconf.sh +++ b/src/ob-installplatconf.sh @@ -28,7 +28,8 @@ copy_config() local dest= local dir= local src_base= - local config_dir_base= + local platconf_dir= + local pkg_ver= while read -r src dest; do if [ -z "${src}" ] || [ -z "${dest}" ]; then @@ -46,16 +47,19 @@ copy_config() # Find the config package files. src_base='' - IFS="${OB_LF}" - for config_dir_base in $(ob_get_system_path 'platconf' \ - "${OPK_SOURCE}" "${OPK_SOURCE_VERSION}" \ - "${OPK_HOST_PLAT}"); do - unset IFS - if [ -d "${config_dir_base}" ]; then - src_base="${config_dir_base}" - fi - done - unset IFS + platconf_dir="$(ob_get_system_path 'platconf' \ + "${OPK_HOST_PLAT}")" + if [ -d "${platconf_dir}/${OPK_SOURCE}/" ]; then + src_base="${platconf_dir}/${OPK_SOURCE}/" + else + pkg_ver="${OPK_SOURCE}_${OPK_SOURCE_VERSION_UPSTREAM}" + for dir in "${platconf_dir}/${OPK_SOURCE}_"*/; do + case "${platconf_dir}/${pkg_ver}/" in ${dir}) + src_base="${dir}" + break + esac + done + fi if [ -z "${src_base}" ]; then # This shouldn't happen unless the package maintainer # neglected to add the config package to the package's |