summaryrefslogtreecommitdiffhomepage
path: root/subr.rtl/rtl_fileop.subr
diff options
context:
space:
mode:
authorLucía Andrea Illanes Albornoz <lucia@luciaillanes.de>2024-04-24 15:24:48 +0200
committerLucía Andrea Illanes Albornoz <lucia@luciaillanes.de>2024-04-24 15:24:48 +0200
commitb2c1ea9526151c4fed9dca8348019d718f489e76 (patch)
tree4d7e65a3553f0c3c4eabec884075a36eb5e56c2b /subr.rtl/rtl_fileop.subr
parent4e929dbbad9c3b8d2d88f7a44916f14758d39ee5 (diff)
downloadmidipix_build-b2c1ea9526151c4fed9dca8348019d718f489e76.tar.bz2
midipix_build-b2c1ea9526151c4fed9dca8348019d718f489e76.tar.xz
Implements single package files.
Diffstat (limited to 'subr.rtl/rtl_fileop.subr')
-rw-r--r--subr.rtl/rtl_fileop.subr19
1 files changed, 18 insertions, 1 deletions
diff --git a/subr.rtl/rtl_fileop.subr b/subr.rtl/rtl_fileop.subr
index 0f999ad7..9dfc266d 100644
--- a/subr.rtl/rtl_fileop.subr
+++ b/subr.rtl/rtl_fileop.subr
@@ -17,6 +17,12 @@ rtlp_fileop_log() {
};
#
+# Public globals
+#
+
+RTL_FILEOP_SOURCE_FNAME="";
+
+#
# Public subroutines
#
@@ -125,7 +131,7 @@ rtl_fileop() {
touch ${2:+-t "${2}"} -- "${1}"; _rf_rc="${?}";
fi; ;;
- mkdir|mkfifo|rm|source|source_opt|test)
+ mkdir|mkfifo|rm|source|source_with_fnamevar|source_opt|source_opt_with_fnamevar|test)
while [ \( "${?}" -eq 0 \) -a \( ""${#}"" -gt 0 \) ]; do
if [ "${1:+1}" != 1 ]; then
rtl_log_msgV "fatalexit" "${MSG_rtl_fileop_invparm}" "${_rf_op}" "${*}";
@@ -154,11 +160,22 @@ rtl_fileop() {
&& rtlp_fileop_check "${PREFIX:-}" "${1}"; then
rtlp_fileop_log "Sourcing file \`${1}'.";
. "${1}"; _rf_rc="${?}";
+ elif [ "${_rf_op}" = source_with_fnamevar ]\
+ && rtlp_fileop_check "${PREFIX:-}" "${1}"; then
+ rtlp_fileop_log "Sourcing file \`${1}'.";
+ RTL_FILEOP_SOURCE_FNAME="${1}";
+ . "${1}"; _rf_rc="${?}";
elif [ "${_rf_op}" = source_opt ]\
&& rtl_fileop test "${1}"\
&& rtlp_fileop_check "${PREFIX:-}" "${1}"; then
rtlp_fileop_log "Sourcing file \`${1}'.";
. "${1}"; _rf_rc="${?}";
+ elif [ "${_rf_op}" = source_opt_with_fnamevar ]\
+ && rtl_fileop test "${1}"\
+ && rtlp_fileop_check "${PREFIX:-}" "${1}"; then
+ rtlp_fileop_log "Sourcing file \`${1}'.";
+ RTL_FILEOP_SOURCE_FNAME="${1}";
+ . "${1}"; _rf_rc="${?}";
elif [ "${_rf_op}" = test ]\
&& rtlp_fileop_check "${PREFIX:-}" "${1}"\
&& ! [ \( -L "${1}" \) -o \( -e "${1}" \) ]; then