summaryrefslogtreecommitdiffhomepage
path: root/subr
diff options
context:
space:
mode:
Diffstat (limited to 'subr')
-rw-r--r--subr/pkg_install.subr31
-rw-r--r--subr/rtl.subr40
2 files changed, 43 insertions, 28 deletions
diff --git a/subr/pkg_install.subr b/subr/pkg_install.subr
index ddd6230b..73898337 100644
--- a/subr/pkg_install.subr
+++ b/subr/pkg_install.subr
@@ -11,33 +11,6 @@ pkgp_install_clean_lib() {
fi;
};
-pkgp_install_files() {
- if [ -n "${PKG_INSTALL_FILES}" ]; then
- (set -- ${PKG_INSTALL_FILES};
- while [ ${#} -gt 0 ]; do
- case "${1}" in
- @*=*)
- __ln_target="${1%=*}";
- __ln_target="${__ln_target#@}";
- __ln_fname="${1#*=}";
- echo ln -sf -- ${__ln_target} ${PKG_PREFIX}/${__ln_fname};
- ln -sf -- ${__ln_target} ${PKG_PREFIX}/${__ln_fname};
- ;;
- /=*)
- __mkdir_fname="${1#/=}";
- insecure_mkdir ${PKG_PREFIX}/${__mkdir_fname};
- ;;
- *)
- __file_fname_src="${1%=*}";
- __file_fname_dst="${1#*=}";
- echo cp -pP -- ${__file_fname_src} ${PKG_PREFIX}/${__file_fname_dst};
- cp -pP -- ${__file_fname_src} ${PKG_PREFIX}/${__file_fname_dst};
- ;;
- esac; shift;
- done);
- fi;
-};
-
pkgp_install_dlltool() {
if [ "${PKG_BUILD_TYPE}" != "host" ] \
&& test_cmd perk \
@@ -97,7 +70,9 @@ pkg_install() {
pkg_${PKG_NAME}_install_post;
fi;
pkgp_install_clean_lib;
- pkgp_install_files;
+ if [ -n "${PKG_INSTALL_FILES}" ]; then
+ (install_files -v ${PKG_INSTALL_FILES});
+ fi;
pkgp_install_dlltool;
set_build_script_done install -finish;
};
diff --git a/subr/rtl.subr b/subr/rtl.subr
index be3efa43..90faa3c9 100644
--- a/subr/rtl.subr
+++ b/subr/rtl.subr
@@ -55,6 +55,46 @@ insecure_mkdir() {
done;
};
+install_files() {
+ if [ "${1}" = "-v" ]; then
+ _if_verbose="${1}"; shift;
+ fi;
+ while [ ${#} -gt 0 ]; do
+ case "${1}" in
+ @*=*)
+ __ln_target="${1%=*}";
+ __ln_target="${__ln_target#@}";
+ __ln_fname="${1#*=}";
+ if [ -e ${__ln_fname} ]; then
+ if [ ${_if_verbose:-0} -eq 1 ]; then
+ echo secure_rm ${__ln_fname};
+ fi;
+ secure_rm ${__ln_fname};
+ fi;
+ if [ ${_if_verbose:-0} -eq 1 ]; then
+ echo ln -sf -- ${__ln_target} ${PKG_PREFIX:+${PKG_PREFIX}/}${__ln_fname};
+ fi;
+ ln -sf -- ${__ln_target} ${PKG_PREFIX:+${PKG_PREFIX}/}${__ln_fname};
+ ;;
+ /=*)
+ __mkdir_fname="${1#/=}";
+ if [ ${_if_verbose:-0} -eq 1 ]; then
+ echo insecure_mkdir ${PKG_PREFIX:+${PKG_PREFIX}/}${__mkdir_fname};
+ fi;
+ insecure_mkdir ${PKG_PREFIX:+${PKG_PREFIX}/}${__mkdir_fname};
+ ;;
+ *)
+ __file_fname_src="${1%=*}";
+ __file_fname_dst="${1#*=}";
+ if [ ${_if_verbose:-0} -eq 1 ]; then
+ echo cp -pP -- ${__file_fname_src} ${PKG_PREFIX:+${PKG_PREFIX}/}${__file_fname_dst};
+ fi;
+ cp -pP -- ${__file_fname_src} ${PKG_PREFIX:+${PKG_PREFIX}/}${__file_fname_dst};
+ ;;
+ esac; shift;
+ done; unset _if_verbose;
+};
+
match_list() {
_ml_cmp="${3}"; push_IFS "${2}"; set -- ${1}; pop_IFS;
while [ ${#} -gt 0 ]; do