From 9175496bde2f523b3174dd38e59a2e0cbdef8250 Mon Sep 17 00:00:00 2001 From: "Arnaud G. GIBERT" Date: Sat, 14 Feb 2026 11:54:56 +0100 Subject: [PATCH] - Improve ISL management. --- Dockerfile | 133 ++++++++++++++++++++++++++++++++++++++--------- ReleaseNotes.txt | 2 +- compose.yaml | 2 +- 3 files changed, 110 insertions(+), 27 deletions(-) diff --git a/Dockerfile b/Dockerfile index 087be49..84dd244 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,9 @@ LANGUAGE=${LANGUAGE}" ARG RX3_SH='export PAGER=less \n\ export MANPAGER="less -isr" \n\ export EDITOR=emacs \n\ +export ISL_FILE=/etc/img_stack_log \n\ + \n\ + \n\ \n\ cateval() \n\ { \n\ @@ -31,6 +34,26 @@ cateval() \n\ export -f cateval \n\ \n\ + \n\ + \n\ +print() \n\ +{ \n\ + if [[ "$1" == "-i" ]] \n\ + then \n\ + shift \n\ + \n\ + str="%s"`\\\\n` \n\ + else \n\ + str="%s"`\\n` \n\ + fi \n\ + \n\ + printf "${str}" "$*" \n\ +} \n\ + \n\ +export -f print \n\ + \n\ + \n\ + \n\ file_enable() \n\ { \n\ fd_file="$1" \n\ @@ -53,7 +76,7 @@ file_enable() \n\ export -f file_enable \n\ \n\ -export ISL_FILE=/etc/img_stack_log \n\ + \n\ \n\ isl_add() \n\ { \n\ @@ -72,57 +95,117 @@ isl_add() tag=${url/*:} \n\ name=${url%:*} \n\ \n\ + if [[ "${tag}" == "${name}" ]] \n\ + then \n\ + echo "Bad tag format in URL!" \n\ + return 1 \n\ + fi \n\ + \n\ ts=$(date -u +"%Y/%d/%m %H:%M:%S") \n\ \n\ - echo "${ts} ${reg} ${name} ${tag}" >> ${ISL_FILE} \n\ + if [[ ! -e ${ISL_FILE} ]] \n\ + then \n\ + id=1 \n\ + else \n\ + id=$(( $(wc -l <${ISL_FILE}) + 1)) \n\ + fi \n\ + \n\ + str="${id} ${ts} ${reg} ${name} ${tag}" \n\ + \n\ + if [[ $id == "1" ]] \n\ + then \n\ + echo "${str}" >${ISL_FILE} \n\ + else \n\ + sed -i `1i\`"${str}" ${ISL_FILE} \n\ + fi \n\ } \n\ \n\ export -f isl_add \n\ \n\ + \n\ + \n\ +isl_top() \n\ +{ \n\ + line=$( head -1 ${ISL_FILE}) \n\ + \n\ + if [[ "$1" == "-i" ]] \n\ + then \n\ + set ${line} \n\ + \n\ + echo "$5:$6" \n\ + else \n\ + echo "${line}" \n\ + fi \n\ +} \n\ + \n\ +export -f isl_top \n\ + \n\ + \n\ + \n\ isl_cat() \n\ { \n\ - cat ${ISL_FILE} \n\ + if [[ "$1" == "-r" ]] \n\ + then \n\ + tac ${ISL_FILE} \n\ + else \n\ + cat ${ISL_FILE} \n\ + fi \n\ } \n\ \n\ export -f isl_cat \n\ \n\ -isl_tail() \n\ -{ \n\ - tail -1 ${ISL_FILE} \n\ -} \n\ \n\ -export -f isl_tail \n\ - \n\ -isl_last() \n\ -{ \n\ - set $(isl_tail) \n\ - \n\ - echo "$4:$5" \n\ -} \n\ - \n\ -export -f isl_last \n\ \n\ isl_html_dump() \n\ { \n\ - while read line \n\ + r_flag="" \n\ + i_flag="" \n\ + \n\ + while [[ $# -gt 0 ]] \n\ + do \n\ + if [[ "$1" == "-r" ]] \n\ + then \n\ + r_flag="$1" \n\ + else \n\ + if [[ "$1" == "-i" ]] \n\ + then \n\ + i_flag="-i" \n\ + fi \n\ + fi \n\ + \n\ + shift \n\ + done \n\ + \n\ + i=1 \n\ + \n\ + isl_cat "${r_flag}" | while read line \n\ do \n\ set $line \n\ \n\ - echo -n " \\n" \n\ + print "${i_flag}" " " \n\ \n\ - i=1 \n\ - while [[ $i -lt 6 ]] \n\ + j=1 \n\ + while [[ $j -lt 7 ]] \n\ do \n\ - echo -n " ${!i}\\n" \n\ - i=$(( $i + 1)) \n\ + if [[ "$j" == "1" ]] \n\ + then \n\ + print "${i_flag}" " ${!j}" \n\ + else \n\ + print "${i_flag}" " ${!j}" \n\ + fi \n\ + \n\ + j=$(( $j + 1)) \n\ done \n\ \n\ - echo -n " \\n" \n\ - done < ${ISL_FILE} \n\ + print "${i_flag}" " " \n\ + i=$(( $j + 1)) \n\ + done \n\ } \n\ \n\ export -f isl_html_dump \n\ \n\ + \n\ + \n\ alias ll="ls -la" \n\ alias em="emacs"' #--------------------------------------------------------------------------------------------------- diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index c15e1d5..9b91c66 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------------------------------------------------------------ -Rx3-Docker/Base V 1.4.0 - A. GIBERT - 2026/02/13 +Rx3-Docker/Base V 1.4.0 - A. GIBERT - 2026/02/14 ------------------------------------------------------------------------------------------------------------------------------------ - Add Image Stacking Log functions, diff --git a/compose.yaml b/compose.yaml index 2787bfe..7e6604b 100644 --- a/compose.yaml +++ b/compose.yaml @@ -17,8 +17,8 @@ services: IMG_NAME: ${IMG_NAME} IMG_NAME_FULL: ${IMG_NAME_FULL} IMG_VERSION: ${IMG_VERSION} - IMG_URL: ${IMG_URL} IMG_MAINTAINER: ${IMG_MAINTAINER} + IMG_URL: ${IMG_URL} LANG: ${LANG} LANGUAGE: ${LANGUAGE} LOCALTIME: ${LOCALTIME}