webbuild: sync to current running files with lots of fixes and small changes
This commit is contained in:
parent
10b3f8eff0
commit
a939e6217a
@ -391,7 +391,7 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then
|
||||
else
|
||||
echo "[ <a href=# onclick=ajax_getvalues(\"REQUEST=refreshjobs&JOBSSHOWALL=false\");>Show mine only</a> ]"
|
||||
fi
|
||||
#echo -n "<i>(please click on [x] to clean your build logs when you are done)</i>"
|
||||
echo -n "<i>(please click on [x] to clean your jobs when they are done)</i>"
|
||||
echo -n "<br>"
|
||||
}
|
||||
[ "$STATE_JOBSSHOWALL" = "1" -o "$USER" = "$2" ] || continue
|
||||
@ -451,14 +451,17 @@ fi
|
||||
# repsearch request
|
||||
if [ "$REQUEST" = "repsearch" ]; then
|
||||
echo -n "<output><![CDATA["
|
||||
echo -n "<hr><b>Repository search results for \"$REPSEARCHTEXT\":</b><div align=left class=output id=outputtop>"
|
||||
echo -n "<pre><!-- SCROLL -->"
|
||||
$SUDO_WRAPPER 0 local "$USER" "" "openmamba-repository search -i ${REPSEARCHTEXT/-/\-}" | \
|
||||
parse_search_output ${AUTOPORT_ARCH[$ENVIRONMENT]}
|
||||
echo -n "<hr><b>Search results for \"$REPSEARCHTEXT\":</b><div align=left class=output id=outputtop style=\"font-family:serif;color:black;background-color:#E0F2D0;\">"
|
||||
# echo -n "<pre><!-- SCROLL -->"
|
||||
curl -s "http://test.openmamba.org/cgi-bin/distroquery?query=$REPSEARCHTEXT&search_milestone2=true&search_devel=true\
|
||||
&search_i586=true&search_x86_64=true&search_arm=true&search_sources=true&query_compact=true&replyplain=true"
|
||||
# $SUDO_WRAPPER 0 local "$USER" "" "openmamba-repository search -i ${REPSEARCHTEXT/-/\-}" | \
|
||||
# parse_search_output ${AUTOPORT_ARCH[$ENVIRONMENT]}
|
||||
# sed "s|\(.*(source).*\)|<font color=white><b>\1</b></font>|;
|
||||
# s|\(.*(${AUTOPORT_ARCH[$ENVIRONMENT]}).*\)|<font color=lightgreen>\1</font>|"
|
||||
echo -n "<!-- ENDSCROLL --></pre>"
|
||||
echo "</div>]]></output></webbuild>"
|
||||
# echo -n "<!-- ENDSCROLL --></pre>"
|
||||
echo "</div>"
|
||||
echo "]]></output></webbuild>"
|
||||
exit
|
||||
fi
|
||||
|
||||
@ -491,10 +494,10 @@ fi
|
||||
|
||||
# rpm manager
|
||||
if [ "$REQUEST" = "rpmmanager" ]; then
|
||||
environment_descr=`print_environment_descr $i`
|
||||
environment_descr=`print_environment_descr $ENVIRONMENT`
|
||||
echo -n "<window><![CDATA["
|
||||
echo -n "<div class=windowcontainer><div class=windowopaquebackground></div>"
|
||||
echo -n "<div class=windowbox><div style=\"overflow:auto;width:600px;height:420px\">"
|
||||
echo -n "<div class=windowbox style=\"top:-50px;\"><div style=\"overflow:auto;width:600px;height:420px\">"
|
||||
echo -n "RPM manager for <b>$environment_descr</b> environment<br>"
|
||||
|
||||
# select rpm manager resource directory to display
|
||||
@ -533,7 +536,7 @@ if [ "$REQUEST" = "rpmmanager" ]; then
|
||||
echo -n "<input type=checkbox name=rpmmanagercheckbox value=\"$pkgname\">${pkgname} "
|
||||
echo -n "<a title=\"Click to download file\" href=\"#\" "
|
||||
echo -n "onclick=getDownload(\"ENVIRONMENT=$ENVIRONMENT&REQUEST=rpmmanagerdownload&RPMMANAGERDIR=$RPMMANAGERDIR&"
|
||||
echo -n "&REPOSITORY=$REPOSITORY&RPMMANAGERPACKAGES=\"+encodeURIComponent('$pkgname'));>"
|
||||
echo -n "&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&RPMMANAGERPACKAGES=\"+encodeURIComponent('$pkgname'));>"
|
||||
echo -n "<img src=/images/download.png width=16 height=16></img></a>"
|
||||
echo -n "</label>"
|
||||
done
|
||||
@ -546,7 +549,7 @@ if [ "$REQUEST" = "rpmmanager" ]; then
|
||||
echo -n "<input type=checkbox name=rpmmanagercheckbox value=\"$pkgname\">${pkgname} "
|
||||
echo -n "<a title=\"Click to download file\" href=\"#\" "
|
||||
echo -n "onclick=getDownload(\"ENVIRONMENT=$ENVIRONMENT&REQUEST=rpmmanagerdownload&RPMMANAGERDIR=$RPMMANAGERDIR&"
|
||||
echo -n "&REPOSITORY=$REPOSITORY&RPMMANAGERPACKAGES=\"+encodeURIComponent('$pkgname'));>"
|
||||
echo -n "&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&RPMMANAGERPACKAGES=\"+encodeURIComponent('$pkgname'));>"
|
||||
echo -n "<img src=/images/download.png width=16 height=16></img></a>"
|
||||
echo -n "</label>"
|
||||
done
|
||||
@ -560,7 +563,7 @@ if [ "$REQUEST" = "rpmmanager" ]; then
|
||||
# rpm manager install packages
|
||||
echo -n "<input type=button value=\"install\" onclick="
|
||||
echo -n "p=getCheckedValuesByName('rpmmanagercheckbox');"
|
||||
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&"
|
||||
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
|
||||
echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&"
|
||||
echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&"
|
||||
echo -n "RPMMANAGERFORCE=\"+getElementById('rpmmanagerforce').checked+\"&"
|
||||
@ -571,7 +574,7 @@ if [ "$REQUEST" = "rpmmanager" ]; then
|
||||
# rpm manager upgrade packages
|
||||
echo -n "<input type=button value=\"upgrade\" onclick="
|
||||
echo -n "p=getCheckedValuesByName('rpmmanagercheckbox');"
|
||||
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&"
|
||||
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
|
||||
echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&"
|
||||
echo -n "RPMMANAGERFORCE=\"+getElementById('rpmmanagerforce').checked+\"&"
|
||||
echo -n "REQUEST=rpmmanagerupgrade\""
|
||||
@ -698,7 +701,8 @@ echo -n "]]></environments>"
|
||||
|
||||
if [ "$MAINTAINERMODE" = "true" ]; then
|
||||
echo -n "<specedit> </specedit>"
|
||||
elif [ ! "$REQUEST" -o "$REQUEST" = "changeenvironment" -o "$REQUEST" = "switchmaintainermode" -o "$REQUEST" = "prepare" -o "$REQUEST" = "reloadspec" ]; then
|
||||
elif [ ! "$REQUEST" -o "$REQUEST" = "changeenvironment" -o "$REQUEST" = "switchmaintainermode" \
|
||||
-o "$REQUEST" = "prepare" -o "$REQUEST" = "reloadspec" -o "$REQUEST" = "edit" ]; then
|
||||
# SPECFILES select
|
||||
echo -n "<specedit><![CDATA["
|
||||
echo -n " Edit:<select id=specfile "
|
||||
@ -726,11 +730,13 @@ fi
|
||||
if [ ! "$REPSEARCHTEXT" ]; then
|
||||
echo -n "<searchbox><![CDATA["
|
||||
echo -n "<div class=searchbox>Search repositories:"
|
||||
|
||||
#<input type=button id=repsearchbutton value=\"Search repositories:\" onclick=ajax_getvalues(\""
|
||||
# echo -n "ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
|
||||
# echo -n "REQUEST=repsearch&REPSEARCHTEXT=\"+encodeURIComponent(getElementById('repsearchtext').value));>"
|
||||
|
||||
if [ "$PACKAGE" ]; then
|
||||
echo -n "<input type=text style=\"display:block;width:98%;align:center;padding:0;margin:0;\" id=repsearchtext value=\"${PACKAGE/*\/}-\" "
|
||||
echo -n "<input type=text style=\"display:block;width:98%;align:center;padding:0;margin:0;\" id=repsearchtext value=\"${PACKAGE/*\/}\" "
|
||||
else
|
||||
echo -n "<input type=text style=\"display:block;width:98%;align:center;padding:0;margin:0;\" id=repsearchtext value=\"Enter a package name to search...\" "
|
||||
echo -n "onfocus=\"if (this.value==this.defaultValue) this.value=''\" "
|
||||
@ -895,7 +901,7 @@ if [ "$MAINTAINERMODE" = "true" -o ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then
|
||||
echo -n "MAINTAINERMODE=\"+getElementById('maintain').checked+\"&"
|
||||
fi
|
||||
echo -n "PACKAGE=\"+encodeURIComponent(getSelectedValueById('package'))); $SRPMBUTTONDISABLED>"
|
||||
if [ "${AUTOPORT_CHROOT[$ENVIRONMENT]}" ]; then
|
||||
if [ "${AUTOPORT_PORT[$ENVIRONMENT]}" ]; then
|
||||
echo -n "<input type=button name=port value=\"Port\" id=portbutton onclick="
|
||||
echo -n "ajax_getvalues(\"REQUEST=autoport&REPOSITORY=\"+getSelectedValueById('repository')+\""
|
||||
echo -n "&ENVIRONMENT=$ENVIRONMENT&"
|
||||
@ -952,7 +958,11 @@ if [ "$SPECTEXT" ]; then
|
||||
tmpfile=`mktemp --suffix=.webbuildspectmp`
|
||||
echo -n $SPECTEXT | perl -MURI::Escape -e 'print uri_unescape(<>)' > $tmpfile
|
||||
chmod 644 $tmpfile
|
||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" ${PACKAGE/*\/} "cat $tmpfile > ${PACKAGE/*\/}.spec" $tmpfile
|
||||
if [ "REQUEST" = "renamespec" -a "$RENAMESPECFROM" ]; then
|
||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" ${PACKAGE/*\/} "cat $tmpfile > ${RENAMESPECFROM/*\/}.spec" $tmpfile
|
||||
else
|
||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" ${PACKAGE/*\/} "cat $tmpfile > ${PACKAGE/*\/}.spec" $tmpfile
|
||||
fi
|
||||
RET=$?
|
||||
[ $RET -eq 0 ] || {
|
||||
echo -n "<output><![CDATA[<div class=output>ERROR: could not save file ${PACKAGE/*\/}.spec! Please report the problem, thanks.</div>]]></output></webbuild>"
|
||||
@ -978,24 +988,34 @@ if [ "$REQUEST" = "prepare" -o "$REQUEST" = "updatespec" -o "$REQUEST" = "speccr
|
||||
"prepare") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a1 --server $REPOSITORY"; RET=$? ;;
|
||||
"updatespec") [ "$RPMFORCE" = "true" ] && RPMFORCEADD="--force-update"
|
||||
[ "$DEBUG" = "true" ] && RPMFORCEADD="$RPMFORCEADD --debug"
|
||||
[ "$USER_FULLNAME" -a "$USER_EMAIL" ] && RPMUSERADD="--packager-fullname=\"$USER_FULLNAME\" --packager-email=\"$USER_EMAIL\""
|
||||
if [ "$UPDATESPECVERSION" -a "$REBUILDSPECCHANGELOG" ]; then
|
||||
echo "ERROR: new version and changelog can't be specified together"
|
||||
elif [ "$REBUILDSPECCHANGELOG" ]; then
|
||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a4 $RPMFORCEADD --rebuild --changelog \"$REBUILDSPECCHANGELOG\""
|
||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a4 $RPMFORCEADD --rebuild \
|
||||
--changelog \"$REBUILDSPECCHANGELOG\" $RPMUSERADD"
|
||||
elif [ "$UPDATESPECVERSION" ]; then
|
||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a3,4 $RPMFORCEADD $UPDATESPECVERSION"
|
||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a3,4 $RPMFORCEADD $UPDATESPECVERSION \
|
||||
$RPMUSERADD"
|
||||
else
|
||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a2:4 $RPMFORCEADD $UPDATESPECVERSION"
|
||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a2:4 $RPMFORCEADD $UPDATESPECVERSION \
|
||||
$RPMUSERADD"
|
||||
fi
|
||||
RET=$?
|
||||
;;
|
||||
"speccreate") if [ "$SPECCREATEURL" -a "$PACKAGE" ]; then
|
||||
if [ "${SPECCREATEURL/\/}" = "$SPECCREATEURL" ]; then
|
||||
# local source in /SOURCES
|
||||
SPECCREATEURL="../SOURCES/$SPECCREATEURL"
|
||||
fi
|
||||
AUTOSPEC_CMDLINE="-n $PACKAGE -o $PACKAGE.spec"
|
||||
#DECODEDURL=`cgi_decodevar $SPECCREATEURL`
|
||||
[ "$SPECCREATETYPE" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE -t $SPECCREATETYPE"
|
||||
[ "$SPECCREATEVERSION" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE -v $SPECCREATEVERSION"
|
||||
[ "$SPECCREATEGITBRANCH" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE --git-branch $SPECCREATEGITBRANCH"
|
||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "$AUTOSPEC_CMD -s \"$SPECCREATEURL\" $AUTOSPEC_CMDLINE --changelog \"package created by $USER using the webbuild interface\""
|
||||
[ "$USER_FULLNAME" -a "$USER_EMAIL" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE --packager-fullname=\"$USER_FULLNAME\" --packager-email=\"$USER_EMAIL\""
|
||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "$AUTOSPEC_CMD -s \"$SPECCREATEURL\" $AUTOSPEC_CMDLINE \
|
||||
--changelog \"package created by $USER using the webbuild interface\""
|
||||
RET=$?
|
||||
[ $RET -eq 0 ] && {
|
||||
social_log "SUSER=$USER SEMAIL=$USER_EMAIL STARGET=developers STEXT=\"is working on <b>$PACKAGE</b> new package in <b>`print_environment_descr $ENVIRONMENT`</b> environment\" STIME=`date +%s`"
|
||||
@ -1592,11 +1612,11 @@ case $REQUEST in
|
||||
RET=-1
|
||||
;;
|
||||
"smartupgrade") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "export LANG=C;sudo smart update && sudo smart upgrade"
|
||||
RET=$?
|
||||
;;
|
||||
RET=$?
|
||||
;;
|
||||
"runldconfig") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "/sbin/ldconfig"
|
||||
RET=$?
|
||||
;;
|
||||
RET=$?
|
||||
;;
|
||||
"showpatch") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autodist-tool makepatch $PACKAGE"; RET=$? ;;
|
||||
"removepatch") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "autodist-tool makepatch $PACKAGE remove"
|
||||
RET=$?
|
||||
@ -1683,9 +1703,9 @@ case $REQUEST in
|
||||
[ $RET -eq 0 ] && social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"sent <b>$AUTODISTPKGS $SPECVAR_Version-$SPECVAR_Release</b> from <i>`print_environment_descr $ENVIRONMENT`</i> to <b>$SENDREPOSITORY</b>\" STIME=`date +%s`"
|
||||
;;
|
||||
"autoport") if [ "$AUTOPORTPACKAGE" ]; then
|
||||
$SUDO_WRAPPER background $ENVIRONMENT "$USER" $AUTOPORTPACKAGE "autoport $AUTOPORTPACKAGE -r $REPOSITORY" &>/dev/null
|
||||
$SUDO_WRAPPER background $ENVIRONMENT "$USER" $AUTOPORTPACKAGE "autoport $AUTOPORTPACKAGE -r $REPOSITORY --user $USER" &>/dev/null
|
||||
RET=$?
|
||||
[ $REQ -eq 0 ] && {
|
||||
[ $RET -eq 0 ] && {
|
||||
RET=-1
|
||||
echo "Autoport started. You may see the output in the <b>Webbuild jobs</b> box above."
|
||||
}
|
||||
@ -1768,7 +1788,7 @@ case $REQUEST in
|
||||
[ $RET -eq 0 ] && {
|
||||
echo -n "Patch added to sources with name '<b>$PACKAGE-${SPECVAR_Version}-$ADDPATCHNAME.patch'</b>."
|
||||
for l in 1 0 2 3; do
|
||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cd $SPECVAR_RPMBUILDDIR/$SPECVAR_BUILDDIR && patch --dry-run -s -p1 < $SPECVAR_RPMSOURCESDIR/$PACKAGE-${SPECVAR_Version}-$ADDPATCHNAME.patch >/dev/null"
|
||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cd $SPECVAR_RPMBUILDDIR/$SPECVAR_BUILDDIR && patch --dry-run -s -p$l < $SPECVAR_RPMSOURCESDIR/$PACKAGE-${SPECVAR_Version}-$ADDPATCHNAME.patch >/dev/null"
|
||||
RET=$?
|
||||
[ $RET -eq 0 ] && break
|
||||
done
|
||||
@ -1776,6 +1796,7 @@ case $REQUEST in
|
||||
echo -n "<br><font color=lightgreen>Info: good, patch applies successfully with -p$l option!</font>"
|
||||
echo -n "<br><br><font color=gold>HINT: add the following lines in the appropriate sections:</font><br>"
|
||||
else
|
||||
l=0
|
||||
echo -n "<br><font color=red>Warning: patch does not apply with '-p0' to '-p3' options!</font>"
|
||||
echo "<br><br><font color=gold>HINT: you might want to retry from a clean build dir after pressing the 'unpack' button or check if it applies after changing working subdirectory in build tree.</font>"
|
||||
echo -n "<br><font color=gold>HINT: add anyway the following lines in the appropriate sections and press 'prepare' to see patch command output:</font><br>"
|
||||
@ -1895,7 +1916,7 @@ case $REQUEST in
|
||||
echo "ERROR: changelog was not specified."
|
||||
RET=1
|
||||
else
|
||||
$SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autoport -r $SENDREPOSITORY -d $REPOSITORYIMPORTTO $PACKAGES -u \"$MASSREBUILDCHANGELOG\"" &>/dev/null
|
||||
$SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autoport -r $SENDREPOSITORY -d $REPOSITORYIMPORTTO $PACKAGES -u \"$MASSREBUILDCHANGELOG\" --user $USER" &>/dev/null
|
||||
[ $? -ne 0 ] && RET=$? || {
|
||||
RET=-1
|
||||
echo -n "Mass rebuild started. You may see the output in the <b>Webbuild jobs</b> box above."
|
||||
@ -1917,7 +1938,7 @@ case $REQUEST in
|
||||
fi
|
||||
;;
|
||||
"autoportnp") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="-f" || AUTODISTADD=
|
||||
$SUDO_WRAPPER background $ENVIRONMENT "$USER" $PACKAGE "autoport -np $PACKAGE -r $SENDREPOSITORY $AUTODISTADD" &>/dev/null
|
||||
$SUDO_WRAPPER background $ENVIRONMENT "$USER" $PACKAGE "autoport -np $PACKAGE -r $SENDREPOSITORY $AUTODISTADD --user $USER" &>/dev/null
|
||||
[ $? -ne 0 ] && RET=$? || {
|
||||
RET=-1
|
||||
echo -n "Autoport started. You may see the output in the <b>Webbuild jobs</b> box above."
|
||||
|
@ -230,7 +230,8 @@ function parse_patch_output() {
|
||||
}
|
||||
|
||||
function parse_build_output() {
|
||||
sed "s|\(.\{10000\}\).*|\1 [CUT - LONG LINE]|;s|\\\|\\\\\\\|g;s|<|\<|g;s|[[:cntrl:]]\[[0-9;]*m||g;
|
||||
sed "s|\r.*||;
|
||||
s|\(.\{10000\}\).*|\1 [CUT - LONG LINE]|;s|\\\|\\\\\\\|g;s|<|\<|g;s|[[:cntrl:]]\[[0-9;]*m||g;
|
||||
s|<font|<font|g;
|
||||
s|</font|</font|g;
|
||||
s|^\([\+#] .*\)|<font style=\"color:cyan\">\1</font>|;
|
||||
@ -243,7 +244,8 @@ function parse_build_output() {
|
||||
}
|
||||
|
||||
function parse_generic_output() {
|
||||
sed "s|\(.\{10000\}\).*|\1 [CUT - LONG LINE]|;s|<|\<|g;s|[[:cntrl:]]\[[0-9;]*m||g;
|
||||
sed "s|\r.*||;
|
||||
s|\(.\{10000\}\).*|\1 [CUT - LONG LINE]|;s|<|\<|g;s|[[:cntrl:]]\[[0-9;]*m||g;
|
||||
s|<font|<font|g;
|
||||
s|</font|</font|g;
|
||||
s|^\([\+#] .*\)|<font style=\"color:cyan\">\1</font>|;
|
||||
@ -289,6 +291,15 @@ function print_environment_descr() {
|
||||
# (${AUTOPORT_BASE_REPOSITORY[$i]} based)"
|
||||
}
|
||||
|
||||
function environment_rootdir() {
|
||||
local env=$1
|
||||
if [ "${AUTOPORT_CHROOT[$env]}" ]; then
|
||||
echo "/var/autoport/${AUTOPORT_CHROOT[$env]}"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
function environment_autoport_logdir() {
|
||||
local env=$1
|
||||
if [ "${AUTOPORT_CHROOT[$env]}" ]; then
|
||||
@ -305,11 +316,21 @@ function environment_autoport_logdir() {
|
||||
|
||||
function environment_logdir() {
|
||||
local env=$1
|
||||
local chroot=$2
|
||||
|
||||
if [ "${AUTOPORT_CHROOT[$env]}" ]; then
|
||||
if [ "${AUTOPORT_CHROOT_USER[$env]}" != "autodist" ]; then
|
||||
echo "/var/autoport/${AUTOPORT_CHROOT[$env]}/home/${AUTOPORT_CHROOT_USER[$env]}/.autodist/log/"
|
||||
if [ "$chroot" ]; then
|
||||
echo "/home/${AUTOPORT_CHROOT_USER[$env]}/.autodist/log/"
|
||||
else
|
||||
echo "/var/autoport/${AUTOPORT_CHROOT[$env]}/home/${AUTOPORT_CHROOT_USER[$env]}/.autodist/log/"
|
||||
fi
|
||||
else
|
||||
echo "/var/autoport/${AUTOPORT_CHROOT[$env]}/var/autodist/log/"
|
||||
if [ "$chroot" ]; then
|
||||
echo "/var/autodist/log/"
|
||||
else
|
||||
echo "/var/autoport/${AUTOPORT_CHROOT[$env]}/var/autodist/log/"
|
||||
fi
|
||||
fi
|
||||
elif [ "${AUTOPORT_NATIVE[$env]}" ]; then
|
||||
local envhome=`eval echo ~${AUTOPORT_CHROOT_USER[$env]}`
|
||||
|
@ -31,11 +31,10 @@ function showlog() {
|
||||
LOGFILE3=$LOGFILE/*_${PACKAGE/\//_}__*.${AUTOPORT_ARCH[$ENVIRONMENT]}
|
||||
LOGFILE4=$LOGFILE/*_${PACKAGE/\//_}.${AUTOPORT_ARCH[$ENVIRONMENT]}
|
||||
|
||||
LOGDIR=`environment_logdir $ENVIRONMENT`
|
||||
LOGDIR=`environment_logdir $ENVIRONMENT 1`
|
||||
LOGFILES="$LOGDIR/$LOGFILE1 $LOGDIR/$LOGFILE2 $LOGDIR/$LOGFILE3 $LOGDIR/$LOGFILE4"
|
||||
# sort by most recent and take first
|
||||
LOGFILES=`ls -t $LOGFILES 2>/dev/null | head -1`
|
||||
# LOGFILES=`$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "ls -t $LOGFILES 2>/dev/null | head -1"`
|
||||
LOGFILES=`$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "ls -t $LOGFILES 2>/dev/null | head -1"`
|
||||
fi
|
||||
echo -n "<output><![CDATA[<hr><b>Console output for $PACKAGE ($LOGTYPE$LOGSTATUSAPPEND):</b>"
|
||||
echo "<div align=left class=output id=$LOGOUTPUTID>"
|
||||
@ -161,7 +160,7 @@ function print_editorcontrols() {
|
||||
echo -n "<div style=\"width:100%;overflow:hidden;\"><span style=\"float:left\">"
|
||||
echo -n "<input type=button id=savebutton value=\"save\" onclick="
|
||||
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
|
||||
echo -n "REQUEST=savespec&SPECTEXT=\"+encodeURIComponent(editor.getValue()));"
|
||||
echo -n "REQUEST=savespec&SENDREPOSITORY=$SENDREPOSITORY&SPECTEXT=\"+encodeURIComponent(editor.getValue()));"
|
||||
echo -n "this.disabled=true; disabled=disabled class=redbutton>"
|
||||
# specfile reload
|
||||
echo -n "<input type=button id=updatespecbutton value=\"reload\" onclick="
|
||||
@ -208,7 +207,7 @@ function print_editorcontrols() {
|
||||
}
|
||||
|
||||
function show_docs() {
|
||||
local f RET
|
||||
local f RET ftype
|
||||
|
||||
for f in $@; do
|
||||
echo -n "<a href=#logfile-$f>$f</a><br>"
|
||||
@ -216,6 +215,11 @@ function show_docs() {
|
||||
echo -n "<br>"
|
||||
for f in $@; do
|
||||
echo -n "<a name=logfile-$f><p style=\"background-color:gray\"><b>File $f:</b></a><pre>"
|
||||
ftype="`$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cd $SPECVAR_RPMBUILDDIR/$SPECVAR_BUILDDIR && file $f"`"
|
||||
if [ "${ftype/text}" = "${ftype}" ]; then
|
||||
echo "<p>Binary file; skipping."
|
||||
continue
|
||||
fi
|
||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE \
|
||||
"cd $SPECVAR_RPMBUILDDIR/$SPECVAR_BUILDDIR && head -c 10240 $f | sed \"s|<|\<|g;s|[[:cntrl:]]\[[0-9;]*m||g\"" | parse_generic_output
|
||||
RET=$?
|
||||
|
@ -32,8 +32,10 @@ elif [ "$MODE" = "finishprocess" ]; then
|
||||
exit $RETCODE
|
||||
elif [ "$ENVIRONMENT" = "local" ]; then
|
||||
echo "COMMAND: $COMMAND" >> $WEBBUILD_STATEDIR/commands_log
|
||||
$COMMAND 2>&1 | sed "s|<|\<|g"
|
||||
exit 0
|
||||
$COMMAND 2>&1
|
||||
# | sed "s|<|\<|g"
|
||||
RET=$?
|
||||
exit $RET
|
||||
fi
|
||||
|
||||
if [ "$ENVIRONMENT" = "local" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user