From dfb9fee82413a682f3c6ba7484bd80494c6df80e Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 17 Jun 2019 17:55:18 -0400 Subject: ob-installplatconf: Match upstream version patterns --- (limited to 'src') 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 -- cgit v0.9.1