Skip to content

Commit

Permalink
Changes YUM by DNF
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Carlos Rodríguez del Pino committed Dec 19, 2023
1 parent edff0b9 commit 0febf83
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 26 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ dist_pkgdata_DATA = launchers/vncaccel.sh \
launchers/vpl_terminal_launcher.sh \
launchers/vpl_vnc_launcher.sh launchers/vpl_batch_launcher.sh \
launchers/vpl_web_launcher.sh launchers/vpl_vnc_stopper.sh \
packages_files/minimum.yum.lst packages_files/basic.yum.lst \
packages_files/standard.yum.lst packages_files/full.yum.lst \
packages_files/minimum.dnf.lst packages_files/basic.dnf.lst \
packages_files/standard.dnf.lst packages_files/full.dnf.lst \
packages_files/minimum.apt.lst packages_files/basic.apt.lst \
packages_files/standard.apt.lst packages_files/full.apt.lst \
packages_files/minimum.apk.lst packages_files/basic.apk.lst \
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SUBDIRS=src
dist_pkgdata_DATA = launchers/vncaccel.sh launchers/vpl_terminal_launcher.sh launchers/vpl_vnc_launcher.sh
dist_pkgdata_DATA += launchers/vpl_batch_launcher.sh launchers/vpl_web_launcher.sh launchers/vpl_vnc_stopper.sh
dist_pkgdata_DATA += packages_files/minimum.yum.lst packages_files/basic.yum.lst packages_files/standard.yum.lst packages_files/full.yum.lst
dist_pkgdata_DATA += packages_files/minimum.dnf.lst packages_files/basic.dnf.lst packages_files/standard.dnf.lst packages_files/full.dnf.lst
dist_pkgdata_DATA += packages_files/minimum.apt.lst packages_files/basic.apt.lst packages_files/standard.apt.lst packages_files/full.apt.lst
dist_pkgdata_DATA += packages_files/minimum.apk.lst packages_files/basic.apk.lst packages_files/standard.apk.lst packages_files/full.apk.lst
dist_pkgdata_DATA += vpl-jail-system.service vpl-jail-system.initd vpl-jail-system.conf
Expand Down
4 changes: 2 additions & 2 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ dist_pkgdata_DATA = launchers/vncaccel.sh \
launchers/vpl_terminal_launcher.sh \
launchers/vpl_vnc_launcher.sh launchers/vpl_batch_launcher.sh \
launchers/vpl_web_launcher.sh launchers/vpl_vnc_stopper.sh \
packages_files/minimum.yum.lst packages_files/basic.yum.lst \
packages_files/standard.yum.lst packages_files/full.yum.lst \
packages_files/minimum.dnf.lst packages_files/basic.dnf.lst \
packages_files/standard.dnf.lst packages_files/full.dnf.lst \
packages_files/minimum.apt.lst packages_files/basic.apt.lst \
packages_files/standard.apt.lst packages_files/full.apt.lst \
packages_files/minimum.apk.lst packages_files/basic.apk.lst \
Expand Down
6 changes: 3 additions & 3 deletions install-bash-sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ LOGFILE=/var/log/vpl_installation.log
touch $LOGFILE &> /dev/null
chmod 600 $LOGFILE

# Install bash after detecting package manager (YUM/APT/APK)
if [ "$(command -v yum)" != "" ] ; then
yum -y install bash >> "$LOGFILE"
# Install bash after detecting package manager (DNF/APT/APK)
if [ "$(command -v dnf)" != "" ] ; then
dnf -y install bash >> "$LOGFILE"
elif [ "$(command -v apt)" != "" ] ; then
apt-get -q -y install bash >> "$LOGFILE"
elif [ "$(command -v apk)" != "" ] ; then
Expand Down
27 changes: 12 additions & 15 deletions install-vpl-sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ VPL_CONFIG_DIR=/etc/vpl
} &> /dev/null

function vpl_detect_package_manager() {
# Detect package manager (YUM/APT)
if [ "$(command -v yum)" != "" ] ; then
echo "Using YUM package manager"
yum -y -q check-update
yum -y -q upgrade
# Detect package manager (DNF/APT/APK)
if [ "$(command -v dnf)" != "" ] ; then
echo "Using DNF package manager"
dnf -y -q check-update
dnf -y -q upgrade
function vpl_install_base {
yum -y install $1 >> "$LOGFILE"
dnf -y install $1 >> "$LOGFILE"
return $?
}
function vpl_install_check {
yum list $1 &> /dev/null
dnf list $1 &> /dev/null
return $?
}
PMTYPE="yum"
PMTYPE="dnf"
elif [ "$(command -v apt-get)" != "" ] ; then
echo "Using APT package manager"
echo "Updating distribution software DB"
Expand Down Expand Up @@ -79,7 +79,7 @@ function vpl_detect_package_manager() {
PMTYPE="apk"
else
echo "Sorry, I can't detect the package manager of the system"
echo "Acepted package managers APT an YUM."
echo "Acepted package managers APT, DNF, or APK."
exit 1
fi
}
Expand Down Expand Up @@ -479,10 +479,10 @@ function vpl_install_update_extra_files() {
else
cp vpl-jail-system.conf $VPL_CONFIGFILE
echo "Default configuration file installed"
if [ "$PMTYPE" = "yum" ] ; then
if [ "$PMTYPE" = "dnf" ] ; then
echo "" >> $VPL_CONFIGFILE
echo "ENVPATH=/usr/bin:/bin" >> $VPL_CONFIGFILE
echo "Configuration file changed for CentOS. Added ENVPATH"
echo "Configuration file changed. Added ENVPATH"
fi
fi
chmod 600 $VPL_CONFIGFILE
Expand Down Expand Up @@ -539,10 +539,7 @@ function vpl_install_basic() {
echo "Basic aditional packages"
local PACKAGE_LIST_FILE="packages_files/basic.$PMTYPE.lst"
[ -s $PACKAGE_LIST_FILE ] && vpl_install_packages_file $PACKAGE_LIST_FILE
if [ "$PMTYPE" = "yum" ] ; then
echo "IMPORTANT: Please, set properly the ENVPATH in the config file /etc/vpl/vpl-jail-system.conf"
echo " e.g. \"ENVPATH=/usr/bin:/bin:/usr/sbin\" and restart the service"
elif [ "$PMTYPE" = "apt" ] ; then
if [ "$PMTYPE" = "apt" ] ; then
if [ "$(command -v update-alternatives)" != "" -a "$LISTPACKAGES" == "" ] ; then
update-alternatives --auto java
update-alternatives --auto javac
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Full additional packages for VPL jail system on Linux using YUM (fedora, etc.)
# Full additional packages for VPL jail system on Linux using DNF (fedora, etc.)
"Clisp" clisp
"Clojure" clojure clojure1.6 clojure1.4
"Cobol" gnucobol
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Minimum packages for VPL jail system on Linux using YUM (fedora, etc.)
# Minimum packages for VPL jail system on Linux using DNF (fedora, etc.)
"LSB core" redhat-lsb-core
"make" make
"C compiler" gcc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Standard packages for VPL jail system on Linux using YUM (fedora, etc.)
# Standard packages for VPL jail system on Linux using DNF (fedora, etc.)
"Ada compiler (GNU)" gcc-gnat
"Assembler" nasm
"C# development framework (mono)" mono-complete
Expand Down

0 comments on commit 0febf83

Please sign in to comment.