6 Commits

Author SHA1 Message Date
d1f671c128 - Rx3 Profile:
- Add PATH management.
2026-08-01 18:12:18 +02:00
e53a87d56a - 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.
2026-05-03 11:27:24 +02:00
98b85c14b4 - Move lib dir into top dir & remove usr,
- Add www/cgi-bin dir,
- Add urpmi-setup-dump.cgi and package it as example,
- URPMI-Setup:
    - Fix usage message.
2026-05-02 18:28:41 +02:00
f0ea953c63 - Fix Complete ReleaseNotes file. 2026-04-19 12:10:14 +02:00
d38a486b6e - Mouve lib & sbin out of usr,
- Remove usr dir,
- Add urpmi-setup-dump.cgi.
2026-04-16 19:10:39 +02:00
64dd7a911e - Move sbin dir into usr,
- Fix usage message in urpmi-setup.
2026-04-16 14:16:22 +02:00
6 changed files with 191 additions and 20 deletions

View File

@@ -1,3 +1,26 @@
------------------------------------------------------------------------------------------------------------------------------------
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,
- Add www/cgi-bin dir,
- Add urpmi-setup-dump.cgi and package it as example,
- URPMI-Setup:
- Fix usage message.
------------------------------------------------------------------------------------------------------------------------------------
Rx3-Base V 1.1.1 - A. GIBERT - 2026/04/10
------------------------------------------------------------------------------------------------------------------------------------

View File

@@ -25,7 +25,7 @@
%define name rx3-base
%define version 1.1.1
%define version 1.1.3
%define release %mkrel 1rx3
@@ -36,11 +36,12 @@
# Package
#-----------------------------------------------------------------------------------------------------------------------------------
Summary: Rx3 Base Package
Name: %{name}
Version: %{version}
Release: %{release}
Summary: Rx3 Base Meta Package
License: GPL 3.0
URL: https://git.rx3.org/gitea/rx3/%{name}
Group: System
@@ -51,6 +52,10 @@ Packager: Arnaud G. GIBERT <arnaud@rx3.net>
BuildArch: noarch
Requires: %{name}-config
Requires: %{name}-libs
Requires: %{name}-tools
Source0: https://git.rx3.org/gitea/rx3/%{name}/archive/%{name}-%{version}.tar.gz
@@ -59,7 +64,34 @@ Source0: https://git.rx3.org/gitea/rx3/%{name}/ar
This is the base component of an Rx3 system:
- Default config files,
- Base bash libraries,
- Default tools.
- Base 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.
@@ -99,7 +131,7 @@ cp etc/bash_completion.d/* %{buildroot}%{_sysconfdir}/bash_completi
# Libs
%{__mkdir_p} %{buildroot}%{_prefix}/lib/rx3
cp usr/lib/rx3/*.bash %{buildroot}%{_prefix}/lib/rx3
cp lib/rx3/*.bash %{buildroot}%{_prefix}/lib/rx3
# Bin
%{__mkdir_p} %{buildroot}%{_sbindir}
@@ -114,12 +146,27 @@ cp sbin/* %{buildroot}%{_sbindir}
#-----------------------------------------------------------------------------------------------------------------------------------
%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/*
%{_sysconfdir}/bash_completion.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
%license COPYING COPYING.LESSER GNU_GPL-3.0.txt GNU_LGPL-3.0.txt GNU_FDL-1.3.txt
%defattr(644,root,root)
%{_sysconfdir}/bash_completion.d/*
%attr(0755,root,root) %{_sbindir}/*
@@ -131,6 +178,15 @@ cp sbin/* %{buildroot}%{_sbindir}
#-----------------------------------------------------------------------------------------------------------------------------------
%changelog
* 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
- Add cgi-bin example as doc
* Fri Apr 10 2026 Arnaud G. GIBERT <arnaud@rx3.net> - 1.1.1-1rx3.mga9
- Update to 1.1.1

View File

@@ -27,6 +27,17 @@
# 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 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

View File

@@ -125,8 +125,8 @@ str_escape()
echo_line()
{
local string="$1"
local count="$2"
local string="${1}"
local count="${2:-""}"
echo -en "\e[2K\r"
@@ -161,6 +161,16 @@ echo_error()
cmd_exec()
{
local force="FALSE"
if [[ "$1" == "FORCE" ]]
then
force="TRUE"
shift
fi
if [[ "${VERBOSE}" == "TRUE" ]]
then
local caller="${FUNCNAME[1]:-MAIN}"
@@ -171,12 +181,12 @@ cmd_exec()
echo >&2
fi
if [[ ${DUMP} == "TRUE" ]]
if [[ ( "${force}" != "TRUE" ) && ( "${DUMP}" == "TRUE" ) ]]
then
printf '%q ' "$@"
echo
else
if [[ "${DRY_RUN}" != "TRUE" ]]
if [[ ( "${force}" == "TRUE" ) || ( "${DRY_RUN}" != "TRUE" ) ]]
then
"$@"
fi
@@ -193,9 +203,19 @@ cmd_exec()
sh_exec()
{
local force="FALSE"
if [[ "$1" == "FORCE" ]]
then
force="TRUE"
shift
fi
if [[ "$#" -ne 1 ]] || [[ -z "$1" ]]
then
echo_error "sh_exec expects exactly 1 non empty argument"
echo_error "sh_exec expects exactly 1 non empty argument after FORCE optional flag"
return 1
fi
@@ -208,11 +228,11 @@ sh_exec()
printf 'bash -c %q\n' "${NAME}" "${caller}" "$1" >&2
fi
if [[ ${DUMP} == "TRUE" ]]
if [[ ( "${force}" != "TRUE" ) && ( "${DUMP}" == "TRUE" ) ]]
then
printf 'bash -c %q\n' "${NAME}" "${caller}" "$1"
else
if [[ "${DRY_RUN}" != "TRUE" ]]
if [[ ( "${force}" == "TRUE" ) || ( "${DRY_RUN}" != "TRUE" ) ]]
then
bash -o errexit -o pipefail -o nounset -O extglob -c -- "$1" bash
fi
@@ -230,8 +250,8 @@ sh_exec()
tab_assign()
{
declare -n ta_tab=$1
ta_key=$2
ta_value=$3
local ta_key=$2
local ta_value=$3
if [[ "${ta_value}" == "-" ]]
@@ -253,8 +273,8 @@ tab_assign()
var_assign()
{
declare -n va_var=$1
va_value=$2
va_mode=$3
local va_value=$2
local va_mode=$3
if [[ "${va_value}" == "-" ]]

View File

@@ -39,9 +39,9 @@
# Global Variables
#-----------------------------------------------------------------------------------------------------------------------------------
declare -g VERSION="1.0.1"
declare -g VERSION="1.0.2"
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"

View File

@@ -0,0 +1,61 @@
#!/bin/bash
#-----------------------------------------------------------------------------------------------------------------------------------
#
# URPMI Setup CGI
#
# Copyright (C) 2026 Arnaud G. GIBERT
# mailto:arnaud@rx3.net
#
# This is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; If not, see
# <https://www.gnu.org/licenses/>.
#
#-----------------------------------------------------------------------------------------------------------------------------------
#-----------------------------------------------------------------------------------------------------------------------------------
# Includes
#-----------------------------------------------------------------------------------------------------------------------------------
: "${RX3_LIB_DIR:=/usr/lib/rx3}"
. "${RX3_LIB_DIR}/docker_tools.bash"
#-----------------------------------------------------------------------------------------------------------------------------------
# Main
#-----------------------------------------------------------------------------------------------------------------------------------
echo "Content-type: text/plain"
echo ""
if [[ -n "${QUERY_STRING}" ]]
then
if [[ "$QUERY_STRING" =~ ^[a-z0-9]+$ ]]
then
DISTRIB_OPT="-d ${QUERY_STRING}"
else
echo "Error: Invalid characters in query string."
exit 1
fi
else
DISTRIB_OPT=""
fi
urpmi-setup -v -D ${DISTRIB_OPT}