summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-10-20 16:58:58 (EDT)
committer P. J. McDermott <pjm@nac.net>2012-10-20 16:59:56 (EDT)
commit1a52b320444397bfa464184d1779524456925340 (patch)
tree1934101f7fe3dd56b6220ee1292b9aa9555c1358 /src
parent22fa9d914332bba83a791a368d3c8a920fcd6dcd (diff)
Expect >= 1 platconf dirs from ob_get_system_path.
Diffstat (limited to 'src')
-rw-r--r--src/ob-installplatconf.sh24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/ob-installplatconf.sh b/src/ob-installplatconf.sh
index d179cc4..4acaf3b 100644
--- a/src/ob-installplatconf.sh
+++ b/src/ob-installplatconf.sh
@@ -25,6 +25,9 @@ ob_use locale
ob_use output
ob_use package
+system_paths_ifs='
+'
+
main()
{
ob_set_text_domain 'opkbuild'
@@ -58,21 +61,28 @@ copy_config()
if [ -z "${src}" -o -z "${dest}" ]; then
ob_error "$(ob_get_msg 'bad_config_syntax')" "${list}"
fi
+
# Make sure the destination directory exists.
mkdir -p "${dest_base}/${dest%/*}" || \
ob_error "$(ob_get_msg 'cant_make_config_dest_dir')" "${dest%/*}"
+
# Find the config package files.
- config_dir_base="$(ob_get_system_path 'platconf' \
- "${OPK_SOURCE}" "${OPK_SOURCE_VERSION}" "${OPK_HOST_PLAT}")"
- if [ -d "${config_dir_base}-${OPK_SOURCE_VERSION_UPSTREAM}" ]; then
- src_base="${config_dir_base}-${OPK_SOURCE_VERSION_UPSTREAM}"
- elif [ -d "${config_dir_base}" ]; then
- src_base="${config_dir_base}"
- else
+ src_base=''
+ IFS="${system_paths_ifs}"
+ 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
+ if [ -z "${src_base}" ]; then
# This shouldn't happen unless the package maintainer neglected to
# add the config package to the package's Build-Depends field.
ob_error "$(ob_get_msg 'no_config_dir')"
fi
+
# Copy the config file(s).
ob_info "$(ob_get_msg 'copying_config_file')" "${src}" "${dest}"
cp -p "${src_base}/${src}" "${dest_base}/${dest}" || \