Compare commits
1 Commits
master
...
a0e7e86408
| Author | SHA1 | Date | |
|---|---|---|---|
| a0e7e86408 |
@@ -1,4 +1,4 @@
|
|||||||
Welcome to Rx3 Base 1.2.x !
|
Welcome to Rx3 Base 1.1.x !
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,31 +1,7 @@
|
|||||||
------------------------------------------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
Rx3-Base V 1.2.0 - A. GIBERT - 2026/09/13
|
Rx3-Base V 1.1.2 - A. GIBERT - 2026/04/19
|
||||||
------------------------------------------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
- Base library:
|
|
||||||
- Implement VSL (Version Stack Log),
|
|
||||||
- ISL:
|
|
||||||
- Add VSL support,
|
|
||||||
- URPMI-Setup
|
|
||||||
- Add VSL support.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
Rx3-Base V 1.1.3 - A. GIBERT - 2026/08/01
|
|
||||||
------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
- Rx3 Profile:
|
|
||||||
- Add PATH management.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
Rx3-Base V 1.1.2 - A. GIBERT - 2026/05/03
|
|
||||||
------------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
- Base library: Add optionnal "FORCE" flag to cmd_exec & sh_exec functions to overstep Test mode,
|
|
||||||
- Split between rx3-base, rx3-base-config, rx3-base-libs and rx3-base-tools RPM packages,
|
|
||||||
- Move lib dir into top dir & remove usr,
|
- Move lib dir into top dir & remove usr,
|
||||||
- Add www/cgi-bin dir,
|
- Add www/cgi-bin dir,
|
||||||
- Add urpmi-setup-dump.cgi and package it as example,
|
- Add urpmi-setup-dump.cgi and package it as example,
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
%define name rx3-base
|
%define name rx3-base
|
||||||
|
|
||||||
%define version 1.2.0
|
%define version 1.1.2
|
||||||
%define release %mkrel 1rx3
|
%define release %mkrel 1rx3
|
||||||
|
|
||||||
|
|
||||||
@@ -36,12 +36,11 @@
|
|||||||
# Package
|
# Package
|
||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
Summary: Rx3 Base Package
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
Version: %{version}
|
Version: %{version}
|
||||||
Release: %{release}
|
Release: %{release}
|
||||||
|
|
||||||
Summary: Rx3 Base Meta Package
|
|
||||||
|
|
||||||
License: GPL 3.0
|
License: GPL 3.0
|
||||||
URL: https://git.rx3.org/gitea/rx3/%{name}
|
URL: https://git.rx3.org/gitea/rx3/%{name}
|
||||||
Group: System
|
Group: System
|
||||||
@@ -52,10 +51,6 @@ Packager: Arnaud G. GIBERT <arnaud@rx3.net>
|
|||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
Requires: %{name}-config
|
|
||||||
Requires: %{name}-libs
|
|
||||||
Requires: %{name}-tools
|
|
||||||
|
|
||||||
Source0: https://git.rx3.org/gitea/rx3/%{name}/archive/%{name}-%{version}.tar.gz
|
Source0: https://git.rx3.org/gitea/rx3/%{name}/archive/%{name}-%{version}.tar.gz
|
||||||
|
|
||||||
|
|
||||||
@@ -64,34 +59,7 @@ Source0: https://git.rx3.org/gitea/rx3/%{name}/ar
|
|||||||
This is the base component of an Rx3 system:
|
This is the base component of an Rx3 system:
|
||||||
- Default config files,
|
- Default config files,
|
||||||
- Base bash libraries,
|
- Base bash libraries,
|
||||||
- Base tools.
|
- Default tools.
|
||||||
|
|
||||||
This meta packe will install all the depencies.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%package config
|
|
||||||
Summary: Rx3 Base Config
|
|
||||||
|
|
||||||
%description config
|
|
||||||
This is a base component of an Rx3 system: Default config files.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%package libs
|
|
||||||
Summary: Rx3 Base Libraires
|
|
||||||
|
|
||||||
%description libs
|
|
||||||
This is a base component of an Rx3 system: Base bash libraries.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%package tools
|
|
||||||
Summary: Rx3 Base Tools
|
|
||||||
Requires: %{name}-libs
|
|
||||||
|
|
||||||
%description tools
|
|
||||||
This is a base component of an Rx3 system: Base tools.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -146,27 +114,12 @@ cp sbin/* %{buildroot}%{_sbindir}
|
|||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
%files
|
%files
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%files config
|
|
||||||
%doc ReadMe.txt ReleaseNotes.txt ToDo.txt
|
|
||||||
%license COPYING COPYING.LESSER GNU_GPL-3.0.txt GNU_LGPL-3.0.txt GNU_FDL-1.3.txt
|
|
||||||
%defattr(644,root,root)
|
|
||||||
%{_sysconfdir}/profile.d/*
|
|
||||||
|
|
||||||
|
|
||||||
%files libs
|
|
||||||
%doc ReadMe.txt ReleaseNotes.txt ToDo.txt
|
|
||||||
%license COPYING COPYING.LESSER GNU_GPL-3.0.txt GNU_LGPL-3.0.txt GNU_FDL-1.3.txt
|
|
||||||
%defattr(644,root,root)
|
|
||||||
%{_prefix}/lib/rx3/*
|
|
||||||
|
|
||||||
%files tools
|
|
||||||
%doc ReadMe.txt ReleaseNotes.txt ToDo.txt www/cgi-bin/urpmi-setup-dump.cgi
|
%doc ReadMe.txt ReleaseNotes.txt ToDo.txt www/cgi-bin/urpmi-setup-dump.cgi
|
||||||
%license COPYING COPYING.LESSER GNU_GPL-3.0.txt GNU_LGPL-3.0.txt GNU_FDL-1.3.txt
|
%license COPYING COPYING.LESSER GNU_GPL-3.0.txt GNU_LGPL-3.0.txt GNU_FDL-1.3.txt
|
||||||
%defattr(644,root,root)
|
%defattr(644,root,root)
|
||||||
|
%{_sysconfdir}/profile.d/*
|
||||||
%{_sysconfdir}/bash_completion.d/*
|
%{_sysconfdir}/bash_completion.d/*
|
||||||
|
%{_prefix}/lib/rx3/*
|
||||||
%attr(0755,root,root) %{_sbindir}/*
|
%attr(0755,root,root) %{_sbindir}/*
|
||||||
|
|
||||||
|
|
||||||
@@ -178,15 +131,8 @@ cp sbin/* %{buildroot}%{_sbindir}
|
|||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Sun Sep 13 2026 Arnaud G. GIBERT <arnaud@rx3.net> - 1.2.0-1rx3.mga9
|
* Thu Apr 16 2026 Arnaud G. GIBERT <arnaud@rx3.net> - 1.1.2-1rx3.mga9
|
||||||
- Update to 1.2.0
|
- Update ro 1.1.2,
|
||||||
|
|
||||||
* Sat Aug 1 2026 Arnaud G. GIBERT <arnaud@rx3.net> - 1.1.3-1rx3.mga9
|
|
||||||
- Update to 1.1.3
|
|
||||||
|
|
||||||
* Sun May 3 2026 Arnaud G. GIBERT <arnaud@rx3.net> - 1.1.2-1rx3.mga9
|
|
||||||
- Update to 1.1.2
|
|
||||||
- Split between rx3-base, rx3-base-config, rx3-base-libs and rx3-base-tools packages
|
|
||||||
- Move lib source dir
|
- Move lib source dir
|
||||||
- Add cgi-bin example as doc
|
- Add cgi-bin example as doc
|
||||||
|
|
||||||
|
|||||||
@@ -27,17 +27,6 @@
|
|||||||
# Global Variable
|
# Global Variable
|
||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
for prefix in "/opt/" "/usr/" "/" "/usr/global/" "/usr/local/"
|
|
||||||
do
|
|
||||||
for suffix in bin sbin
|
|
||||||
do
|
|
||||||
dir=${prefix}${suffix}
|
|
||||||
PATH="${dir}:$(echo $PATH | sed -e "s%^${dir}:%%" -e "s%:${dir}:%:%" -e "s%:${dir}$%%")"
|
|
||||||
done
|
|
||||||
done
|
|
||||||
|
|
||||||
export PATH
|
|
||||||
|
|
||||||
export MANPATH=$MANPATH:/usr/local/share/man:/usr/global/share/man:/opt/share/man
|
export MANPATH=$MANPATH:/usr/local/share/man:/usr/global/share/man:/opt/share/man
|
||||||
export CLASSPATH=$CLASSPATH:/usr/local/lib/java:/usr/global/lib/java:/usr/global/lib/java
|
export CLASSPATH=$CLASSPATH:/usr/local/lib/java:/usr/global/lib/java:/usr/global/lib/java
|
||||||
export XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share:/usr/local/share:/usr/global/share:/opt/share
|
export XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share:/usr/local/share:/usr/global/share:/opt/share
|
||||||
|
|||||||
@@ -46,15 +46,6 @@ shopt -s extglob
|
|||||||
# Global Variable
|
# Global Variable
|
||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
declare -Ag LIB_VSL_TAB=()
|
|
||||||
declare -g LIB_VSL_ID_LIST=""
|
|
||||||
declare -g LIB_VSL_ID_NB=0
|
|
||||||
declare -g LIB_VSL_NAME_LEN=0
|
|
||||||
declare -g LIB_VSL_VERSION_LEN=0
|
|
||||||
|
|
||||||
declare LIB_NAME="Base"
|
|
||||||
declare LIB_VERSION="1.2.0"
|
|
||||||
|
|
||||||
declare -g NAME=""
|
declare -g NAME=""
|
||||||
declare -g VERSION=""
|
declare -g VERSION=""
|
||||||
|
|
||||||
@@ -72,6 +63,33 @@ declare -g LOG_TRACE="DISABLED"
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
# Version Print
|
||||||
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
version_print()
|
||||||
|
{
|
||||||
|
# echo "${VERSION}" | sed -e 's/.*: //' -e 's/-/ /' -e 's/_/\./g' -e 's/\$$//'
|
||||||
|
echo "${NAME} V${VERSION}"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
# Help Print
|
||||||
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
help_print()
|
||||||
|
{
|
||||||
|
echo "${NAME} ${HELP}"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
# Str Quote
|
# Str Quote
|
||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
@@ -107,8 +125,8 @@ str_escape()
|
|||||||
|
|
||||||
echo_line()
|
echo_line()
|
||||||
{
|
{
|
||||||
local string="${1}"
|
local string="$1"
|
||||||
local count="${2:-""}"
|
local count="$2"
|
||||||
|
|
||||||
|
|
||||||
echo -en "\e[2K\r"
|
echo -en "\e[2K\r"
|
||||||
@@ -143,16 +161,6 @@ echo_error()
|
|||||||
|
|
||||||
cmd_exec()
|
cmd_exec()
|
||||||
{
|
{
|
||||||
local force="FALSE"
|
|
||||||
|
|
||||||
|
|
||||||
if [[ "$1" == "FORCE" ]]
|
|
||||||
then
|
|
||||||
force="TRUE"
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [[ "${VERBOSE}" == "TRUE" ]]
|
if [[ "${VERBOSE}" == "TRUE" ]]
|
||||||
then
|
then
|
||||||
local caller="${FUNCNAME[1]:-MAIN}"
|
local caller="${FUNCNAME[1]:-MAIN}"
|
||||||
@@ -163,12 +171,12 @@ cmd_exec()
|
|||||||
echo >&2
|
echo >&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ( "${force}" != "TRUE" ) && ( "${DUMP}" == "TRUE" ) ]]
|
if [[ ${DUMP} == "TRUE" ]]
|
||||||
then
|
then
|
||||||
printf '%q ' "$@"
|
printf '%q ' "$@"
|
||||||
echo
|
echo
|
||||||
else
|
else
|
||||||
if [[ ( "${force}" == "TRUE" ) || ( "${DRY_RUN}" != "TRUE" ) ]]
|
if [[ "${DRY_RUN}" != "TRUE" ]]
|
||||||
then
|
then
|
||||||
"$@"
|
"$@"
|
||||||
fi
|
fi
|
||||||
@@ -185,19 +193,9 @@ cmd_exec()
|
|||||||
|
|
||||||
sh_exec()
|
sh_exec()
|
||||||
{
|
{
|
||||||
local force="FALSE"
|
|
||||||
|
|
||||||
|
|
||||||
if [[ "$1" == "FORCE" ]]
|
|
||||||
then
|
|
||||||
force="TRUE"
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
if [[ "$#" -ne 1 ]] || [[ -z "$1" ]]
|
if [[ "$#" -ne 1 ]] || [[ -z "$1" ]]
|
||||||
then
|
then
|
||||||
echo_error "sh_exec expects exactly 1 non empty argument after FORCE optional flag"
|
echo_error "sh_exec expects exactly 1 non empty argument"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -210,11 +208,11 @@ sh_exec()
|
|||||||
printf 'bash -c %q\n' "${NAME}" "${caller}" "$1" >&2
|
printf 'bash -c %q\n' "${NAME}" "${caller}" "$1" >&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ( "${force}" != "TRUE" ) && ( "${DUMP}" == "TRUE" ) ]]
|
if [[ ${DUMP} == "TRUE" ]]
|
||||||
then
|
then
|
||||||
printf 'bash -c %q\n' "${NAME}" "${caller}" "$1"
|
printf 'bash -c %q\n' "${NAME}" "${caller}" "$1"
|
||||||
else
|
else
|
||||||
if [[ ( "${force}" == "TRUE" ) || ( "${DRY_RUN}" != "TRUE" ) ]]
|
if [[ "${DRY_RUN}" != "TRUE" ]]
|
||||||
then
|
then
|
||||||
bash -o errexit -o pipefail -o nounset -O extglob -c -- "$1" bash
|
bash -o errexit -o pipefail -o nounset -O extglob -c -- "$1" bash
|
||||||
fi
|
fi
|
||||||
@@ -225,30 +223,6 @@ sh_exec()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
# Print
|
|
||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
print()
|
|
||||||
{
|
|
||||||
local inline="${1}"
|
|
||||||
shift
|
|
||||||
|
|
||||||
|
|
||||||
if [[ "${inline}" == "TRUE" ]]
|
|
||||||
then
|
|
||||||
str="%s"'\\n'
|
|
||||||
else
|
|
||||||
str="%s"'\n'
|
|
||||||
fi
|
|
||||||
|
|
||||||
cmd_exec printf "${str}" "$*"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#--------------------------------------------------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------------------------------------------------
|
||||||
# Tab Assign
|
# Tab Assign
|
||||||
#--------------------------------------------------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------------------------------------------------
|
||||||
@@ -256,8 +230,8 @@ print()
|
|||||||
tab_assign()
|
tab_assign()
|
||||||
{
|
{
|
||||||
declare -n ta_tab=$1
|
declare -n ta_tab=$1
|
||||||
local ta_key=$2
|
ta_key=$2
|
||||||
local ta_value=$3
|
ta_value=$3
|
||||||
|
|
||||||
|
|
||||||
if [[ "${ta_value}" == "-" ]]
|
if [[ "${ta_value}" == "-" ]]
|
||||||
@@ -279,8 +253,8 @@ tab_assign()
|
|||||||
var_assign()
|
var_assign()
|
||||||
{
|
{
|
||||||
declare -n va_var=$1
|
declare -n va_var=$1
|
||||||
local va_value=$2
|
va_value=$2
|
||||||
local va_mode=$3
|
va_mode=$3
|
||||||
|
|
||||||
|
|
||||||
if [[ "${va_value}" == "-" ]]
|
if [[ "${va_value}" == "-" ]]
|
||||||
@@ -300,171 +274,6 @@ var_assign()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#--------------------------------------------------------------------------------------------------------------------------
|
|
||||||
# VSL Add
|
|
||||||
#--------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
vsl_add()
|
|
||||||
{
|
|
||||||
local name
|
|
||||||
local version
|
|
||||||
local file
|
|
||||||
|
|
||||||
|
|
||||||
if [[ "${BASH_SOURCE[1]}" == "$0" ]]
|
|
||||||
then
|
|
||||||
name="${NAME}"
|
|
||||||
version="${VERSION}"
|
|
||||||
file="${0}"
|
|
||||||
else
|
|
||||||
name="${LIB_NAME}"
|
|
||||||
version="${LIB_VERSION}"
|
|
||||||
file="${BASH_SOURCE[1]}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
var_assign LIB_VSL_ID_LIST "${LIB_VSL_ID_NB}" INC
|
|
||||||
|
|
||||||
tab_assign LIB_VSL_TAB "${LIB_VSL_ID_NB},Name" "${name}"
|
|
||||||
tab_assign LIB_VSL_TAB "${LIB_VSL_ID_NB},Version" "${version}"
|
|
||||||
tab_assign LIB_VSL_TAB "${LIB_VSL_ID_NB},File" "${file}"
|
|
||||||
|
|
||||||
if [[ "${#name}" -gt "${LIB_VSL_NAME_LEN}" ]]
|
|
||||||
then
|
|
||||||
LIB_VSL_NAME_LEN="${#name}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${#version}" -gt "${LIB_VSL_VERSION_LEN}" ]]
|
|
||||||
then
|
|
||||||
LIB_VSL_VERSION_LEN="${#version}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
LIB_VSL_ID_NB=$(( ${LIB_VSL_ID_NB} + 1))
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
# VSL HTML Dump
|
|
||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
vsl_html_dump()
|
|
||||||
{
|
|
||||||
local reverse="$1"
|
|
||||||
local inline="$2"
|
|
||||||
|
|
||||||
local i=1
|
|
||||||
local j=1
|
|
||||||
local vsl_id
|
|
||||||
local vsl_id_list
|
|
||||||
local name
|
|
||||||
local version
|
|
||||||
local file
|
|
||||||
|
|
||||||
|
|
||||||
if [[ "${reverse}" == "TRUE" ]]
|
|
||||||
then
|
|
||||||
vsl_id_list="$( echo "${LIB_VSL_ID_LIST}" | tr ' ' '\n' | tac)"
|
|
||||||
else
|
|
||||||
vsl_id_list="$( echo "${LIB_VSL_ID_LIST}" | tr ' ' '\n')"
|
|
||||||
fi
|
|
||||||
|
|
||||||
for vsl_id in ${vsl_id_list}
|
|
||||||
do
|
|
||||||
name=${LIB_VSL_TAB["${vsl_id},Name"]}
|
|
||||||
version=${LIB_VSL_TAB["${vsl_id},Version"]}
|
|
||||||
file=${LIB_VSL_TAB["${vsl_id},File"]}
|
|
||||||
|
|
||||||
if [[ $(( $i % 2)) -eq 0 ]]
|
|
||||||
then
|
|
||||||
print "${inline}" ' <tr class="shade">'
|
|
||||||
else
|
|
||||||
print "${inline}" " <tr>"
|
|
||||||
fi
|
|
||||||
|
|
||||||
print "${inline}" " <th>${i}</th><td>${name}</td><td>${version}</td>"
|
|
||||||
|
|
||||||
if [[ "${VERBOSE}" == "TRUE" ]]
|
|
||||||
then
|
|
||||||
print "${inline}" "<td>${file}</td>"
|
|
||||||
fi
|
|
||||||
|
|
||||||
print "${inline}" " </tr>"
|
|
||||||
i=$(( $i + 1))
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
# Version Print
|
|
||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
version_print()
|
|
||||||
{
|
|
||||||
local full="${1-TRUE}"
|
|
||||||
|
|
||||||
local name_len
|
|
||||||
local version_len
|
|
||||||
local vsl_id_list
|
|
||||||
local vsl_id
|
|
||||||
local name
|
|
||||||
local version
|
|
||||||
local file
|
|
||||||
|
|
||||||
|
|
||||||
if [[ "${full}" == "TRUE" ]]
|
|
||||||
then
|
|
||||||
vsl_id_list="$( echo "${LIB_VSL_ID_LIST}" | tr ' ' '\n' | tac)"
|
|
||||||
name_len="${LIB_VSL_NAME_LEN}"
|
|
||||||
version_len="${LIB_VSL_VERSION_LEN}"
|
|
||||||
else
|
|
||||||
vsl_id_list="$(( ${LIB_VSL_ID_NB} - 1))"
|
|
||||||
name_len="${#LIB_VSL_TAB["${vsl_id_list},Name"]}"
|
|
||||||
version_len="${#LIB_VSL_TAB["${vsl_id_list},Version"]}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
name_len=$(( ${name_len} + 1 ))
|
|
||||||
version_len=$(( ${version_len} + 1 ))
|
|
||||||
|
|
||||||
for vsl_id in ${vsl_id_list}
|
|
||||||
do
|
|
||||||
name=${LIB_VSL_TAB["${vsl_id},Name"]}
|
|
||||||
version=${LIB_VSL_TAB["${vsl_id},Version"]}
|
|
||||||
file=${LIB_VSL_TAB["${vsl_id},File"]}
|
|
||||||
|
|
||||||
str="$(printf "%s%*sV %s" "${name}" "$((${name_len} - ${#name}))" " " "${version}")"
|
|
||||||
|
|
||||||
if [[ "${VERBOSE}" == "TRUE" ]]
|
|
||||||
then
|
|
||||||
str+="$(printf "%*s%s" "$((${version_len} - ${#version}))" " " "${file}")"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "${str}"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
# Help Print
|
|
||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
help_print()
|
|
||||||
{
|
|
||||||
version_print ""
|
|
||||||
echo "${NAME} ${HELP}"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#--------------------------------------------------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------------------------------------------------
|
||||||
# File Dir Init
|
# File Dir Init
|
||||||
#--------------------------------------------------------------------------------------------------------------------------
|
#--------------------------------------------------------------------------------------------------------------------------
|
||||||
@@ -681,13 +490,3 @@ log_error()
|
|||||||
{
|
{
|
||||||
log_print "${LOG_FILE}" "${LOG_LOCK}" "${LOG_ECHO}" "ERR" "$@"
|
log_print "${LOG_FILE}" "${LOG_LOCK}" "${LOG_ECHO}" "ERR" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#--------------------------------------------------------------------------------------------------------------------------
|
|
||||||
# Main
|
|
||||||
#--------------------------------------------------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
vsl_add
|
|
||||||
|
|||||||
39
sbin/isl
39
sbin/isl
@@ -39,7 +39,7 @@
|
|||||||
# Global Variables
|
# Global Variables
|
||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
declare -g VERSION="1.2.0"
|
declare -g VERSION="1.1.1"
|
||||||
declare -g NAME="ISL"
|
declare -g NAME="ISL"
|
||||||
declare -g HELP="usage: isl [-a | --add <URL>] | [-c | --cat [-r | --reverse]] | [-H | --html_dump [-i | --inline] [-r | --reverse]] | [-t | --top [-m | --image]] | [[-h | --help] | [-V | --version] [-T | --test] [-v | --verbose]"
|
declare -g HELP="usage: isl [-a | --add <URL>] | [-c | --cat [-r | --reverse]] | [-H | --html_dump [-i | --inline] [-r | --reverse]] | [-t | --top [-m | --image]] | [[-h | --help] | [-V | --version] [-T | --test] [-v | --verbose]"
|
||||||
|
|
||||||
@@ -149,6 +149,7 @@ isl_version_print()
|
|||||||
|
|
||||||
isl_help_print()
|
isl_help_print()
|
||||||
{
|
{
|
||||||
|
version_print
|
||||||
help_print
|
help_print
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,6 +157,30 @@ isl_help_print()
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
# ISL Print
|
||||||
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
isl_print()
|
||||||
|
{
|
||||||
|
local inline="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
|
||||||
|
if [[ "${inline}" == "TRUE" ]]
|
||||||
|
then
|
||||||
|
str="%s"'\\n'
|
||||||
|
else
|
||||||
|
str="%s"'\n'
|
||||||
|
fi
|
||||||
|
|
||||||
|
cmd_exec printf "${str}" "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
# ISL Add
|
# ISL Add
|
||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
@@ -248,9 +273,9 @@ isl_html_dump()
|
|||||||
|
|
||||||
if [[ $(( $i % 2)) -eq 0 ]]
|
if [[ $(( $i % 2)) -eq 0 ]]
|
||||||
then
|
then
|
||||||
print "${inline}" ' <tr class="shade">'
|
isl_print "${inline}" ' <tr class="shade">'
|
||||||
else
|
else
|
||||||
print "${inline}" " <tr>"
|
isl_print "${inline}" " <tr>"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
j=1
|
j=1
|
||||||
@@ -258,15 +283,15 @@ isl_html_dump()
|
|||||||
do
|
do
|
||||||
if [[ "$j" == "1" ]]
|
if [[ "$j" == "1" ]]
|
||||||
then
|
then
|
||||||
print "${inline}" " <th>${!j}</th>"
|
isl_print "${inline}" " <th>${!j}</th>"
|
||||||
else
|
else
|
||||||
print "${inline}" " <td>${!j}</td>"
|
isl_print "${inline}" " <td>${!j}</td>"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
j=$(( $j + 1))
|
j=$(( $j + 1))
|
||||||
done
|
done
|
||||||
|
|
||||||
print "${inline}" " </tr>"
|
isl_print "${inline}" " </tr>"
|
||||||
i=$(( $i + 1))
|
i=$(( $i + 1))
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
@@ -310,8 +335,6 @@ isl_top()
|
|||||||
# Main
|
# Main
|
||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
vsl_add
|
|
||||||
|
|
||||||
orig_args=("$@")
|
orig_args=("$@")
|
||||||
|
|
||||||
isl_args_parse "$@"
|
isl_args_parse "$@"
|
||||||
|
|||||||
@@ -39,8 +39,8 @@
|
|||||||
# Global Variables
|
# Global Variables
|
||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
declare -g VERSION="1.2.0"
|
declare -g VERSION="1.0.2"
|
||||||
declare -g NAME="URPMI-Setup"
|
declare -g NAME="URPMI Setup"
|
||||||
declare -g HELP="usage: urpmi-setup [ [-d | --distrib <Distrib>] [-m | --mirror-mga <Mirror_List>] [-r | --mirror-rx3 <Mirror_List>] ] | [-h | --help] | [-V | --version] [ [ -D | --dump] | [-T | --test] ] [-u | --update] [-v | --verbose] ) ]"
|
declare -g HELP="usage: urpmi-setup [ [-d | --distrib <Distrib>] [-m | --mirror-mga <Mirror_List>] [-r | --mirror-rx3 <Mirror_List>] ] | [-h | --help] | [-V | --version] [ [ -D | --dump] | [-T | --test] ] [-u | --update] [-v | --verbose] ) ]"
|
||||||
|
|
||||||
declare -g DISTRIB_DEF="9"
|
declare -g DISTRIB_DEF="9"
|
||||||
@@ -153,6 +153,7 @@ us_version_print()
|
|||||||
|
|
||||||
us_help_print()
|
us_help_print()
|
||||||
{
|
{
|
||||||
|
version_print
|
||||||
help_print
|
help_print
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -164,14 +165,13 @@ us_help_print()
|
|||||||
# Main
|
# Main
|
||||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
vsl_add
|
|
||||||
|
|
||||||
orig_args=("$@")
|
orig_args=("$@")
|
||||||
|
|
||||||
us_args_parse "$@"
|
us_args_parse "$@"
|
||||||
|
|
||||||
|
|
||||||
case "${MODE}" in
|
case "${MODE}" in
|
||||||
|
|
||||||
"EXIT")
|
"EXIT")
|
||||||
exit ${EXIT_CODE}
|
exit ${EXIT_CODE}
|
||||||
;;
|
;;
|
||||||
@@ -188,6 +188,7 @@ case "${MODE}" in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo_error "${NAME}: Mode: [${MODE}] Verbose: [${VERBOSE}] Dump: [${DUMP}] Dry_Run: [${DRY_RUN}] Distrib: [${DISTRIB}] MirrorList_MGA: [${MIRRORLIST_MGA}] MirrorList_RX3: [${MIRRORLIST_RX3}] Update: [${UPDATE}]"
|
echo_error "${NAME}: Mode: [${MODE}] Verbose: [${VERBOSE}] Dump: [${DUMP}] Dry_Run: [${DRY_RUN}] Distrib: [${DISTRIB}] MirrorList_MGA: [${MIRRORLIST_MGA}] MirrorList_RX3: [${MIRRORLIST_RX3}] Update: [${UPDATE}]"
|
||||||
|
|
||||||
cmd_exec urpmi.removemedia -a
|
cmd_exec urpmi.removemedia -a
|
||||||
|
|||||||
Reference in New Issue
Block a user