summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/oh-installfiles.sh20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/oh-installfiles.sh b/src/oh-installfiles.sh
index 6c4bcf5..6de0d5c 100644
--- a/src/oh-installfiles.sh
+++ b/src/oh-installfiles.sh
@@ -30,9 +30,23 @@ files_ifs='
main()
{
+ dir='dest'
+
ob_set_locale_path '@@LOCALEDIR@@/%s/LC_MESSAGES/%s.ms'
ob_set_text_domain 'opkhelper'
+ while getopts 'd:' opt; do
+ case "${opt}" in
+ d)
+ dir="${OPTARG}"
+ ;;
+ ?)
+ ob_error "$(ob_get_msg 'bad_opt')"
+ exit 1
+ ;;
+ esac
+ done
+
ob_init_package '..'
ob_parse_package_metadata -c '.opkbuild.cache'
@@ -45,12 +59,12 @@ main()
chmod 755 "${pkg}.data"
while IFS="${files_ifs}" read -r pattern; do
- for file in dest/${pattern}; do
+ for file in "${dir}/"${pattern}; do
[ -e "${file}" ] || continue
- file="${file#dest}"
+ file="${file#${dir}}"
mkdir -p "${pkg}.data/${file%/*}"
# TODO: If file, ln file. If dir, recursively mkdir and ln.
- mv "${PWD}/dest/${file}" "${pkg}.data/${file}"
+ mv "${PWD}/${dir}/${file}" "${pkg}.data/${file}"
done
done <"../${pkg}.pkg/files"
done