From d38a486b6ed4536758d339fe8ef143ed78bd243d Mon Sep 17 00:00:00 2001 From: "Arnaud G. GIBERT" Date: Thu, 16 Apr 2026 19:10:39 +0200 Subject: [PATCH] - Mouve lib & sbin out of usr, - Remove usr dir, - Add urpmi-setup-dump.cgi. --- ReleaseNotes.txt | 4 ++- SPECS/rx3-base.spec | 9 ++--- cgi-bin/urpmi-setup-dump.cgi | 61 ++++++++++++++++++++++++++++++++++ {usr/lib => lib}/rx3/base.bash | 0 {usr/sbin => sbin}/isl | 0 {usr/sbin => sbin}/urpmi-setup | 0 6 files changed, 69 insertions(+), 5 deletions(-) create mode 100755 cgi-bin/urpmi-setup-dump.cgi rename {usr/lib => lib}/rx3/base.bash (100%) rename {usr/sbin => sbin}/isl (100%) rename {usr/sbin => sbin}/urpmi-setup (100%) diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 90955c0..db0860a 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -2,7 +2,9 @@ Rx3-Base V 1.1.2 - A. GIBERT - 2026/04/?? ------------------------------------------------------------------------------------------------------------------------------------ -- Move sbin dir into usr, +- Move lib dir into top dir & remove usr, +- Add cgi-bin dir, +- Add urpmi-setup-dump.cgi and package it as example, - URPMI-Setup: - Fix usage message. diff --git a/SPECS/rx3-base.spec b/SPECS/rx3-base.spec index c9c6adf..93d4280 100644 --- a/SPECS/rx3-base.spec +++ b/SPECS/rx3-base.spec @@ -99,11 +99,11 @@ 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} -cp usr/sbin/* %{buildroot}%{_sbindir} +cp sbin/* %{buildroot}%{_sbindir} @@ -114,7 +114,7 @@ cp usr/sbin/* %{buildroot}%{_sbindir} #----------------------------------------------------------------------------------------------------------------------------------- %files -%doc ReadMe.txt ReleaseNotes.txt ToDo.txt +%doc ReadMe.txt ReleaseNotes.txt ToDo.txt 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}/profile.d/* @@ -133,7 +133,8 @@ cp usr/sbin/* %{buildroot}%{_sbindir} %changelog * Thu Apr 16 2026 Arnaud G. GIBERT - 1.1.2-1rx3.mga9 - Update ro 1.1.2, -- Use sbin from usr/sbin +- Move lib source dir +- Add cgi-bin example as doc * Fri Apr 10 2026 Arnaud G. GIBERT - 1.1.1-1rx3.mga9 - Update to 1.1.1 diff --git a/cgi-bin/urpmi-setup-dump.cgi b/cgi-bin/urpmi-setup-dump.cgi new file mode 100755 index 0000000..dd7e643 --- /dev/null +++ b/cgi-bin/urpmi-setup-dump.cgi @@ -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 +# . +# +#----------------------------------------------------------------------------------------------------------------------------------- + + + +#----------------------------------------------------------------------------------------------------------------------------------- +# 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} diff --git a/usr/lib/rx3/base.bash b/lib/rx3/base.bash similarity index 100% rename from usr/lib/rx3/base.bash rename to lib/rx3/base.bash diff --git a/usr/sbin/isl b/sbin/isl similarity index 100% rename from usr/sbin/isl rename to sbin/isl diff --git a/usr/sbin/urpmi-setup b/sbin/urpmi-setup similarity index 100% rename from usr/sbin/urpmi-setup rename to sbin/urpmi-setup