webbuild-cgi: fixes for rpm manager install/upgrade from repositories
This commit is contained in:
parent
a6b14a1aa9
commit
aca1323856
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# webbuild cgi script
|
# webbuild cgi script
|
||||||
# Copyright (c) 2012-2014 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
# Copyright (c) 2012-2015 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||||
#
|
#
|
||||||
. /usr/share/autodist/webbuild-functions
|
. /usr/share/autodist/webbuild-functions
|
||||||
. /usr/share/autodist/webbuild-functions-private
|
. /usr/share/autodist/webbuild-functions-private
|
||||||
@ -579,6 +579,7 @@ if [ "$REQUEST" = "rpmmanager" ]; then
|
|||||||
echo -n "<input type=button value=\"install\" onclick="
|
echo -n "<input type=button value=\"install\" onclick="
|
||||||
echo -n "p=getCheckedValuesByName('rpmmanagercheckbox');"
|
echo -n "p=getCheckedValuesByName('rpmmanagercheckbox');"
|
||||||
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
|
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
|
||||||
|
echo -n "RPMMANAGERDIR=$RPMMANAGERDIR&"
|
||||||
echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&"
|
echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&"
|
||||||
echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&"
|
echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&"
|
||||||
echo -n "RPMMANAGERFORCE=\"+getElementById('rpmmanagerforce').checked+\"&"
|
echo -n "RPMMANAGERFORCE=\"+getElementById('rpmmanagerforce').checked+\"&"
|
||||||
@ -590,6 +591,7 @@ if [ "$REQUEST" = "rpmmanager" ]; then
|
|||||||
echo -n "<input type=button value=\"upgrade\" onclick="
|
echo -n "<input type=button value=\"upgrade\" onclick="
|
||||||
echo -n "p=getCheckedValuesByName('rpmmanagercheckbox');"
|
echo -n "p=getCheckedValuesByName('rpmmanagercheckbox');"
|
||||||
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
|
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
|
||||||
|
echo -n "RPMMANAGERDIR=$RPMMANAGERDIR&"
|
||||||
echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&"
|
echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&"
|
||||||
echo -n "RPMMANAGERFORCE=\"+getElementById('rpmmanagerforce').checked+\"&"
|
echo -n "RPMMANAGERFORCE=\"+getElementById('rpmmanagerforce').checked+\"&"
|
||||||
echo -n "REQUEST=rpmmanagerupgrade\""
|
echo -n "REQUEST=rpmmanagerupgrade\""
|
||||||
@ -2085,18 +2087,10 @@ $PACKAGE.spec $RPMFORCEADD && $AUTOSPEC_CMD -u $PACKAGE -a10 --server $SENDREPOS
|
|||||||
if [ "$installpackages" ]; then
|
if [ "$installpackages" ]; then
|
||||||
if [ "$REQUEST" = "rpmmanagerinstall" ]; then
|
if [ "$REQUEST" = "rpmmanagerinstall" ]; then
|
||||||
echo "Installing packages: $RPMMANAGERPACKAGES<br>"
|
echo "Installing packages: $RPMMANAGERPACKAGES<br>"
|
||||||
if [ "$rpmmanagermode" = "environment" ]; then
|
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "sudo rpm -i $installpackages $rpmforceadd 2>&1"
|
||||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "sudo rpm -i $installpackages $rpmforceadd"
|
|
||||||
else
|
|
||||||
sudo rpm -i $installpackages $rpmforceadd
|
|
||||||
fi
|
|
||||||
elif [ "$REQUEST" = "rpmmanagerupgrade" ]; then
|
elif [ "$REQUEST" = "rpmmanagerupgrade" ]; then
|
||||||
echo "Upgrading packages: $RPMMANAGERPACKAGES<br>"
|
echo "Upgrading packages: $RPMMANAGERPACKAGES<br>"
|
||||||
if [ "$rpmmanagermode" = "environment" ]; then
|
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "sudo rpm -U $installpackages $rpmforceadd 2>&1"
|
||||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "sudo rpm -U $installpackages $rpmforceadd"
|
|
||||||
else
|
|
||||||
sudo rpm -U $installpackages $rpmforceadd
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
RET=$?
|
RET=$?
|
||||||
else
|
else
|
||||||
|
@ -275,7 +275,6 @@ function download_file() {
|
|||||||
local f
|
local f
|
||||||
|
|
||||||
for f in $download_files; do
|
for f in $download_files; do
|
||||||
echo $f >> /tmp/down
|
|
||||||
echo -e "Content-Type: application/octet-stream"
|
echo -e "Content-Type: application/octet-stream"
|
||||||
echo -e "Content-Disposition: attachment; filename=\"${f/*\/}\"\n"
|
echo -e "Content-Disposition: attachment; filename=\"${f/*\/}\"\n"
|
||||||
if [ "$download_environment" ]; then
|
if [ "$download_environment" ]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user