Compare commits
41 Commits
Author | SHA1 | Date | |
---|---|---|---|
64394b8110 | |||
9ad95404ec | |||
ac8340c0d6 | |||
f23570f228 | |||
79af8764e1 | |||
94f1ffcf9a | |||
1c15fcfb25 | |||
5a0fa63a96 | |||
bbcfce5260 | |||
db0354041e | |||
c7d8a76d80 | |||
058a0baa7e | |||
38c75eea33 | |||
4cee459385 | |||
f47b80b1cc | |||
092e90e004 | |||
e53a62198a | |||
68bacbc599 | |||
681b2e5ec7 | |||
a6d6fd03e4 | |||
c3cbf7c0e8 | |||
ced497545e | |||
ee1a94af6f | |||
2c09744bbd | |||
7d21e2fa60 | |||
7e78d60c90 | |||
537b80a4c4 | |||
db8fa88b9b | |||
f93a093134 | |||
a49c4ec447 | |||
1c8a7cbbdf | |||
73f032afda | |||
8b9ee4a7b2 | |||
c3c5a9009e | |||
4fba9537b5 | |||
a191ef0eb3 | |||
5f2e54f58a | |||
90a0d85269 | |||
6e6d92d5a2 | |||
8f2eb49563 | |||
4ee59fdbd2 |
5
Makefile
5
Makefile
@ -11,7 +11,7 @@ sysconfdir = /etc
|
||||
sbindir = ${exec_prefix}/sbin
|
||||
bindir = ${exec_prefix}/bin
|
||||
datadir = ${prefix}/share
|
||||
initrddir = ${sysconfdir}/rc.d/init.d
|
||||
unitdir = /lib/systemd/system
|
||||
libexecdir = ${prefix}/libexec
|
||||
mandir = ${prefix}/usr/share/man
|
||||
sysconfigdir= ${sysconfdir}/sysconfig
|
||||
@ -52,6 +52,7 @@ install-dirs:
|
||||
@$(INSTALL_DIR) $(DESTDIR)$(sbindir)
|
||||
@$(INSTALL_DIR) $(DESTDIR)$(cgidir)
|
||||
@$(INSTALL_DIR) $(DESTDIR)$(htmldir)
|
||||
@$(INSTALL_DIR) $(DESTDIR)$(unitdir)
|
||||
@$(INSTALL_DIR) $(DESTDIR)$(pck_datadir)
|
||||
@$(INSTALL_DIR) $(DESTDIR)$(pck_statedir)
|
||||
@$(INSTALL_DIR) $(DESTDIR)$(pck_statedir)/template/autoupdate/spec-patches-build/old
|
||||
@ -82,6 +83,7 @@ install-programs:
|
||||
@$(INSTALL_SCRIPT) webbuild/webbuild-checkpassword $(DESTDIR)$(libexecdir)/webbuild-checkpassword
|
||||
@$(INSTALL_SCRIPT) webbuild/webbuild-functions $(DESTDIR)$(pck_datadir)/webbuild-functions
|
||||
@$(INSTALL_SCRIPT) webbuild/webbuild-functions-private $(DESTDIR)$(pck_datadir)/webbuild-functions-private
|
||||
@$(INSTALL_SCRIPT) telegram/openmamba_bot.py $(DESTDIR)$(pck_datadir)/openmamba_bot.py
|
||||
@cp -a webbuild/html/* $(DESTDIR)$(htmldir)
|
||||
|
||||
install-data:
|
||||
@ -102,6 +104,7 @@ install-data:
|
||||
@$(INSTALL_DATA) autodist-bashrc $(DESTDIR)$(pck_statedir)/.bashrc
|
||||
@$(INSTALL_DATA) autodist-bash_profile $(DESTDIR)$(pck_statedir)/.bash_profile
|
||||
@$(INSTALL_DATA) autodist-tmpfilesd $(DESTDIR)$(prefix)/lib/tmpfiles.d/autodist.conf
|
||||
@$(INSTALL_DATA) telegram/openmambabot.service $(DESTDIR)$(unitdir)/openmambabot.service
|
||||
@touch $(DESTDIR)$(pck_statedir)/template/autoupdate/auto.success
|
||||
@touch $(DESTDIR)$(pck_statedir)/template/autoupdate/auto.skip
|
||||
|
||||
|
40
autodist
40
autodist
@ -1,18 +1,18 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Autodist -- batch build tool for RPM based distributions
|
||||
# Copyright (C) 2006-2014 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
# Copyright (C) 2006-2016 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
#
|
||||
# Released under the terms of the GNU GPL release 3 license
|
||||
#
|
||||
VERSION=0.9.21
|
||||
me=(${0##*/} $VERSION "Sat Aug 20 2010")
|
||||
VERSION=1.0.3
|
||||
me=(${0##*/} $VERSION "Tue Jan 26 2016")
|
||||
exec 3>`readlink /proc/self/fd/0`
|
||||
|
||||
function usage() {
|
||||
echo "\
|
||||
${me[0]} ${me[1]}
|
||||
"$"Copyright (C) 2006-2014 Silvan Calarco <silvan.calarco@mambasoft.it>""
|
||||
"$"Copyright (C) 2006-2016 Silvan Calarco <silvan.calarco@mambasoft.it>""
|
||||
"$"Released under the terms of the GNU GPL v3 license"
|
||||
echo "
|
||||
"$"Batch build tool for bulding a whole distribution and much more.""
|
||||
@ -40,13 +40,15 @@ ${me[0]} ${me[1]}
|
||||
-v,--verbose "$"Be verbose""
|
||||
--force "$"Pass force parameter to autospec""
|
||||
--repository "$"Pass given repository as base for operations""
|
||||
--repository-strict "$"Only prepare packages from base repository specified with --repository""
|
||||
--server num "$"Pass given server number to autospec for send operation""
|
||||
--severity num "$"Error handling level:
|
||||
0: don't stop (default)
|
||||
1: skip current job on error
|
||||
0: don't stop
|
||||
1: skip current job on error (default)
|
||||
2: abort on error""
|
||||
--arch "$"Build packages for specified target architecture""
|
||||
--user user "$"Pass calling user name for Webbuild social messages""
|
||||
--rebuild-srpms "$"Rebuild SRPMs when sending""
|
||||
|
||||
job "$"Job specification in the form pkg#version, job#version, job/pkg#version, examples:
|
||||
glibc#2.11.1
|
||||
@ -169,6 +171,9 @@ for ((i=1; i<=$#; i++)); do
|
||||
}
|
||||
AUTODIST_REPOSITORY="${!i}"
|
||||
;;
|
||||
--repository-strict)
|
||||
REPOSITORY_STRICT=1
|
||||
;;
|
||||
--severity) let i+=1
|
||||
[ "${!i}" ] || {
|
||||
echo "Error: --severity parameter not given, aborting."
|
||||
@ -190,6 +195,9 @@ for ((i=1; i<=$#; i++)); do
|
||||
}
|
||||
WEBBUILD_USER_CMDLINE="${!i}"
|
||||
;;
|
||||
--rebuild-srpms)
|
||||
REBUILD_SRPMS=1
|
||||
;;
|
||||
-*) if [ "${!i}" = "--" ]; then
|
||||
AUTOSPEC_ARGS_MODE=1
|
||||
SCRIPT_ARGS_MODE=
|
||||
@ -627,6 +635,15 @@ function launch_pkgs_loop() {
|
||||
if [ "$PKGLINE" ]; then
|
||||
set -- $PKGLINE
|
||||
[[ $4 =~ "^[0-9]+$" ]] && REPNAME=${AUTODIST_REPOSITORIES[$4]} || REPNAME="$4"
|
||||
if [ "$REPNAME" != "$AUTODIST_REPOSITORY" -a "$REPOSITORY_STRICT" ]; then
|
||||
case $SEVERITY in
|
||||
0) echo "!! Warning: package comes from $REPNAME instead of $AUTODIST_REPOSITORY" ;;
|
||||
1) echo "!! Error: package comes from $REPNAME instead of $AUTODIST_REPOSITORY; skipping $pkg package."
|
||||
continue ;;
|
||||
*) echo "!! Error: package comes from $REPNAME instead of $AUTODIST_REPOSITORY; aborting."
|
||||
exit 1 ;;
|
||||
esac
|
||||
fi
|
||||
if [ "$REPNAME" ]; then
|
||||
command_opts="$command_opts --server ${REPNAME}"
|
||||
else
|
||||
@ -672,6 +689,8 @@ function launch_pkgs_loop() {
|
||||
fi
|
||||
fi
|
||||
command_opts="-a5:6" ;;
|
||||
buildsrpm)
|
||||
command_opts="-a5:6 --norpm" ;;
|
||||
buildinstall)
|
||||
# skip package in job if up to date
|
||||
if [ "$PKGLINE" -a "$BUILDSLINE" ]; then
|
||||
@ -744,7 +763,7 @@ function launch_pkgs_loop() {
|
||||
echo "Command: $command"
|
||||
else
|
||||
# eval "$command 2>&1 && echo '0'>$tmpfile1 || echo '1'>$tmpfile1" | tail_file $tmpfile "== $pkg (${JOB_VALUES[*]})..."
|
||||
(export LANG=C; $command 2>&1; echo $? >$tmpfile1) | tail_file $tmpfile "== $pkg (${JOB_VALUES[*]})..."
|
||||
(export LANG=en_US.UTF-8; $command 2>&1; echo $? >$tmpfile1) | tail_file $tmpfile "== $pkg (${JOB_VALUES[*]})..."
|
||||
if [ -e $tmpfile1 ]; then
|
||||
ret=`cat $tmpfile1`
|
||||
rm -f $tmpfile1
|
||||
@ -1345,7 +1364,12 @@ for JOB_NUM in `seq 1 ${#JOBNAME[*]}`; do
|
||||
}
|
||||
# avoid calling autospec with --nosrpm --norpm (not working as expected and not useful)
|
||||
if [ "${AUTOSPEC_ARGS/--nosrpm}" = "$AUTOSPEC_ARGS" ]; then
|
||||
echo "== sending source rpms"
|
||||
if [ $REBUILD_SRPMS ]; then
|
||||
echo "== rebuilding and sending source rpms"
|
||||
launch_pkgs_loop buildsrpm "$AUTOSPEC_ARGS --norpm"
|
||||
else
|
||||
echo "== sending source rpms"
|
||||
fi
|
||||
launch_pkgs_loop send "$AUTOSPEC_ARGS --norpm $SEND_SERVER_CMD"
|
||||
if [ $? -gt 0 ]; then
|
||||
case $SEVERITY in
|
||||
|
@ -145,9 +145,8 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
|
||||
[ "${SHOWLOG}" = "current" -o "${SHOWLOG}" = "last" -a ! "${AUTOPORT_UPDATE[$i]}" ] && echo -n " ($r)"
|
||||
echo -n ":</h2>"
|
||||
cat << _EOF
|
||||
<div class=downloadbox align=center>
|
||||
<div class=output align=left style="height:550px;width:850px;">
|
||||
<!--overflow:auto;font-size:8pt;border:1px solid #2b6600;margin:4px;padding:2px;color:lightgray;background-color:black;"-->
|
||||
<div class="downloadbox" align="center">
|
||||
<div class="output outputbox">
|
||||
_EOF
|
||||
echo -n "<pre><code>"
|
||||
if [ "$SHOWLOG" = "current" ]; then
|
||||
@ -215,8 +214,8 @@ _EOF
|
||||
echo " [ <a target=_autodist href=\"?SHOWLOG=current&NUM=$i&REP=$RNUM$HOST_ADD\">last</a> ]</b>"
|
||||
fi
|
||||
cat << _EOF
|
||||
<div class=downloadbox align=center>
|
||||
<div align=left style="background-color: white; height: 250px; width: 850px; overflow: auto; font-size: 8pt; border:1px solid #2b6600; margin: 4px; padding:4; background-color: #e0f2d0;">
|
||||
<div class="downloadbox" align="center">
|
||||
<div align="left" class="showlogbox">
|
||||
_EOF
|
||||
echo -n "<pre style='margin:1px;word-wrap:normal;white-space:pre;'>"
|
||||
unset BUILDNOWIDX BUILDLOG BUILDNOW BUILDNOWSTATUS SCHEDULED STARTTIME AUTODIST_PID ENDTIME
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# autodist upstream updates - find upstream packages updates from different internet resources
|
||||
# Copyright (c) 2004-2014 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
# Copyright (c) 2004-2016 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
#
|
||||
|
||||
#[ -r /etc/sysconfig/openmamba-central ] || {
|
||||
@ -88,7 +88,7 @@ function version_compare()
|
||||
function version_find_bigger()
|
||||
{
|
||||
local VER1 VER2 FPOS CUTVER1 CUTVER2
|
||||
|
||||
|
||||
VER1=$1
|
||||
VER2=$2
|
||||
FPOS=1
|
||||
@ -157,6 +157,7 @@ CONFIG_DIR=$CACHE_DIR
|
||||
UPDATES_DB=$CACHE_DIR/upstream-updates
|
||||
ALIASES_DB=$CACHE_DIR/aliases
|
||||
MANUALVER_DB=$CACHE_DIR/manualver
|
||||
BLACKLIST_DB_PREFIX=$CACHE_DIR/blacklist.
|
||||
|
||||
[ -s $PKGLIST_FILE ] || {
|
||||
echo "Error: file $PKGLIST_FILE is missing or empty; aborting." >&2
|
||||
@ -174,15 +175,18 @@ parse_arch_linux() {
|
||||
#for page in `seq 1 45`; do
|
||||
for rep in core community extra; do
|
||||
# SOURCEURL="https://www.archlinux.org/packages/?page=$page&sort=-last_update&q=&arch=i686&maintainer=&flagged="
|
||||
SOURCEURL="http://lug.mtu.edu/archlinux/$rep/os/i686/"
|
||||
SOURCEURL="http://lug.mtu.edu/archlinux/$rep/os/x86_64/"
|
||||
curl -L -s "$SOURCEURL" | \
|
||||
grep ".pkg." | grep -v ".sig\"" | \
|
||||
while read line; do
|
||||
line=`echo $line | sed "s|.*href=\"\([^\"]*\)\">.*|\1|"`
|
||||
pkg=`echo $line | sed "s|\(.*\)-[^-]*-[^-]*-[^-]*|\1|"`
|
||||
ver=`echo $line | sed "s|.*-\([^-]*\)-[^-]*-[^-]*|\1|;s|.*%3a||"`
|
||||
ver=`echo $line | sed "s|.*-\([^-]*\)-[^-]*-[^-]*|\1|;s|.*%3a||i;s|%2b.*||i"`
|
||||
alias=`grep "^$pkg " $ALIASES_DB`
|
||||
|
||||
# Skip blackisted
|
||||
if [ -e ${BLACKLIST_DB_PREFIX}arch ]; then
|
||||
grep -q "^$pkg$" ${BLACKLIST_DB_PREFIX}arch && continue
|
||||
fi
|
||||
[ "$alias" ] || alias=`grep "^lib$pkg " $ALIASES_DB`
|
||||
[ "$alias" ] && pkgalias=${alias/* /} || pkgalias=$pkg
|
||||
line=`grep -i "^$pkgalias:" $buildstmp || grep -i "^lib$pkgalias:" $buildstmp || grep -i " $pkgalias[^-_A-Za-z0-9]" $buildstmp`
|
||||
@ -206,6 +210,9 @@ parse_xorg() {
|
||||
if [ "$line" ]; then
|
||||
ver=`echo $line | sed "s|.*-||"`
|
||||
pkg="${line/-$ver}"
|
||||
if [ -e ${BLACKLIST_DB_PREFIX}xorg ]; then
|
||||
grep -q "^$pkg$" ${BLACKLIST_DB_PREFIX}xorg && continue
|
||||
fi
|
||||
alias=`grep "^$pkg " $ALIASES_DB`
|
||||
if [ ! "$alias" -a "${pkg:0:5}" == "xf86-" ]; then
|
||||
alias="$pkg xorg-drv-${pkg/xf86-}"
|
||||
@ -228,6 +235,9 @@ parse_gnome() {
|
||||
IFS=":"
|
||||
set -- $line
|
||||
pkg="$2"
|
||||
if [ -e ${BLACKLIST_DB_PREFIX}gnome ]; then
|
||||
grep -q "^$pkg$" ${BLACKLIST_DB_PREFIX}gnome && continue
|
||||
fi
|
||||
ver="$3"
|
||||
alias=`grep "^$pkg " $ALIASES_DB`
|
||||
[ "$alias" ] || alias=`grep "^lib$pkg " $ALIASES_DB`
|
||||
@ -249,7 +259,7 @@ parse_gnome() {
|
||||
parse_distromatic() {
|
||||
# parse distrowatch.com packages list
|
||||
[ "$quiet" ] || echo "Parsing Distrowatch packages list..." >&2
|
||||
SOURCEURL="http://distrowatch.com/packages.php"
|
||||
SOURCEURL="https://distrowatch.com/packages.php"
|
||||
lynx -width 300 -dump $SOURCEURL |
|
||||
while read line; do
|
||||
[ "`echo $line | grep "Package Version Note"`" ] && start_print=1
|
||||
|
21
automaint
21
automaint
@ -173,13 +173,18 @@ rm -f $tmpfile
|
||||
for p in ${allpkgs}; do
|
||||
pkgcontinue=
|
||||
needsport=
|
||||
|
||||
for w in ${warningslist[*]}; do
|
||||
[ "$p" = "$w" ] && { pkgcontinue=1; break; }
|
||||
done
|
||||
[ "$pkgcontinue" ] && continue
|
||||
|
||||
for a in `seq 1 ${#ARCHS[*]}`; do
|
||||
get_pkg_buildinfo $LOCAL_REPS_BASE_DIR/distromatic/$DEST_REPOSITORY ${ARCHS[$a-1]} $p
|
||||
get_pkg_buildinfo $LOCAL_REPS_BASE_DIR/distromatic/$PORT_REPOSITORY ${ARCHS[$a-1]} $p
|
||||
if [ ! "$pkg_name" ]; then
|
||||
get_pkg_buildinfo $LOCAL_REPS_BASE_DIR/distromatic/$DEST_REPOSITORY ${ARCHS[$a-1]} $p
|
||||
fi
|
||||
|
||||
if [ "$pkg_name" ]; then
|
||||
spkg_version=$pkg_version
|
||||
spkg_release=$pkg_release
|
||||
@ -188,7 +193,7 @@ for p in ${allpkgs}; do
|
||||
done
|
||||
|
||||
[ "$pkg_name" ] || {
|
||||
echo "$p: not present in $DEST_REPOSITORY; skipping."
|
||||
[ "$VERBOSE" ] && echo "$p: not present in $DEST_REPOSITORY; skipping."
|
||||
continue
|
||||
}
|
||||
|
||||
@ -205,7 +210,7 @@ for p in ${allpkgs}; do
|
||||
done
|
||||
|
||||
[ "$pkg_name" ] || {
|
||||
echo "$p: not present in $SOURCE_REPOSITORY; skipping."
|
||||
[ "$VERBOSE" ] && echo "$p: not present in $SOURCE_REPOSITORY; skipping."
|
||||
continue
|
||||
}
|
||||
|
||||
@ -245,11 +250,15 @@ for p in ${allpkgs}; do
|
||||
# e.g. SVER=0.11.2 -> VER=0.11.2.3
|
||||
update_type="minor"
|
||||
else
|
||||
if [[ 64#${VER[i-1]} -gt 64#89 && 64#${SVER[i-1]} -lt 64#80 ]]; then
|
||||
[ "$VERBOSE" ] && echo "$p: dubious beta upgrade from ${SVER[i-1]} to ${VER[i-1]}; skipping."
|
||||
continue
|
||||
fi
|
||||
echo "$p: UNEXPECTED CASE - CHECK CODE; skipping."
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
if [ "$needsport" ]; then
|
||||
if [ "$needsport" -o "$pkg_repository" == "$PORT_REPOSITORY" ]; then
|
||||
echo "$p: importing from $SOURCE_REPOSITORY to $PORT_REPOSITORY ($pkg_version-$pkg_release -> $spkg_version-$spkg_release)"
|
||||
if [ ! "$TESTMODE" ]; then
|
||||
autodist-repository import $SOURCE_REPOSITORY $p -d $PORT_REPOSITORY -y >/dev/null
|
||||
@ -258,7 +267,7 @@ for p in ${allpkgs}; do
|
||||
MESSAGE=`cgi_encodevar \"imported <b>$p</b> from <b>$SOURCE_REPOSITORY</b> to <b>$PORT_REPOSITORY</b> for porting\"`" >/dev/null
|
||||
fi
|
||||
fi
|
||||
else
|
||||
elif [ "$pkg_repository" == "$DEST_REPOSITORY" ]; then
|
||||
echo "$p: importing from $SOURCE_REPOSITORY to $DEST_REPOSITORY ($pkg_version-$pkg_release -> $spkg_version-$spkg_release; update type: $update_type)"
|
||||
if [ ! "$TESTMODE" ]; then
|
||||
autodist-repository import $SOURCE_REPOSITORY $p -d $DEST_REPOSITORY -y >/dev/null
|
||||
@ -267,6 +276,8 @@ MESSAGE=`cgi_encodevar \"imported <b>$p</b> from <b>$SOURCE_REPOSITORY</b> to <b
|
||||
MESSAGE=`cgi_encodevar \"imported <b>$p</b> from <b>$SOURCE_REPOSITORY</b> to <b>$DEST_REPOSITORY</b>\"`" >/dev/null
|
||||
fi
|
||||
fi
|
||||
else
|
||||
echo "$p: unexpected upstream package repository; ignoring."
|
||||
fi
|
||||
done
|
||||
|
||||
|
14
autoport
14
autoport
@ -4,7 +4,7 @@
|
||||
#
|
||||
# Released under the terms of the GNU GPL release 3 license
|
||||
#
|
||||
VERSION=0.9.22
|
||||
VERSION=1.0.3
|
||||
|
||||
BASE_ARCH=i586
|
||||
BASE_REPOSITORY=devel
|
||||
@ -17,7 +17,7 @@ me=(${0##*/} $VERSION "Sat Mar 20 2011")
|
||||
function usage() {
|
||||
echo "\
|
||||
${me[0]} ${me[1]}
|
||||
"$"Copyright (C) 2011-2014 Silvan Calarco <silvan.calarco@mambasoft.it>""
|
||||
"$"Copyright (C) 2011-2016 Silvan Calarco <silvan.calarco@mambasoft.it>""
|
||||
"$"Released under the terms of the GNU GPL v3 license"
|
||||
echo "
|
||||
"$"Batch port and cross-build tool based on autodist.""
|
||||
@ -542,10 +542,14 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do
|
||||
done
|
||||
[ ! "$DONT_PREPARE_THIS" -a ! "`grep ^$JOB_CURRENT\$ $DATAARCHDIR/preparedjobs`" ] && {
|
||||
echo -n "prepare"
|
||||
if [ ! "$REBUILD_DEPENDANT_MODE" -a "$step" = "1" ]; then
|
||||
REPOSITORY_STRICT_ADD="--repository-strict"
|
||||
else
|
||||
REPOSITORY_STRICT_ADD=""
|
||||
fi
|
||||
[ "$VERBOSE_MODE" ] && echo "
|
||||
%% COMMAND: LANG=C LC_ALL=C autodist -p ${JOB_CURRENT} --server $PORT_REPOSITORY --repository $PORT_REPOSITORY --severity 2 -- $STAGEOPTS"
|
||||
LANG=C LC_ALL=C autodist -p ${JOB_CURRENT} --server $PORT_REPOSITORY --repository $PORT_REPOSITORY --severity 2 -- $STAGEOPTS &>$tmpfile
|
||||
cat $tmpfile >> $logfile
|
||||
%% COMMAND: LANG=C LC_ALL=C autodist -p ${JOB_CURRENT} --server $PORT_REPOSITORY --repository $PORT_REPOSITORY $REPOSITORY_STRICT_ADD --severity 2 -- $STAGEOPTS"
|
||||
LANG=C LC_ALL=C autodist -p ${JOB_CURRENT} --server $PORT_REPOSITORY --repository $PORT_REPOSITORY $REPOSITORY_STRICT_ADD --severity 2 -- $STAGEOPTS &>$tmpfile
|
||||
[ $? -gt 0 ] && {
|
||||
RES=`find_source_by_provide $PORT_REPOSITORY $JOB_CURRENT`
|
||||
for j in ${RES}; do
|
||||
|
@ -30,7 +30,7 @@ function fix_la_files() {
|
||||
sed -i "s|libdir='/usr/$TARGET_PLATFORM/${_lib}'|libdir='/usr/${_lib}'|g" /usr/${_lib}/*.la
|
||||
sed -i "s|libdir='/$TARGET_PLATFORM/${_lib}'|libdir='/usr/${_lib}'|g" /usr/${_lib}/*.la
|
||||
sed -i "s|/usr/$TARGET_PLATFORM/${_lib}|/usr/${_lib}|g" /usr/${_lib}/*.la
|
||||
sed -i "s|[:space:]/usr/$TARGET_PLATFORM/${_lib}|[:space:]/usr/${_lib}/lib|g" /usr/${_lib}/*.la
|
||||
sed -i "s|[[:space:]]/usr/$TARGET_PLATFORM/${_lib}|[[:space:]]/usr/${_lib}/lib|g" /usr/${_lib}/*.la
|
||||
}
|
||||
done
|
||||
}
|
||||
@ -41,7 +41,7 @@ function fix_la_files_cross() {
|
||||
sed -i "s|libdir='/usr/${_lib}'|libdir='/usr/$TARGET_PLATFORM/${_lib}'|g" /usr/$TARGET_PLATFORM/${_lib}/*.la
|
||||
sed -i "s|libdir='/${_lib}'|libdir='/usr/$TARGET_PLATFORM/${_lib}'|g" /usr/$TARGET_PLATFORM/${_lib}/*.la
|
||||
sed -i "s|/usr/${_lib}|/usr/$TARGET_PLATFORM/${_lib}|g" /usr/$TARGET_PLATFORM/${_lib}/*.la
|
||||
sed -i "s|[:space:]/lib/${_lib}|[:space:]/usr/$TARGET_PLATFORM/${_lib}/lib|g" /usr/$TARGET_PLATFORM/${_lib}/*.la
|
||||
sed -i "s|[[:space:]]/lib/${_lib}|[[:space:]]/usr/$TARGET_PLATFORM/${_lib}/lib|g" /usr/$TARGET_PLATFORM/${_lib}/*.la
|
||||
}
|
||||
done
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ makedist
|
||||
makedist-openmamba
|
||||
postplug
|
||||
grub-theme-openmamba
|
||||
kdevelop
|
||||
lxde
|
||||
distromatic
|
||||
u-boot
|
||||
|
@ -52,13 +52,19 @@ done
|
||||
sed -i "s|^Vendor:.*|Vendor: openmamba|;
|
||||
s|^Distribution:.*|Distribution: openmamba|;
|
||||
/BuildRequires:[[:space:]]*libffmpeg-devel/d;
|
||||
/^BuildRequires:[[:space:]]*libkdegames-devel/d;
|
||||
/^BuildRequires:[[:space:]]*libkdegames5-devel/d;
|
||||
s|\(BuildRequires:[[:space:]]*\)libmysql-devel|\1libmysql5-devel|;
|
||||
s|\(BuildRequires:[[:space:]]*\)libdb42-devel|\1libdb47-devel|;
|
||||
s|\(BuildRequires:[[:space:]]*\)firefox-devel|\1xulrunner-devel|;
|
||||
s|^PreReq:[[:space:]]*/sbin/install-info|Requires(post):%{__install_info}|;
|
||||
s|^PreReq:[[:space:]]*%{__install_info}|Requires(post):%{__install_info}|;
|
||||
s|^PreReq:[[:space:]]*|Requires(pre): |;
|
||||
s|http://.*.dl\.sourceforge\.net/|http://downloads.sourceforge.net/|" $SPECFILE
|
||||
s|^\(Requires:[[:space:]]*kde-workspace\)$|#\1|;
|
||||
s|http://.*.dl\.sourceforge\.net/|http://downloads.sourceforge.net/|;
|
||||
s|http://ftp.kde.org/stable/|http://download.kde.org/stable/|;
|
||||
s|ftp://ftp.kde.org/pub/kde/|http://download.kde.org/|;
|
||||
s|http://download.kde.org/stable/%{version}|http://download.kde.org/stable/applications/%{version}|" $SPECFILE
|
||||
#sed -i "s|^\(Source.*:[[:space:]]*ftp://ftp.kde.org/pub/kde/stable/.*.tar.\)bz2|\1xz|" $SPECFILE
|
||||
|
||||
if [ $BUILDREQNUM -gt 0 ]; then
|
||||
|
@ -1,42 +1,62 @@
|
||||
#!/bin/bash
|
||||
[ -e /etc/autodist/config ] && . /etc/autodist/config
|
||||
[ -e /etc/sysconfig/autoport ] && . /etc/sysconfig/autoport
|
||||
|
||||
RPMS_CTIME_OLD="+14"
|
||||
BUILD_CTIME_OLD="+14"
|
||||
SOURCES_CTIME_OLD="+60"
|
||||
SRPMS_CTIME_OLD="+30"
|
||||
SOURCES_CTIME_OLD="+40"
|
||||
SOURCES_ARCHIVES_CTIME_OLD="+14"
|
||||
SOURCES_PATCH_CTIME_OLD="+730"
|
||||
SRPMS_CTIME_OLD="+14"
|
||||
TMP_CTIME_OLD="+2"
|
||||
|
||||
function clean() {
|
||||
dir=$1
|
||||
arch=$2
|
||||
[ "$VERBOSE" ] && echo "Cleaning from base directory $dir..."
|
||||
[ -e $dir/ ] && find $dir/ -mindepth 1 -maxdepth 1 -name "pipe\:\[*" -exec rm -f {} \;
|
||||
[ -e $dir/RPM/SPECS/ ] && find $dir/RPM/SPECS/ -mindepth 1 -maxdepth 1 -type f -not -name "*.spec*" -exec rm -f {} \;
|
||||
[ -e $dir/RPM/RPMS/$arch/ ] && find $dir/RPM/RPMS/$arch/ -mindepth 1 -maxdepth 1 -ctime ${RPMS_CTIME_OLD} -exec rm -f {} \;
|
||||
[ -e $dir/RPM/RPMS/noarch/ ] && find $dir/RPM/RPMS/noarch/ -mindepth 1 -maxdepth 1 -ctime ${RPMS_CTIME_OLD} -exec rm -f {} \;
|
||||
[ -e $dir/RPM/BUILD/ ] && find $dir/RPM/BUILD/ -mindepth 1 -maxdepth 1 -ctime ${BUILD_CTIME_OLD} -exec rm -rf {} \;
|
||||
[ -e $dir/RPM/SOURCES/ ] && find $dir/RPM/SOURCES/ -mindepth 1 -maxdepth 1 -ctime ${SOURCES_CTIME_OLD} -a ! -name "*.patch" -exec rm -rf {} \;
|
||||
[ -e $dir/RPM/SRPMS/ ] && find $dir/RPM/SRPMS/ -mindepth 1 -maxdepth 1 -ctime ${SRPMS_CTIME_OLD} -exec rm -f {} \;
|
||||
for arch in ${AUTODIST_ARCHS[*]}; do
|
||||
[ -e $dir/RPM/RPMS/$arch/ ] && find $dir/RPM/RPMS/$arch/ -mindepth 1 -maxdepth 1 -type f -mtime ${RPMS_CTIME_OLD} -exec rm -f {} \;
|
||||
done
|
||||
[ -e $dir/RPM/RPMS/noarch/ ] && find $dir/RPM/RPMS/noarch/ -mindepth 1 -maxdepth 1 -type f -mtime ${RPMS_CTIME_OLD} -exec rm -f {} \;
|
||||
if [ -e $dir/RPM/BUILD/ ]; then
|
||||
find $dir/RPM/BUILD/ -mindepth 1 -maxdepth 1 -type d -ctime ${BUILD_CTIME_OLD} -exec rm -rf {} \;
|
||||
# delete older package duplicates
|
||||
find $dir/RPM/BUILD/ -maxdepth 1 | sort -V | \
|
||||
while read curr; do
|
||||
if [ "${curr/-[0-9._]*}" = "${last/-[0-9._]*}" -a "${last}" ]; then
|
||||
rm -rf $last
|
||||
fi
|
||||
last=$curr;
|
||||
done
|
||||
fi
|
||||
[ -e $dir/RPM/SOURCES/ ] && {
|
||||
find $dir/RPM/SOURCES/ -mindepth 1 -maxdepth 1 -type f -ctime ${SOURCES_CTIME_OLD} -a ! -name "*.patch" -exec rm -rf {} \;
|
||||
find $dir/RPM/SOURCES/ -mindepth 1 -maxdepth 1 -type f -ctime ${SOURCES_ARCHIVES_CTIME_OLD} -a -name "*.tar.xz" -exec rm -rf {} \;
|
||||
find $dir/RPM/SOURCES/ -mindepth 1 -maxdepth 1 -type f -ctime ${SOURCES_ARCHIVES_CTIME_OLD} -a -name "*.tar.bz2" -exec rm -rf {} \;
|
||||
find $dir/RPM/SOURCES/ -mindepth 1 -maxdepth 1 -type f -ctime ${SOURCES_ARCHIVES_CTIME_OLD} -a -name "*.tar.gz" -exec rm -rf {} \;
|
||||
find $dir/RPM/SOURCES/ -mindepth 1 -maxdepth 1 -type f -ctime ${SOURCES_PATCH_CTIME_OLD} -a -name "*.patch" -exec rm -rf {} \;
|
||||
}
|
||||
[ -e $dir/RPM/SRPMS/ ] && find $dir/RPM/SRPMS/ -mindepth 1 -maxdepth 1 -type f -mtime ${SRPMS_CTIME_OLD} -exec rm -f {} \;
|
||||
}
|
||||
|
||||
for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
|
||||
if [ "${AUTOPORT_CHROOT[$i]}" ]; then
|
||||
a=${AUTOPORT_CHROOT[$i]}
|
||||
clean /var/autoport/$a/usr/src ${AUTOPORT_ARCH[$i]}
|
||||
[ -e /var/autoport/$a/var/autodist/RPM/RPMS/$arch ] && \
|
||||
clean /var/autoport/$a/var/autodist ${AUTOPORT_ARCH[$i]}
|
||||
clean /var/autoport/$a/usr/src
|
||||
[ -e /var/autoport/$a/var/autodist/RPM/RPMS/ ] && \
|
||||
clean /var/autoport/$a/var/autodist
|
||||
[ -e /var/autoport/$a/var/tmp/autodist ] && \
|
||||
find /var/autoport/$a/var/tmp/autodist/ -mindepth 1 -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \;
|
||||
find /var/autoport/$a/tmp/ -mindepth 1 -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \;
|
||||
find /var/autoport/$a/var/tmp/autodist/ -mindepth 1 -maxdepth 1 -type f -mtime ${TMP_CTIME_OLD} -exec rm -rf {} \;
|
||||
find /var/autoport/$a/tmp/ -mindepth 1 -maxdepth 1 -type f -mtime ${TMP_CTIME_OLD} -exec rm -rf {} \;
|
||||
elif [ "${AUTOPORT_UPDATE[$i]}" ]; then
|
||||
clean /var/autodist ${AUTOPORT_ARCH[$i]}
|
||||
find /var/autodist-tmp/ -mindepth 1 -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \;
|
||||
clean /var/autodist
|
||||
find /var/autodist-tmp/ -mindepth 1 -maxdepth 1 -type f -mtime ${TMP_CTIME_OLD} -exec rm -rf {} \;
|
||||
elif [ "${AUTOPORT_NATIVE[$i]}" -a "${AUTOPORT_CHROOT_USER[$i]}" ]; then
|
||||
WORKINGHOME=`getent passwd ${AUTOPORT_CHROOT_USER[$i]} | cut -d: -f6`
|
||||
if [ -e $WORKINGHOME ]; then
|
||||
clean $WORKINGHOME ${AUTOPORT_ARCH[$i]}
|
||||
clean $WORKINGHOME
|
||||
fi
|
||||
find /var/autodist-tmp/ -mindepth 1 -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \;
|
||||
find /var/autodist-tmp/ -mindepth 1 -maxdepth 1 -type f -mtime ${TMP_CTIME_OLD} -exec rm -rf {} \;
|
||||
fi
|
||||
done
|
||||
|
@ -8,6 +8,9 @@
|
||||
|
||||
ME=`basename $0`
|
||||
|
||||
# Disable icecc
|
||||
export PATH=/usr/bin:$PATH
|
||||
|
||||
# FIXME: parametrize automaint call
|
||||
if [ ! "$AUTOPORT_UPDATE_NO_AUTOMAINT" ]; then
|
||||
automaint -s devel-autodist -d devel -p devel-makedist
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# openmamba-autobuild-autoport daily cron script
|
||||
# (c) 2008-2014 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
# (c) 2008-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
#
|
||||
#. /etc/sysconfig/openmamba-central
|
||||
. /etc/sysconfig/autoport
|
||||
@ -31,6 +31,8 @@ function pid_check() {
|
||||
|
||||
pid_check
|
||||
|
||||
NATIVE_UPGRADED=
|
||||
|
||||
for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
|
||||
for r in ${AUTOPORT_REPOSITORIES[$i]}; do
|
||||
[ "${AUTOPORT_ARCH[$i]}" ] || continue
|
||||
@ -55,10 +57,12 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
|
||||
|
||||
if [ "${AUTOPORT_NATIVE[$i]}" ]; then
|
||||
a=${AUTOPORT_ARCH[$i]}
|
||||
[[ "`/usr/bin/tty`" != "not a tty" ]] && echo "Updating packages in $a native environment"
|
||||
echo "= Updating packages in $a native environment..." >> $LOGFILE
|
||||
LANG=C smart update > /dev/null
|
||||
LANG=C smart upgrade -y >> $LOGFILE
|
||||
if [ ! "$NATIVE_UPGRADED" ]; then
|
||||
[[ "`/usr/bin/tty`" != "not a tty" ]] && echo "Updating packages in $a native environment"
|
||||
echo "= Updating packages in $a native environment..." >> $LOGFILE
|
||||
LANG=C dnf update -y >> $LOGFILE
|
||||
NATIVE_UPGRADED=1
|
||||
fi
|
||||
echo "= Working on $r($a) in native mode" >> $LOGFILE
|
||||
su -l ${AUTOPORT_CHROOT_USER[$i]} -c "$CMD_PREFIX autoport -b -r $r" >> $LOGFILE
|
||||
AUTODIST_HOME=`getent passwd ${AUTOPORT_CHROOT_USER[$i]} | cut -d: -f6`
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# openmamba-autobuild-autoport daily cron script
|
||||
# (c) 2008-2014 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
# (c) 2008-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
#
|
||||
#. /etc/sysconfig/openmamba-central
|
||||
. /etc/sysconfig/autoport
|
||||
@ -42,8 +42,7 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
|
||||
# sudo mount -o bind /proc /var/autoport/${AUTOPORT_CHROOT[$i]}/proc
|
||||
[[ "`/usr/bin/tty`" != "not a tty" ]] && echo "Updating packages in ${AUTOPORT_CHROOT[$i]} chroot environment"
|
||||
#echo "= Updating packages in ${AUTOPORT_CHROOT[$i]} chroot environment..." >> $LOGFILE
|
||||
LANG=C /usr/sbin/chroot /var/autoport/${AUTOPORT_CHROOT[$i]} smart update --quiet > /dev/null
|
||||
LANG=C /usr/sbin/chroot /var/autoport/${AUTOPORT_CHROOT[$i]} smart upgrade -y > /dev/null
|
||||
LANG=C /usr/sbin/chroot /var/autoport/${AUTOPORT_CHROOT[$i]} dnf update -y > /dev/null
|
||||
[ "${AUTOPORT_CHROOT_ICECREAM[$i]}" ] && LANG=C /usr/sbin/chroot /var/autoport/${AUTOPORT_CHROOT[$i]} /etc/init.d/icecream start
|
||||
fi
|
||||
|
||||
@ -84,8 +83,7 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
|
||||
# a=${AUTOPORT_ARCH[$i]}
|
||||
# [[ "`/usr/bin/tty`" != "not a tty" ]] && echo "Updating packages in $a native environment"
|
||||
# echo "= Updating packages in $a native environment..." >> $LOGFILE
|
||||
# LANG=C smart update > /dev/null
|
||||
# LANG=C smart upgrade -y >> $LOGFILE
|
||||
# LANG=C dnf update -y >> $LOGFILE
|
||||
# echo "= Working on $r($a) in native mode" >> $LOGFILE
|
||||
# su -l autodist -c "autoport -b -r $r" >> $LOGFILE
|
||||
# cat /var/autodist/.autoport/$a/$r-current.log >> $LOGFILE
|
||||
|
191
telegram/openmamba_bot.py
Executable file
191
telegram/openmamba_bot.py
Executable file
@ -0,0 +1,191 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
# openmamba bot for Telegram
|
||||
#
|
||||
# Copyright (C) 2016-2017 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
#
|
||||
# GPL v3 license
|
||||
|
||||
from telegram import (ParseMode)
|
||||
from telegram.ext import (Updater, CommandHandler, MessageHandler, Filters, RegexHandler,
|
||||
ConversationHandler, Job)
|
||||
|
||||
import logging
|
||||
import subprocess
|
||||
import sqlite3
|
||||
import os
|
||||
|
||||
# Enable logging
|
||||
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
||||
level=logging.INFO)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
timers = dict()
|
||||
social_log_last_ids = dict()
|
||||
|
||||
|
||||
def start(bot, update):
|
||||
|
||||
user = update.message.from_user
|
||||
logger.info("User %s started the conversation." % user.first_name)
|
||||
|
||||
update.message.reply_text(
|
||||
'Hi! This is the openmamba GNU/Linux Bot.\n'
|
||||
'Send any text to search for packages.\n'
|
||||
'Send /details name to see details of specified source package.\n'
|
||||
'Send /set [seconds] to enable notifications.\n'
|
||||
'Send /unset to disable notifications.\n'
|
||||
'Send /cancel to stop talking to me.\n\n')
|
||||
|
||||
return
|
||||
|
||||
|
||||
def query(bot, update):
|
||||
user = update.message.from_user
|
||||
logger.info("Query of %s: %s" % (user.first_name, update.message.text))
|
||||
|
||||
response = ""
|
||||
for rep in [ 'devel', 'devel-games', 'devel-makedist', 'devel-autodist', 'devel-kernel', 'devel-misc', 'devel-kde4' ]:
|
||||
conn = sqlite3.connect('/var/webbuild/db/%s-sources.db' % rep, check_same_thread=False)
|
||||
cursor = conn.cursor()
|
||||
cursor.execute(
|
||||
'SELECT id,name,version,release,summary,url FROM sources where name like "%%%s%%" or summary like "%%%s%%" '
|
||||
'ORDER BY name="%s" DESC, name like "%s%%" DESC, name like "%%%s%%" DESC limit 10'
|
||||
% (update.message.text, update.message.text, update.message.text, update.message.text, update.message.text))
|
||||
for row in cursor:
|
||||
response += "<b>%s</b> %s-%s (%s)\n%s\n%s\n\n" % (row[1], row[2], row[3], rep, row[4], row[5])
|
||||
|
||||
if response != "":
|
||||
update.message.reply_text(response, parse_mode=ParseMode.HTML)
|
||||
else:
|
||||
update.message.reply_text('No results found.')
|
||||
return
|
||||
|
||||
|
||||
def details(bot, update, args):
|
||||
user = update.message.from_user
|
||||
logger.info("Details of %s: %s" % (user.first_name, update.message.text))
|
||||
|
||||
response = ""
|
||||
for rep in [ 'devel', 'devel-games', 'devel-makedist', 'devel-autodist', 'devel-kernel', 'devel-misc', 'devel-kde4' ]:
|
||||
conn = sqlite3.connect('/var/webbuild/db/%s-sources.db' % rep, check_same_thread=False)
|
||||
cursor = conn.cursor()
|
||||
cursor.execute(
|
||||
'SELECT id,name,version,release,summary,url,description FROM sources where name="%s"' % (args[0]))
|
||||
for row in cursor:
|
||||
response += "<b>%s</b> %s-%s (devel)\n%s\n%s\n\n<i>%s</i>\n\n" % (row[1], row[2], row[3], row[4], row[5], row[6])
|
||||
for arch in [ 'x86_64', 'i586', 'arm' ]:
|
||||
conn1 = sqlite3.connect('/var/webbuild/db/' + rep + '-' + arch + '.db', check_same_thread=False)
|
||||
cursor1 = conn1.cursor()
|
||||
cursor1.execute('SELECT id,name FROM packages where id_source=%s' % (row[0]))
|
||||
for row1 in cursor1:
|
||||
response += "<b>%s</b>(%s) " % (row1[1], arch)
|
||||
response += "\n\n\n"
|
||||
|
||||
if response != "":
|
||||
update.message.reply_text(response, parse_mode=ParseMode.HTML)
|
||||
else:
|
||||
update.message.reply_text('No results found.')
|
||||
return
|
||||
|
||||
|
||||
def alarm(bot, job):
|
||||
social_log_conn = sqlite3.connect('/var/webbuild/webbuild.db')
|
||||
social_log_cursor = social_log_conn.cursor()
|
||||
social_log_cursor.execute('SELECT id,user,text,datetime(time,\'localtime\'),type FROM social_log where id>%s' % social_log_last_ids[job.context])
|
||||
response = ""
|
||||
for row in social_log_cursor:
|
||||
if row[4] == "job":
|
||||
response += "Job run by <i>%s</i> %s (%s)\n" % (row[1], row[2], row[3])
|
||||
else:
|
||||
response += "<i>%s</i> %s (%s)\n" % (row[1], row[2], row[3])
|
||||
if response != "":
|
||||
bot.sendMessage(job.context, response, parse_mode=ParseMode.HTML)
|
||||
social_log_last_ids[job.context] = row[0]
|
||||
|
||||
|
||||
def set(bot, update, args, job_queue):
|
||||
chat_id = update.message.chat_id
|
||||
try:
|
||||
due = int(args[0])
|
||||
if due < 0:
|
||||
update.message.reply_text('Sorry we can not go back to future!')
|
||||
return
|
||||
job = Job(alarm, due, repeat=True, context=chat_id)
|
||||
timers[chat_id] = job
|
||||
job_queue.put(job)
|
||||
|
||||
social_log_conn = sqlite3.connect('/var/webbuild/webbuild.db')
|
||||
social_log_cursor = social_log_conn.cursor()
|
||||
social_log_cursor.execute('''SELECT MAX(id) FROM social_log''')
|
||||
social_log_last_ids[chat_id] = social_log_cursor.fetchone()[0] - 5
|
||||
|
||||
update.message.reply_text('Notifications enabled!')
|
||||
|
||||
except (IndexError, ValueError):
|
||||
update.message.reply_text('Usage: /set <seconds>')
|
||||
|
||||
|
||||
def unset(bot, update):
|
||||
chat_id = update.message.chat_id
|
||||
|
||||
if chat_id not in timers:
|
||||
update.message.reply_text('Notification were not enabled')
|
||||
return
|
||||
|
||||
job = timers[chat_id]
|
||||
job.schedule_removal()
|
||||
del timers[chat_id]
|
||||
update.message.reply_text('Notifications disabled')
|
||||
|
||||
|
||||
def cancel(bot, update):
|
||||
user = update.message.from_user
|
||||
logger.info("User %s canceled the conversation." % user.first_name)
|
||||
update.message.reply_text('Bye!')
|
||||
|
||||
return ConversationHandler.END
|
||||
|
||||
|
||||
def error(bot, update, error):
|
||||
logger.warn('Update "%s" caused error "%s"' % (update, error))
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
# Load bot token from external configuration file
|
||||
bot_token = ""
|
||||
with open("/etc/autodist/secrets") as myfile:
|
||||
for line in myfile:
|
||||
name, var = line.rstrip().split("=")
|
||||
if name == "TELEGRAM_BOT_TOKEN":
|
||||
bot_token = var
|
||||
|
||||
# Create the EventHandler and pass it your bot's token.
|
||||
updater = Updater(bot_token)
|
||||
|
||||
# Get the dispatcher to register handlers
|
||||
dp = updater.dispatcher
|
||||
|
||||
dp.add_handler(CommandHandler('start', start))
|
||||
dp.add_handler(MessageHandler(Filters.text, query))
|
||||
dp.add_handler(CommandHandler('details', details, pass_args=True))
|
||||
dp.add_handler(CommandHandler('set', set, pass_args=True, pass_job_queue=True))
|
||||
dp.add_handler(CommandHandler('unset', unset))
|
||||
dp.add_handler(CommandHandler('cancel', cancel))
|
||||
|
||||
# log all errors
|
||||
dp.add_error_handler(error)
|
||||
|
||||
# Start the Bot
|
||||
updater.start_polling()
|
||||
|
||||
# Run the bot until the you presses Ctrl-C or the process receives SIGINT,
|
||||
# SIGTERM or SIGABRT. This should be used most of the time, since
|
||||
# start_polling() is non-blocking and will stop the bot gracefully.
|
||||
updater.idle()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
10
telegram/openmambabot.service
Normal file
10
telegram/openmambabot.service
Normal file
@ -0,0 +1,10 @@
|
||||
[Unit]
|
||||
Description=openmamba bot for Telegram
|
||||
After=syslog.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/python /usr/share/autodist/openmamba_bot.py
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
BIN
webbuild/html/images/refresh.png
Normal file
BIN
webbuild/html/images/refresh.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 335 B |
78
webbuild/html/styles/webbuild-post.css
Normal file
78
webbuild/html/styles/webbuild-post.css
Normal file
@ -0,0 +1,78 @@
|
||||
webbuild.a { }
|
||||
pre {
|
||||
background: none;
|
||||
border:0;
|
||||
padding:0;
|
||||
margin:0;
|
||||
-webkit-box-shadow:none;
|
||||
box-shadow:none;
|
||||
font-family: monospace;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
code {
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
form { margin:0; }
|
||||
a.webbuild:link { color:#0b0600; text-decoration: none; }
|
||||
a.webbuild:visited { color:#0b0600; text-decoration: none; }
|
||||
a.webbuild:active { color:#0b0600; text-decoration: none; }
|
||||
a.webbuild:hover { text-decoration: underline; }
|
||||
hr { margin:0; color:black; background: #aaaaaa; }
|
||||
label { white-space:nowrap; text-decoration:none; font-weight:initial; }
|
||||
|
||||
.webbuild input {
|
||||
font-size: 8pt;
|
||||
font-family:liberationsans,freesans,Arial,Verdana,Helvetica,sans-serif;
|
||||
padding: 1px;
|
||||
margin: 1px;
|
||||
}
|
||||
|
||||
select {
|
||||
font-size: 8pt;
|
||||
font-family:liberationsans,freesans,Arial,Verdana,Helvetica,sans-serif;
|
||||
padding: 0;
|
||||
margin: 1px;
|
||||
max-width: 98%;
|
||||
background-color: buttonface;
|
||||
}
|
||||
|
||||
input[type="text"] {
|
||||
font-family:liberationsans,freesans,Arial,Verdana,Helvetica,sans-serif;
|
||||
padding: 1px;
|
||||
margin: 1px;
|
||||
border: 1px solid #AAAAAA;
|
||||
}
|
||||
|
||||
input[type="button"] {
|
||||
font-family:liberationsans,freesans,Arial,Verdana,Helvetica,sans-serif;
|
||||
font-size: 8pt;
|
||||
font-weight: 400;
|
||||
margin: 1px;
|
||||
border: 1px solid #AAAAAA;
|
||||
white-space:nowrap;
|
||||
line-height: 1.1em;
|
||||
}
|
||||
|
||||
input[type="button"]::-moz-focus-inner { padding: 0; border: 0; }
|
||||
|
||||
input[type="button"]:hover {
|
||||
border: 1px solid #666666;
|
||||
}
|
||||
input[type="radio"] {
|
||||
font-family:liberationsans,freesans,Arial,Verdana,Helvetica,sans-serif;
|
||||
font-size: 7pt;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
input[type="checkbox"] {
|
||||
font-family:liberationsans,freesans,Arial,Verdana,Helvetica,sans-serif;
|
||||
vertical-align:middle;
|
||||
-ms-transform: scale(0.9);
|
||||
-moz-transform: scale(0.9);
|
||||
-webkit-transform: scale(0.9);
|
||||
-o-trasnform: scale(0.9);
|
||||
padding: 1px;
|
||||
margin: 1px;
|
||||
}
|
13
webbuild/html/styles/webbuild-standalone.css
Normal file
13
webbuild/html/styles/webbuild-standalone.css
Normal file
@ -0,0 +1,13 @@
|
||||
body { font-size: 9pt; font-family: liberationsans, freesans, arial, verdana, sans-serif; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); }
|
||||
table { font-size: 9pt; font-family: liberationsans, freesans, arial, verdana, sans-serif; background-color: rgb(255, 255, 255); }
|
||||
img { border: 0; margin: 0px; vertical-align:middle; }
|
||||
h1 { font-size: 13pt; font-weight: bold; }
|
||||
h2 { font-size: 11pt; font-weight: bold; }
|
||||
h3 { font-size: 10pt; font-weight: bold; margin-top: 20px; margin-bottom: 2px; }
|
||||
h4 { margin:5; margin-right: 10; font-size: 9pt; font-weight: normal; }
|
||||
hr { margin:0; color:white; }
|
||||
a { }
|
||||
a:link { color:#2b6600; text-decoration: none; }
|
||||
a:visited { color:#2b6600; text-decoration: none; }
|
||||
a:active { color:#2b6600; text-decoration: none; }
|
||||
a:hover { text-decoration: underline; }
|
@ -1,75 +1,18 @@
|
||||
body { font-size: 9pt; font-family: liberationsans, freesans, arial, verdana, sans-serif; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); }
|
||||
table { font-size: 9pt; font-family: liberationsans, freesans, arial, verdana, sans-serif; background-color: rgb(255, 255, 255); }
|
||||
img { border: 0; margin: 0px; vertical-align:middle; }
|
||||
h1 { font-size: 13pt; font-weight: bold; }
|
||||
h2 { font-size: 11pt; font-weight: bold; }
|
||||
h3 { font-size: 10pt; font-weight: bold; margin-top: 20px; margin-bottom: 2px; }
|
||||
h4 { margin:5; margin-right: 10; font-size: 9pt; font-weight: normal; }
|
||||
hr { margin:0; color:white; }
|
||||
a { }
|
||||
a:link { color:#2b6600; text-decoration: none; }
|
||||
a:visited { color:#2b6600; text-decoration: none; }
|
||||
a:active { color:#2b6600; text-decoration: none; }
|
||||
a:hover { text-decoration: underline; }
|
||||
|
||||
label {
|
||||
white-space:nowrap;
|
||||
}
|
||||
|
||||
input {
|
||||
font-size: 8pt;
|
||||
font-family:liberationsans,freesans,Arial,Verdana,Helvetica,sans-serif;
|
||||
padding: 0;
|
||||
margin: 1px;
|
||||
}
|
||||
select {
|
||||
font-size: 8pt;
|
||||
font-family:liberationsans,freesans,Arial,Verdana,Helvetica,sans-serif;
|
||||
padding: 0;
|
||||
margin: 1px;
|
||||
height: 18px;
|
||||
}
|
||||
input[type="text"] {
|
||||
padding: 0px;
|
||||
margin: 1px;
|
||||
height: 1.40em;
|
||||
border: 1px solid #AAAAAA;
|
||||
}
|
||||
|
||||
input[type="button"] {
|
||||
margin: 1px;
|
||||
white-space:nowrap;
|
||||
height: 18px;
|
||||
}
|
||||
input[type="radio"] {
|
||||
font-size: 7pt;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
input[type="checkbox"] {
|
||||
vertical-align:middle;
|
||||
-ms-transform: scale(0.9);
|
||||
-moz-transform: scale(0.9);
|
||||
-webkit-transform: scale(0.9);
|
||||
-o-trasnform: scale(0.9);
|
||||
padding: 1px;
|
||||
margin: 1px;
|
||||
}
|
||||
.boldbutton {
|
||||
font-weight: bold;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
.redbutton {
|
||||
color: red;
|
||||
color: red !important;
|
||||
}
|
||||
.redbutton[disabled] {
|
||||
color: lightgray;
|
||||
color: lightgray !important;
|
||||
}
|
||||
.redboldbutton {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
color: red !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
.redboldbutton[disabled] {
|
||||
color: lightgray;
|
||||
color: lightgray !important;
|
||||
}
|
||||
.screencontainer {
|
||||
text-align:center;
|
||||
@ -83,8 +26,8 @@ input[type="checkbox"] {
|
||||
|
||||
.opaquebackground {
|
||||
text-align:center;
|
||||
position:fixed;
|
||||
z-index:15 !important;
|
||||
position: fixed;
|
||||
height:100%;
|
||||
width:100%;
|
||||
left:0;
|
||||
@ -166,77 +109,166 @@ input[type="checkbox"] {
|
||||
.multiselect label {
|
||||
display:block;
|
||||
white-space:nowrap;
|
||||
font-weight:400;
|
||||
padding:0;
|
||||
}
|
||||
|
||||
.socialbox {
|
||||
.webbuildtopright {
|
||||
float:right;
|
||||
font-size:8pt;
|
||||
border:0px;
|
||||
padding:0px;
|
||||
height:130px;
|
||||
line-height: 100%;
|
||||
border:1px solid #2b6600;
|
||||
}
|
||||
|
||||
.searchbox {
|
||||
position:relative;
|
||||
display:block;
|
||||
float:left;
|
||||
width:215px;
|
||||
align:center;
|
||||
left:660px;
|
||||
top:-25px;
|
||||
// height:21px;
|
||||
font-size:8pt;
|
||||
border:1px solid #2b6600;
|
||||
// margin:4px;
|
||||
padding:2px;
|
||||
background-color: #e0f2d0;
|
||||
}
|
||||
.chatpanel {
|
||||
float:left;
|
||||
width:215px;
|
||||
align:center;
|
||||
}
|
||||
.webbuild {
|
||||
font-size: 8pt;
|
||||
}
|
||||
.webbuild td {
|
||||
font-size: 8pt;
|
||||
}
|
||||
|
||||
.editor {
|
||||
width:690px;
|
||||
height:300px;
|
||||
border:1px solid #cccccc;
|
||||
padding:0px;
|
||||
font-family: liberationsans, freesans, arial, verdana, sans-serif;
|
||||
line-height: 1.3em;
|
||||
color: #000000;
|
||||
margin:0px;
|
||||
font-family:'Courier New', Courier, 'Nimbus Mono L', monospace;
|
||||
font-size:8pt;
|
||||
}
|
||||
.webbuild td { font-size: 8pt; border:0; }
|
||||
}
|
||||
.webbuild table { font-size: 9pt; font-family: liberationsans, freesans, arial, verdana, sans-serif; background-color: rgb(255, 255, 255); }
|
||||
.webbuild img { border: 0; margin: 0px; vertical-align:middle; }
|
||||
.webbuild h1 { font-size: 13pt; font-weight: bold; }
|
||||
.webbuild h2 { font-size: 11pt; font-weight: bold; }
|
||||
.webbuild h3 { font-size: 10pt; font-weight: bold; margin-top: 20px; margin-bottom: 2px; }
|
||||
.webbuild h4 { margin:5; margin-right: 10; font-size: 9pt; font-weight: normal; }*/
|
||||
.webbuild hr { margin:0; color:white; }
|
||||
.webbuild div { margin-bottom:1px; padding-bottom:1px; }
|
||||
|
||||
.maintainer {
|
||||
width:684px;
|
||||
height:300px;
|
||||
overflow:auto;
|
||||
font-size:7pt;
|
||||
border:1px solid #2b6600;
|
||||
.webbuildcontainer {
|
||||
max-width:920px;
|
||||
height:auto;
|
||||
}
|
||||
.webbuildwrapleft {
|
||||
float:left;
|
||||
width:100%;
|
||||
margin-right:-210px;
|
||||
}
|
||||
.webbuildleft {
|
||||
margin-right:210px !important;
|
||||
padding:0;
|
||||
margin:0;
|
||||
background-color:white;
|
||||
}
|
||||
|
||||
.socialbox {
|
||||
.webbuildright {
|
||||
float:right;
|
||||
font-size:8pt;
|
||||
padding:0px;
|
||||
height:130px;
|
||||
line-height: 100%;
|
||||
border:1px solid #2b6600;
|
||||
width:202px;
|
||||
margin:0;
|
||||
}
|
||||
|
||||
.processes {
|
||||
float:left;
|
||||
@media screen and (min-width: 901px) {
|
||||
.webbuildright {
|
||||
width:202px;
|
||||
}
|
||||
.socialbox {
|
||||
width:200px;
|
||||
}
|
||||
}
|
||||
.operationpanelinfo {
|
||||
margin-top:137px;
|
||||
border:1px solid #2b6600;
|
||||
background-color:#E0F2D0;
|
||||
padding:1px;
|
||||
}
|
||||
.operationpanelsend {
|
||||
margin-top:5px;
|
||||
border:1px solid #2b6600;
|
||||
background-color:#E0F2D0;
|
||||
padding:1px;
|
||||
}
|
||||
.operationpanelautodist {
|
||||
margin-top:5px;
|
||||
border:1px solid #2b6600;
|
||||
background-color:#FFFFDE;
|
||||
padding:1px;
|
||||
}
|
||||
.operationpanelpatches {
|
||||
margin-top:5px;
|
||||
border:1px solid #2b6600;
|
||||
background-color:#E0F2D0;
|
||||
padding:1px;
|
||||
}
|
||||
.operationpanelupload {
|
||||
margin-top:5px;
|
||||
border:1px solid #2b6600;
|
||||
background-color:#FFFFFF;
|
||||
padding:1px;
|
||||
}
|
||||
.operationpanelpackageinfo {
|
||||
margin-top:5px;
|
||||
border:1px solid #2b6600;
|
||||
background-color:#A7DEDE;
|
||||
padding:1px;
|
||||
}
|
||||
.operationpanelgenericinfo {
|
||||
margin-top:5px;
|
||||
border:1px solid #2b6600;
|
||||
background-color:#A7DEDE;
|
||||
padding:1px;
|
||||
}
|
||||
.operationpanelhost {
|
||||
margin-top:5px;
|
||||
border:1px solid #2b6600;
|
||||
background-color:#FFFFFF;
|
||||
padding:1px;
|
||||
}
|
||||
.operationpaneloperations {
|
||||
margin-top:5px;
|
||||
border:1px solid #2b6600;
|
||||
background-color:#FFFFDE;
|
||||
padding:1px;
|
||||
}
|
||||
.operationpaneloperations > textarea {
|
||||
padding:0;
|
||||
}
|
||||
.webbuildprocesses {
|
||||
font-size:7pt;
|
||||
padding:0px;
|
||||
height:130px;
|
||||
line-height: 130%;
|
||||
margin-bottom: 2px;
|
||||
border:1px solid #2b6600;
|
||||
width:100%;
|
||||
margin:0;
|
||||
// display:table-cell;
|
||||
background-color:#E0F2D0;
|
||||
padding:1px;
|
||||
}
|
||||
.processes {
|
||||
width:100%;
|
||||
}
|
||||
.editor {
|
||||
float:left;
|
||||
width:100%;
|
||||
height:300px;
|
||||
border:1px solid #cccccc;
|
||||
padding:0px;
|
||||
margin:0px;
|
||||
font-family:monospace;
|
||||
font-size:8pt;
|
||||
}
|
||||
.maintainer {
|
||||
float:left;
|
||||
width:100%;
|
||||
height:300px;
|
||||
overflow:auto;
|
||||
font-size:7pt;
|
||||
border:1px solid #2b6600;
|
||||
padding:1px;
|
||||
margin:0;
|
||||
background-color:white;
|
||||
float:left;
|
||||
}
|
||||
|
||||
.notes {
|
||||
@ -250,13 +282,14 @@ input[type="checkbox"] {
|
||||
}
|
||||
|
||||
.output {
|
||||
width:680px;
|
||||
width:100%;
|
||||
height:300px;
|
||||
overflow:auto;
|
||||
overflow-x:hidden;
|
||||
word-wrap: break-word;
|
||||
font-family:'Courier New', Courier, 'Nimbus Mono L', monospace;
|
||||
font-family:monospace;
|
||||
font-size:8pt;
|
||||
font-weight:400;
|
||||
border:1px solid #2b6600;
|
||||
padding:2px;
|
||||
margin:0;
|
||||
@ -264,27 +297,71 @@ input[type="checkbox"] {
|
||||
color:white;
|
||||
}
|
||||
|
||||
.output a:link {
|
||||
text-decoration: underline;
|
||||
color:white;
|
||||
}
|
||||
|
||||
.output a,
|
||||
.output a:link,
|
||||
.output a:visited {
|
||||
text-decoration: underline;
|
||||
color:white;
|
||||
}
|
||||
|
||||
.output p {
|
||||
background-color:gray;
|
||||
color:white;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 900px) {
|
||||
.webbuildright,
|
||||
.webbuildleft,
|
||||
.operationpanelinfo,
|
||||
.operationpanelsend,
|
||||
.operationpanelautodist {
|
||||
width:100%;
|
||||
}
|
||||
.socialbox {
|
||||
float: none !important;
|
||||
}
|
||||
span#socialbox > span > div > div > img,
|
||||
span#socialbox > span > div > div:first-child {
|
||||
height:12px !important;
|
||||
width:12px !important;
|
||||
}
|
||||
span#socialbox > span > div > div:nth-child(2),
|
||||
span#socialbox > span > div > div:nth-child(3) {
|
||||
margin-left: 12px !important;
|
||||
}
|
||||
.operationpanelinfo {
|
||||
margin-top:5px !important;
|
||||
}
|
||||
.webbuildtopright,
|
||||
.webbuildtopleft {
|
||||
margin-top:5px;
|
||||
width:100%;
|
||||
}
|
||||
.chatpanel {
|
||||
margin-left:10px;
|
||||
}
|
||||
select,
|
||||
input {
|
||||
margin:3px !important;
|
||||
}
|
||||
|
||||
}
|
||||
@media screen and (max-width: 370px) {
|
||||
.webbuildright,
|
||||
.webbuildleft {
|
||||
width:100%;
|
||||
}
|
||||
}
|
||||
|
||||
.matrix {
|
||||
width:100%;
|
||||
height:100%;
|
||||
height:97%;
|
||||
word-wrap: break-word;
|
||||
overflow:auto;
|
||||
font-size:7pt;
|
||||
// border:1px solid #2b6600;
|
||||
padding-right:-2px;
|
||||
padding-bottom:-2px;
|
||||
margin-left:2px;
|
||||
margin-bottom:2px;
|
||||
padding:0px;
|
||||
top:5px;
|
||||
left:5px;
|
||||
// background-color:#e0f2d0;
|
||||
/* -moz-column-count: 2;
|
||||
-moz-column-gap: 1.5em;
|
||||
@ -316,9 +393,11 @@ input[type="checkbox"] {
|
||||
}
|
||||
|
||||
.scroll-pane {
|
||||
/* socialbox */
|
||||
background-color: #e0f2d0;
|
||||
height:130px;
|
||||
width:200px;
|
||||
min-width:200px;
|
||||
width:100%;
|
||||
overflow:auto;
|
||||
float:right;
|
||||
}
|
||||
@ -337,11 +416,11 @@ input[type="checkbox"] {
|
||||
}
|
||||
|
||||
.scroll-pane3 {
|
||||
/* processes */
|
||||
background-color: #e0f2d0;
|
||||
height:130px;
|
||||
width:685px;
|
||||
width:auto;
|
||||
overflow:auto;
|
||||
float:right;
|
||||
}
|
||||
|
||||
.scroll-pane3-h {
|
||||
@ -357,3 +436,17 @@ input[type="checkbox"] {
|
||||
overflow:auto;
|
||||
}
|
||||
|
||||
/* socialbox */
|
||||
.socialbox {
|
||||
float:right;
|
||||
font-size:8pt;
|
||||
//border:0;
|
||||
//margin:0;
|
||||
//padding:0;
|
||||
height:130px;
|
||||
line-height: 100%;
|
||||
border:1px solid #2b6600;
|
||||
}
|
||||
.socialbox div { margin-bottom:1px; }
|
||||
.socialbox hr { margin:0; color:#FFF; }
|
||||
.downloadbox table { font-size: 9pt; border:1px solid #2b6600; margin: 4px; padding:4; background-color: #e0f2d0; }
|
||||
|
@ -1,6 +1,7 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html><head>
|
||||
<meta content="text/html; charset=utf-8" http-equiv="content-type">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
|
||||
<link rel="shortcut icon" type="image/x-icon" href="/images/webbuild.ico" />
|
||||
<!-- styles needed by jScrollPane -->
|
||||
@ -11,6 +12,7 @@
|
||||
<script type="text/javascript" src="/scripts/jquery.mousewheel.js"></script>
|
||||
<!-- the jScrollPane script -->
|
||||
<script type="text/javascript" src="/scripts/jquery.jscrollpane.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/styles/webbuild-standalone.css">
|
||||
<link rel="stylesheet" type="text/css" href="/styles/webbuild.css">
|
||||
<script type="text/javascript" src="/scripts/socialbox.js"></script>
|
||||
<script>
|
||||
@ -259,39 +261,33 @@ function ajaxFileUpload(request)
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
<link rel="stylesheet" type="text/css" href="/styles/webbuild-post.css">
|
||||
|
||||
</head><body>
|
||||
<table width="100%">
|
||||
<tr><td>
|
||||
<span class=webbuild>
|
||||
<div id=container style="position:relative;width:894px;height:auto;top:0;left:0;margin-left:auto;margin-right:auto;">
|
||||
<div class="webbuildcontainer">
|
||||
<form id=webbuildform name=webbuild method=post action="javascript:">
|
||||
<img src="/images/webbuild.png" alt="build automatici">
|
||||
<b>- Webbuild - Interfaccia Web per lo sviluppo di openmamba</b>
|
||||
|
||||
<span id="searchbox"></span>
|
||||
|
||||
|
||||
|
||||
<div style="position:relative;top:-30px;left:0;width:100%;height:100%;">
|
||||
<div id="searchbox"></div>
|
||||
<div class="chatpanel"><span id="chatpanel"></span></div>
|
||||
<div id="noajax_msg"><p>Il supporto per AJAX non è abilitato nel tuo browser. L'aggiornamento live non sarà disponibile, premi Ricarica per aggiornare la pagina.</p></div>
|
||||
<span id="status">Caricamento in corso, attendere...</span>
|
||||
<span id="topcontrols"></span><span id="environments"></span><span id="specedit"></span>
|
||||
<br><span id="repositories"></span>
|
||||
<span id="repositories"></span>
|
||||
<span id="packages"></span>
|
||||
<span id="operations"></span>
|
||||
<br><span id="speccreate"></span>
|
||||
<hr>
|
||||
<div style="position:relative;float:left;width:686px;padding:0;margin:1px;">
|
||||
<div class="processes"><div class="scroll-pane3"><span id="processes"></span></div></div><br>
|
||||
<span id="speccreate"></span>
|
||||
<div class="webbuildleft">
|
||||
<div class="webbuildprocesses"><div class="scroll-pane3"><span id="processes"></span></div></div>
|
||||
<div><span id="editor"></span></div>
|
||||
<span id="editcontrols"></span>
|
||||
<span id="showlogcontrols"></span>
|
||||
<span id="output"></span>
|
||||
</div>
|
||||
<div style="position:relative;float:right;width:200px;padding:0;margin:1px;">
|
||||
<div class="webbuildright">
|
||||
<div class="socialbox"><div class="scroll-pane"><span id="socialbox"></span></div></div>
|
||||
<span id="operationpanel" style="margin:0;"></span>
|
||||
<span id="chatpanel"></span>
|
||||
<span id="operationpanel"></span>
|
||||
</div>
|
||||
<div style="clear:both"></div>
|
||||
<span id="window"></span>
|
||||
@ -305,6 +301,4 @@ ajax_getvalues_refresh("",user,user_email,encodeURIComponent(secret));
|
||||
//setInterval("ajax_getvalues_refresh(\"\",user,user_email,encodeURIComponent(secret))",0);
|
||||
</script>
|
||||
<br><br><br><br><br><br>
|
||||
</td></tr>
|
||||
</table>
|
||||
</body></html>
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# webbuild cgi script
|
||||
# Copyright (c) 2012-2015 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
# Copyright (c) 2012-2020 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
#
|
||||
. /usr/share/autodist/webbuild-functions
|
||||
. /usr/share/autodist/webbuild-functions-private
|
||||
@ -49,18 +49,14 @@ if [ "$USER" ]; then
|
||||
if [ "$SECRET" = "$USER_SECRET" ]; then
|
||||
[ "$REMOTE_ADDR" = "127.0.0.1" -o "$USER_SECRET" ] && USER_ENABLED=1 || USER_ENABLED=
|
||||
elif [ "$REQUEST" = "password" ]; then
|
||||
if [ "$USER_SECRET" ]; then
|
||||
/usr/libexec/webbuild-checkpassword "$PASSWORD" "$USER_SECRET" 2>/dev/null
|
||||
else
|
||||
/usr/libexec/webbuild-checkpassword "$PASSWORD" "$SECRET" 2>/dev/null
|
||||
fi
|
||||
/usr/libexec/webbuild-checkpassword "$PASSWORD" "$SECRET" 2>/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
if [ ! "$USER_SECRET" ]; then
|
||||
tmpfile=`mktemp --suffix=webbuildtmp`
|
||||
cat $WEBBUILD_STATEDIR/users/$USER.conf > $tmpfile
|
||||
USER_SECRET=$SECRET
|
||||
tmpfile=`mktemp --suffix=webbuildtmp`
|
||||
cat $WEBBUILD_STATEDIR/users/$USER.conf > $tmpfile
|
||||
sed -i "/USER_SECRET=/d" $tmpfile
|
||||
echo "USER_SECRET='$SECRET'" >> $tmpfile
|
||||
$SUDO_WRAPPER 0 local "$USER" "" "mv $tmpfile $WEBBUILD_STATEDIR/users/$USER.conf"
|
||||
fi
|
||||
USER_ENABLED=1
|
||||
else
|
||||
USER_ENABLED=
|
||||
@ -141,12 +137,6 @@ if [ "$USER_ENABLED" != "1" -a "${REQUEST:0:7}" != "refresh" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ -e $WEBBUILD_STATEDIR/webbuild.state ]; then
|
||||
. $WEBBUILD_STATEDIR/users/webbuild.state
|
||||
else
|
||||
touch $WEBBUILD_STATEDIR/users/webbuild.state
|
||||
fi
|
||||
|
||||
if [ "$USER_ADMIN" -a "$FAKEUSERSWITCH" != "" ]; then
|
||||
if [ "$FAKEUSERSWITCH" = "_disabled_" ]; then
|
||||
set_user_state_var STATE_FAKEUSER
|
||||
@ -213,39 +203,41 @@ fi
|
||||
if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshsocial" -o ! "$USER" ]; then
|
||||
if [ "$WEBBUILD_URL" -a "${WEBBUILD_URL/\/localhost\//}" = "$WEBBUILD_URL" ]; then
|
||||
curl -s "$WEBBUILD_URL?REQUEST=refreshsocial&USER=$USER&SECRET=`cgi_encodevar \"$USER_SECRET\"`&USER_EMAIL=$USER_EMAIL&FROMID=$FROMID"
|
||||
else
|
||||
[ -e "$WEBBUILD_STATEDIR/social_log" ] || exit
|
||||
else
|
||||
[ -e "$WEBBUILD_STATEDIR/webbuild.db" ] || exit
|
||||
# social box
|
||||
echo -n "<socialbox>"
|
||||
count=0
|
||||
SID=0
|
||||
if [ ! "$FROMID" -o "$FROMID" = "0" -o "$FROMID" = "NaN" ]; then
|
||||
# Find id of last row - 25
|
||||
if [ "$USER" ]; then
|
||||
line=`tail -n 500 $WEBBUILD_STATEDIR/social_log | grep -v " SUSER=$USER " 2>/dev/null | tail -n 25 | head -n 1`
|
||||
LASTID_QUERY="SELECT id FROM (SELECT id FROM social_log WHERE user!='$USER' ORDER BY id DESC LIMIT 25) sub ORDER BY id ASC LIMIT 1;"
|
||||
else
|
||||
line=`tail -n 500 $WEBBUILD_STATEDIR/social_log | grep -v " STARGET=developers " 2>/dev/null | tail -n 25 | head -n 1`
|
||||
LASTID_QUERY="SELECT id FROM (SELECT id FROM social_log WHERE target!='developers' ORDER BY id DESC LIMIT 25) sub ORDER BY id ASC LIMIT 1;"
|
||||
fi
|
||||
eval $line
|
||||
FROMID=$SID
|
||||
FROMID=`sqlite3 $WEBBUILD_STATEDIR/webbuild.db "$LASTID_QUERY"`
|
||||
fi
|
||||
tail -n 100 $WEBBUILD_STATEDIR/social_log | while read line; do
|
||||
STYPE=
|
||||
SPRIVACY=
|
||||
SUSER=
|
||||
STARGET=
|
||||
SID=
|
||||
eval $line
|
||||
[ "$SID" ] || continue
|
||||
[ $SID -ge $FROMID ] || continue
|
||||
sqlite3 $WEBBUILD_STATEDIR/webbuild.db "SELECT *,strftime('%s',time) FROM social_log WHERE id>$FROMID LIMIT 100" | while read line; do
|
||||
SAVEIFS=$IFS
|
||||
IFS="|"
|
||||
set -- $line
|
||||
SID="$1"
|
||||
SPRIVACY="$2"
|
||||
SUSER="$3"
|
||||
STYPE="$4"
|
||||
STARGET="$5"
|
||||
SEMAIL="$6"
|
||||
STEXT="$7"
|
||||
STIME="$9"
|
||||
[ "$STARGET" = "developers" -a ! "$USER" ] && continue
|
||||
[ "$SUSER" = "$USER" -a "$STARGET" == "developers" ] && continue
|
||||
[ "$SUSER" = "$USER" -a "$STARGET" = "developers" ] && continue
|
||||
if [ "$SPRIVACY" -a ! "$USER" ]; then
|
||||
USER_GRAVATAR=
|
||||
else
|
||||
USER_GRAVATAR=`echo -n $SEMAIL | md5sum | sed "s| .*||"`
|
||||
fi
|
||||
echo -n "<add id=\"$SID\"><![CDATA[<div style=\"margin:0;padding:0;\"><div style=\"vertical-align:middle;position:relative;float:left;height:24px;width:24px;margin-right:2px;\">"
|
||||
echo -n "<img src=\"http://www.gravatar.com/avatar/$USER_GRAVATAR?s=24&d=http://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=24\" /></div>"
|
||||
echo -n "<img src=\"https://www.gravatar.com/avatar/$USER_GRAVATAR?s=24&d=https://www.gravatar.com/avatar/ad516503a11cd5ca435acc9bb6523536?s=24\" /></div>"
|
||||
if [ "$SPRIVACY" -a ! "$USER" ]; then
|
||||
SUSER="a developer"
|
||||
elif [ "$USER" = "$SUSER" ]; then
|
||||
@ -253,13 +245,12 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshsocial" -o ! "$USER" ]; then
|
||||
fi
|
||||
echo -n "<div style=\"position:relative;margin-left:24px;height:auto;padding:0;\"><b>$SUSER</b> $STEXT <i><span name=socialtime time=$STIME></span></i></div>"
|
||||
echo -n "</div><div style=\"clear:both;\"><hr></div>]]></add>"
|
||||
count=$(($count + 1))
|
||||
done
|
||||
echo -n "</socialbox>"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$USER_ENABLED" != "1" ]; then
|
||||
if [ "$USER_ENABLED" != "1" -o "$REQUEST" = "refreshsocial" ]; then
|
||||
echo -n "</webbuild>"
|
||||
exit
|
||||
fi
|
||||
@ -361,6 +352,7 @@ fi
|
||||
|
||||
# refresh processes list
|
||||
if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then
|
||||
|
||||
echo -n "<processes><![CDATA["
|
||||
if [ "$USER_ADMIN" -a -s $WEBBUILD_STATEDIR/requests ]; then
|
||||
echo -n "<div align=left class=processes><b>Pending admin requests:</b>"
|
||||
@ -381,43 +373,63 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then
|
||||
echo -n "</div>"
|
||||
fi
|
||||
|
||||
# echo -n "<div align=left class=processes>"
|
||||
u="$(uptime)"
|
||||
f="$(df / -k -h --output=avail,pcent|tail -n1)"
|
||||
b=`ps ax|grep "rpmbuild .*\.spec$"|while read l; do basename "${l/.spec}"; done`
|
||||
echo -n "Load: <b>${u/*: }</b> | Disk: <b>$f</b> | "
|
||||
[ "$b" ] && echo -n "Building now: <b>$b</b> | "
|
||||
[ "`ps cax|grep dnf`" ] && echo "<b style=\"color:red\">Updating</b> | "
|
||||
if [ "$STATE_JOBSSHOWALL" != "1" ]; then
|
||||
echo "$USER's jobs: [<a href=# onclick=ajax_getvalues(\"REQUEST=refreshjobs&JOBSSHOWALL=true\");>Show all jobs</a>]"
|
||||
else
|
||||
echo "All jobs: [<a href=# onclick=ajax_getvalues(\"REQUEST=refreshjobs&JOBSSHOWALL=false\");>Only show my jobs</a>]"
|
||||
fi
|
||||
echo -n "<br>"
|
||||
|
||||
numprocess=0
|
||||
tac $WEBBUILD_STATEDIR/processes | \
|
||||
while read line; do
|
||||
set -- $line
|
||||
RETCODE=$6
|
||||
CMDPID=$1
|
||||
CMDUSER=$2
|
||||
PROCESSLOG=$5
|
||||
# if [ -e /proc/$1 -o $5 -lt 256 ]; then
|
||||
ORIGRETCODE=$6
|
||||
NOTIFIED=
|
||||
if [ "${ORIGRETCODE: -1}" == "+" ]; then
|
||||
NOTIFIED=1
|
||||
RETCODE="${ORIGRETCODE::-1}"
|
||||
else
|
||||
RETCODE=$ORIGRETCODE
|
||||
fi
|
||||
numprocess=$(($numprocess + 1))
|
||||
cmdline=`echo "$line" | sed "s|$1 $2 $3 $4 $5 $RETCODE ||"`
|
||||
cmdline=`echo "$line" | sed "s|$1 $2 $3 $4 $5 $ORIGRETCODE ||"`
|
||||
cmdline=`echo "$cmdline" | sed "s| --colors web||"`
|
||||
PACKAGE_ENCODED=`cgi_encodevar $4`
|
||||
[ $numprocess -eq 1 ] && {
|
||||
# echo -n "<div align=left class=processes>"
|
||||
echo -n "<b>Webbuild jobs:</b> "
|
||||
if [ "$STATE_JOBSSHOWALL" != "1" ]; then
|
||||
echo "[ <a href=# onclick=ajax_getvalues(\"REQUEST=refreshjobs&JOBSSHOWALL=true\");>Show all</a> ]"
|
||||
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 jobs when they are done)</i>"
|
||||
echo -n "<br>"
|
||||
}
|
||||
[ "$STATE_JOBSSHOWALL" = "1" -o "$USER" = "$2" ] || continue
|
||||
if [ $RETCODE -eq 256 -a -e /proc/$1 ]; then
|
||||
echo -n "<img style=\"margin-top:-1px;margin-right:2px;\" width=10 height=10 src=\"/images/inprogress.gif\" alt=\"running...\" title=\"running...\">"
|
||||
elif [ ! -e $PROCESSLOG ]; then
|
||||
sed -i "\,$1 $USER.* $PROCESSLOG ,d" $WEBBUILD_STATEDIR/processes
|
||||
sed -i "\,$CMDPID $CMDUSER.* $PROCESSLOG ,d" $WEBBUILD_STATEDIR/processes
|
||||
continue
|
||||
else
|
||||
if [ $RETCODE -eq 256 ]; then
|
||||
$SUDO_WRAPPER finishprocess $1 "$USER" $5
|
||||
RETCODE=$?
|
||||
fi
|
||||
# Process finished: add + to retcode to report notification
|
||||
if [ ! "$NOTIFIED" ]; then
|
||||
sed -i "s|^\($CMDPID $CMDUSER.* $PROCESSLOG $RETCODE\)|\1\+|" $WEBBUILD_STATEDIR/processes
|
||||
fi
|
||||
CMDEMAIL=`grep "USER_EMAIL" $WEBBUILD_STATEDIR/users/$CMDUSER.conf|sed "s|USER_EMAIL=||"`
|
||||
if [ $RETCODE -eq 0 ]; then
|
||||
[ "$NOTIFIED" ] || \
|
||||
social_log "SUSER=$CMDUSER STYPE=job SEMAIL=$CMDEMAIL STEXT=\"''$cmdline'' <b>succesfully completed</b>!\" STIME=`date +%s`" >> /tmp/y
|
||||
# echo -n "<font color=lightgreen><b>OK</b></font>"
|
||||
echo -n "<img style=\"margin-top:-1px;margin-right:2px;\" src=\"/images/ok.png\" width=10 height=10 alt=\"OK\" title=\"Job successfully completed\">"
|
||||
else
|
||||
[ "$NOTIFIED" ] || \
|
||||
social_log "SUSER=$CMDUSER STYPE=job SEMAIL=$CMDEMAIL STEXT=\"''$cmdline'' <b>failed</b>\" STIME=`date +%s`"
|
||||
# echo -n "<font color=red><b>ERROR ($RETCODE)</b></font>"
|
||||
echo -n "<img style=\"margin-top:-1px;margin-right:2px;\" src=\"/images/fail.png\" width=10 height=10 alt=\"ERROR\" title=\"Job returned with error $RETCODE\">"
|
||||
fi
|
||||
@ -456,7 +468,7 @@ fi
|
||||
if [ "$REQUEST" = "message" -a "$USER" -a "$USER_CANSENDMESSAGES" ]; then
|
||||
# external (autodist) social messages
|
||||
[ "$MESSAGETYPE" ] || MESSAGETYPE=broadcastmessage
|
||||
social_log "SUSER=$USER STYPE=$MESSAGETYPE SEMAIL=$USER_EMAIL STEXT=\"$MESSAGE\" STIME=`date +%s`"
|
||||
social_log "SUSER=$USER STYPE=$MESSAGETYPE STARGET=\"$TARGET\" SEMAIL=$USER_EMAIL STEXT=\"$MESSAGE\" STIME=`date +%s`"
|
||||
echo "</webbuild>"
|
||||
exit
|
||||
fi
|
||||
@ -464,7 +476,7 @@ fi
|
||||
# repsearch request
|
||||
if [ "$REQUEST" = "repsearch" ]; then
|
||||
echo -n "<output><![CDATA["
|
||||
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 "<hr><b>Search results for \"$REPSEARCHTEXT\":</b><div align=left class=\"outputbox\" id=outputtop style=\"font-family:serif;color:black;background-color:#E0F2D0;\">"
|
||||
# echo -n "<pre><!-- SCROLL -->"
|
||||
REPSEARCHTEXT_FMT=`echo "${REPSEARCHTEXT}" | sed "s|[[:space:]]|+|g"`
|
||||
curl -s "${WEBBUILD_DISTROQUERY_URL}?query=${REPSEARCHTEXT_FMT}&search_milestone2=true&search_milestone3=true&search_devel=true\
|
||||
@ -483,7 +495,7 @@ fi
|
||||
# environment search request
|
||||
if [ "$REQUEST" = "environmentsearch" ]; then
|
||||
echo -n "<output><![CDATA["
|
||||
echo -n "<hr><b>Environment search results for \"$ENVSEARCHTEXT\":</b><div align=left class=output id=outputtop>"
|
||||
echo -n "<hr><b>Environment search results for \"$ENVSEARCHTEXT\":</b><div align=left class=\"outputbox\" id=outputtop>"
|
||||
echo -n "<pre><!-- SCROLL -->"
|
||||
echo -n "<font style=\"background-color:gray\">Installed packages providing '$ENVSEARCHTEXT':</font><br>"
|
||||
WHAT_PROVIDES=`$SUDO_WRAPPER binary $ENVIRONMENT "$USER" "" "rpm -q --what-provides \"$ENVSEARCHTEXT\"" | sort -u`
|
||||
@ -523,9 +535,17 @@ if [ "$REQUEST" = "rpmmanager" ]; then
|
||||
echo -n "<option value=\"RPMS\" $SELECTED>Local *.${AUTOPORT_ARCH[$ENVIRONMENT]}.rpm</option>"
|
||||
[ "$RPMMANAGERDIR" = "RPMSNOARCH" ] && SELECTED="selected=selected" || SELECTED=
|
||||
echo -n "<option value=\"RPMSNOARCH\" $SELECTED>Local *.noarch.rpm</option>"
|
||||
if [ "${AUTOPORT_ARCH[$ENVIRONMENT]}" == "x86_64" ]; then
|
||||
[ "$RPMMANAGERDIR" = "RPMS_i586" ] && SELECTED="selected=selected" || SELECTED=
|
||||
echo -n "<option value=\"RPMS_i586\" $SELECTED>Local *.i586.rpm</option>"
|
||||
fi
|
||||
if [ "${AUTOPORT_ARCH[$ENVIRONMENT]}" == "x86_64" -o "${AUTOPORT_ARCH[$ENVIRONMENT]}" == "i586" ]; then
|
||||
[ "$RPMMANAGERDIR" = "RPMS_arm" ] && SELECTED="selected=selected" || SELECTED=
|
||||
echo -n "<option value=\"RPMS_arm\" $SELECTED>Local *.arm.rpm</option>"
|
||||
fi
|
||||
[ "$RPMMANAGERDIR" = "SRPMS" ] && SELECTED="selected=selected" || SELECTED=
|
||||
echo -n "<option value=\"SRPMS\" $SELECTED>Local *.src.rpm</option>"
|
||||
if [ -e $local_ftp/$REPOSITORY ]; then
|
||||
if [ "$REPOSITORY" -a -e $local_ftp/$REPOSITORY ]; then
|
||||
[ "$RPMMANAGERDIR" = "REP_RPMS" ] && SELECTED="selected=selected" || SELECTED=
|
||||
echo -n "<option value=\"REP_RPMS\" $SELECTED>$REPOSITORY *.${AUTOPORT_ARCH[$ENVIRONMENT]}.rpm</option>"
|
||||
[ "$RPMMANAGERDIR" = "REP_RPMSNOARCH" ] && SELECTED="selected=selected" || SELECTED=
|
||||
@ -660,7 +680,7 @@ echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAG
|
||||
echo -n "REQUEST=rpmmanager\");>"
|
||||
# expert mode checkbox
|
||||
[ "$STATE_ADVANCEDCONTROLS" ] && CHECKED="checked=checked" || CHECKED=
|
||||
echo -n " <span style=\"white-space:nowrap\">Autodist:<input type=checkbox id=\"advancedcontrols\" "
|
||||
echo -n " <span>Autodist:<input type=checkbox id=\"advancedcontrols\" "
|
||||
echo -n "onclick=ajax_getvalues(\""
|
||||
echo -n "ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
|
||||
echo -n "MAINTAINERMODE=\"+getElementById('maintain').checked+\"&"
|
||||
@ -733,7 +753,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" -o "$REQUEST" = "edit" ]; then
|
||||
-o "$REQUEST" = "prepare" -o "$REQUEST" = "reloadspec" -o "$REQUEST" = "edit" \
|
||||
-o "$REQUEST" = "reloadspeclist" -o "$REQUEST" = "prepare" ]; then
|
||||
# SPECFILES select
|
||||
echo -n "<specedit><![CDATA["
|
||||
echo -n " Edit:<select id=specfile "
|
||||
@ -745,7 +766,11 @@ elif [ ! "$REQUEST" -o "$REQUEST" = "changeenvironment" -o "$REQUEST" = "switchm
|
||||
[ "$PACKAGE" = "$specname" ] && SELECTED="selected=\"selected\"" || SELECTED=
|
||||
echo -n "<option value=\"$specname\" $SELECTED>${specname}</option>"
|
||||
done
|
||||
echo -n "</select>.spec]]></specedit>"
|
||||
echo -n "</select>.spec"
|
||||
echo -n " <img class=\"button\" src=\"/images/refresh.png\" alt=\"Refresh\" title=\"Refresh spec list\" onclick="
|
||||
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
|
||||
echo -n "MAINTAINERMODE=$MAINTAINERMODE&REQUEST=reloadspeclist\");></img>"
|
||||
echo -n "]]></specedit>"
|
||||
fi
|
||||
|
||||
[ "$PACKAGE" -a ! "$REQUEST" ] && REQUEST=edit
|
||||
@ -767,9 +792,9 @@ if [ ! "$REPSEARCHTEXT" ]; then
|
||||
# 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 "<br><input type=text 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 "<br><input type=text id=\"repsearchtext\" value=\"Enter a package name to search...\" "
|
||||
echo -n "onfocus=\"if (this.value==this.defaultValue) this.value=''\" "
|
||||
fi
|
||||
echo -n "onkeypress=if(checkEnter(event))ajax_getvalues(\""
|
||||
@ -949,7 +974,7 @@ if [ "$MAINTAINERMODE" = "true" -o ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then
|
||||
|
||||
# SPECFILE creation
|
||||
if [ ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -a "$MAINTAINERMODE" != "true" ]; then
|
||||
echo -n "<speccreate><![CDATA[<div style=\"white-space:nowrap;\">"
|
||||
echo -n "<speccreate><![CDATA[<div class=\"speccreate\">"
|
||||
echo -n " Start from URL:<input onChange=\"suggestSpecName()\" type=text id=speccreateurl value=\"\" style=\"width:32%\">"
|
||||
echo -n " name:<input type=text id=speccreatename disabled value=\"\" style=\"width:10%\">"
|
||||
echo -n " type:<select id=speccreatetype disabled>"
|
||||
@ -996,7 +1021,7 @@ if [ "$SPECTEXT" ]; then
|
||||
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>"
|
||||
echo -n "<output><![CDATA[<div class=\"outputbox\">ERROR: could not save file ${PACKAGE/*\/}.spec! Please report the problem, thanks.</div>]]></output></webbuild>"
|
||||
exit 1
|
||||
}
|
||||
rm -f $tmpfile
|
||||
@ -1017,7 +1042,7 @@ if [ "$REQUEST" = "prepare" -o "$REQUEST" = "updatespec" -o "$REQUEST" = "speccr
|
||||
else
|
||||
OUTPUTMODE="outputbottom"
|
||||
fi
|
||||
echo -n "<output><![CDATA[<hr><b>Console output:</b><div align=left class=output id=$OUTPUTMODE>"
|
||||
echo -n "<output><![CDATA[<hr><b>Console output:</b><div align=left class=\"outputbox\" id=$OUTPUTMODE>"
|
||||
echo -n "<pre>"
|
||||
RET=255
|
||||
case $REQUEST in
|
||||
@ -1042,7 +1067,7 @@ if [ "$REQUEST" = "prepare" -o "$REQUEST" = "updatespec" -o "$REQUEST" = "speccr
|
||||
"speccreate") if [ "$SPECCREATEURL" -a "$PACKAGE" ]; then
|
||||
FOUND_EXISTING=`curl -s "${WEBBUILD_DISTROQUERY_URL}?package=$PACKAGE&search_milestone2=true&search_milestone3=true&search_devel=true&search_sources=true&query_compact=true&replyplain=true&searchbox=false"`
|
||||
if [ "$FOUND_EXISTING" != "" ]; then
|
||||
echo -n "<div align=left class=output id=outputtop style=\"font-family:serif;color:black;background-color:#E0F2D0;\">"
|
||||
echo -n "<div align=left class=\"output\" id=outputtop style=\"font-family:serif;color:black;background-color:#E0F2D0;\">"
|
||||
echo "<b><font color=red>ERROR: package already exists, please update from appropriate version:</font><b>"
|
||||
echo -n "<hr><b>Search results for \"$PACKAGE\":</b>$FOUND_EXISTING"
|
||||
echo -n "</div>"
|
||||
@ -1196,7 +1221,7 @@ fi
|
||||
|
||||
if [ "$PACKAGE" ]; then
|
||||
[ "$AUTODISTJOB" ] || AUTODISTJOB=${PACKAGE/\/*}
|
||||
AUTODISTJOB="${AUTODISTJOB/-/_}"
|
||||
AUTODISTJOB="${AUTODISTJOB//[-]/_}"
|
||||
PACKAGE=${PACKAGE/*\/}
|
||||
eval `$SUDO_WRAPPER specinfo $ENVIRONMENT "$USER" $PACKAGE ""`
|
||||
[ $? -eq 0 ] && SPECAVAILABLE=1
|
||||
@ -1242,7 +1267,7 @@ fi
|
||||
# operation panel
|
||||
if [ "$MAINTAINERMODE" != "true" ]; then
|
||||
echo -n "<operationpanel><![CDATA["
|
||||
echo -n "<div style=\"margin-top:140px;background-color:#E0F2D0;border:1px;\">"
|
||||
echo -n "<div class=\"operationpanelinfo\">"
|
||||
if [ "$PACKAGE" ]; then
|
||||
echo -n "Package: <b>$PACKAGE</b><br>Version: "
|
||||
[ "${SPECVAR_Epoch[0]}" ] && echo -n "${SPECVAR_Epoch[0]}:"
|
||||
@ -1250,7 +1275,8 @@ if [ "$MAINTAINERMODE" != "true" ]; then
|
||||
fi
|
||||
showEnvironmentPanel
|
||||
echo -n "</div>"
|
||||
echo -n "<br><b>Build/Send options:</b><br>Arch:<select id=rpmbuildarch>"
|
||||
echo -n "<div class=\"operationpanelsend\">"
|
||||
echo -n "<b>Build/Send options:</b><br>Arch:<select id=rpmbuildarch>"
|
||||
for f in i586 arm x86_64 ppc; do
|
||||
SELECTED=
|
||||
if [ "$f" = "$RPMBUILDARCH" ]; then
|
||||
@ -1287,8 +1313,8 @@ if [ "$MAINTAINERMODE" != "true" ]; then
|
||||
fi
|
||||
echo -n "<option value=\"$repname\" $SELECTED>$repname</option>"
|
||||
done
|
||||
echo -n "</select><br>"
|
||||
[ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -o "$STATE_ADVANCEDCONTROLS" ] && echo -n "<br><div style=\"background-color:#FFFFDE\"><b>Autodist batch builds:</b><br>"
|
||||
echo -n "</select></div>"
|
||||
[ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -o "$STATE_ADVANCEDCONTROLS" ] && echo -n "<div class=\"operationpanelautodist\"><b>Autodist batch builds:</b><br>"
|
||||
if [ "$PACKAGE" ]; then
|
||||
if [ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then
|
||||
echo -n "Patch for $PACKAGE:<br>"
|
||||
@ -1337,10 +1363,10 @@ if [ "$MAINTAINERMODE" != "true" ]; then
|
||||
if [ "$AUTODISTJOB" -a "$AUTODISTJOB" = "$f" ]; then
|
||||
SELECTED="selected=\"selected\""
|
||||
AUTODISTJOBSELECTED=1
|
||||
elif [ "$PACKAGE" = "$f" -a ! "$AUTODISTJOB" ]; then
|
||||
elif [ "${PACKAGE}" = "$f" -a ! "$AUTODISTJOB" ]; then
|
||||
# elif [ "$PACKAGE" = "$f" -a ! "$AUTODISTJOBSELECTED" -a "$REQUEST" != "autodistjobchange" ]; then
|
||||
SELECTED="selected=\"selected\""
|
||||
AUTODISTJOB=$f
|
||||
AUTODISTJOB=${f//[-]/_}
|
||||
AUTODISTJOBSELECTED=1
|
||||
fi
|
||||
JOBENCODED=`cgi_encodevar $f`
|
||||
@ -1352,7 +1378,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then
|
||||
echo -n "<option value=\"$PACKAGEENCODED\" $SELECTED>$PACKAGE (defaults)</option>"
|
||||
fi
|
||||
echo -n "</select>"
|
||||
if [ "$AUTODISTJOBSELECTED" -a "$AUTODISTJOB" = "$PACKAGE" ]; then
|
||||
if [ "$AUTODISTJOBSELECTED" -a "$AUTODISTJOB" = "${PACKAGE//[-]/_}" ]; then
|
||||
echo -n "<br><font color=red>You should use autodist for this package!</font>"
|
||||
fi
|
||||
if [ "$AUTODISTJOB" ]; then
|
||||
@ -1411,17 +1437,22 @@ if [ "$MAINTAINERMODE" != "true" ]; then
|
||||
echo -n "`cgi_encodevar "</b> job in current environment?"`\""
|
||||
echo -n "); class=redbutton $DISABLED>"
|
||||
# autodist send
|
||||
[ ! "$USER_ALLREPOSITORIES" ] && DISABLED="disabled=disabled" || DISABLED=
|
||||
if [ "$SPECVAR_CHECK_NOAUTOBUILDREQ" ]; then
|
||||
HREFADD="disabled=disabled title=\"WARNING: fix specfile build requirements before you can send the package\""
|
||||
else
|
||||
HREFADD=
|
||||
fi
|
||||
echo -n "<input type=button value=\"send\" onclick="
|
||||
echo -n "p=getCheckedValuesByName('autodistpkgscheckbox');ajax_getvalues(\""
|
||||
echo -n "AUTODISTFORCE=\"+getElementById('rpmforce').checked+\"&"
|
||||
echo -n "AUTODISTARCH=\"+getSelectedValueById('rpmbuildarch')+\"&"
|
||||
echo -n "AUTODISTJOB=\"+getSelectedValueById('autodistjobs')+\"&"
|
||||
echo -n "AUTODISTPKGS=\"+encodeURIComponent(p)+\"&"
|
||||
echo -n "SENDRECREATESRPM=true&"
|
||||
echo -n "SENDREPOSITORY=\"+getSelectedValueById('sendrepository')+\"&"
|
||||
echo -n "ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autodistsend\""
|
||||
echo -n ",\"`cgi_encodevar "Send selected packages for <b>"`\"+getSelectedValueById('autodistjobs')+\"`cgi_encodevar "</b> job to <b>"`\"+"
|
||||
echo -n "getSelectedValueById('sendrepository')+\"`cgi_encodevar "</b>?"`\"); class=redbutton $DISABLED>"
|
||||
echo -n "getSelectedValueById('sendrepository')+\"`cgi_encodevar "</b>?"`\"); class=redbutton $HREFADD>"
|
||||
# autodist schedule
|
||||
echo -n "<br>New version:<input type=text id=autodistversion value=\"\" style=\"width:20%\"> "
|
||||
echo -n "<input type=button value=\"schedule job\" onclick="
|
||||
@ -1463,8 +1494,9 @@ if [ "$MAINTAINERMODE" != "true" ]; then
|
||||
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autoportlog\");>"
|
||||
fi
|
||||
fi
|
||||
[ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -o "$STATE_ADVANCEDCONTROLS" ] && echo -n "</div>"
|
||||
if [ "$PACKAGE" ]; then
|
||||
echo -n "<hr><div style=\"background-color:#E0F2D0\">"
|
||||
echo -n "<div class=\"operationpanelpatches\">"
|
||||
## check for updates
|
||||
#echo -n "<input type=button value=\"check for updates\" onclick="
|
||||
#echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autospecupdatescheck&"
|
||||
@ -1484,21 +1516,22 @@ if [ "$MAINTAINERMODE" != "true" ]; then
|
||||
echo -n "ADDPATCHNAME=\"+encodeURIComponent(getElementById('addpatchname').value));>"
|
||||
echo -n " <a href=\"http://pastebin.com\" target=_new>pastebin</a><br>"
|
||||
echo -n "URL:<input type=text id=addpatchurl value=\"\" style=\"width:80%\">"
|
||||
echo -n "<br><div style=\"white-space:nowrap;font-size:9px;width:100%;overflow:hidden\"><span style=\"float:left;margin-top:6px;\">$PACKAGE-${SPECVAR_Version}-</span>"
|
||||
echo -n "<br><div style=\"white-space:nowrap;font-size:9pt;width:100%;overflow:hidden\"><span style=\"float:left;margin-top:6px;\">$PACKAGE-${SPECVAR_Version}-</span>"
|
||||
echo -n "<span style=\"display:block;float:right;margin-top:6px;\">.patch</span>"
|
||||
echo -n "<span style=\"display:block;overflow:hidden;padding-right:5px;\"><input type=text id=addpatchname value=\"\" style=\"width:100%\"></span></div>"
|
||||
echo -n "</div>"
|
||||
# upload sources
|
||||
echo -n "<hr><b>Upload source:</b>"
|
||||
echo -n "<div class=\"operationpanelupload\"><b>Upload source:</b>"
|
||||
echo -n "<form name=\"form\" action=\"javascript:\" method=\"POST\" enctype=\"multipart/form-data\">"
|
||||
echo -n "<input id=\"fileToUpload\" type=\"file\" size=\"10\" name=\"fileToUpload\" class=\"input\">"
|
||||
echo -n "<button class=\"button\" id=\"buttonUpload\" onclick=ajaxFileUpload(\""
|
||||
echo -n "<input type=\"button\" class=\"button\" id=\"buttonUpload\" onclick=ajaxFileUpload(\""
|
||||
echo -n "REQUEST=uploadsource&ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
|
||||
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&"
|
||||
echo -n "UPLOADFILENAME=\"+encodeURIComponent(getElementById('fileToUpload').value));>Upload</button>"
|
||||
echo -n "UPLOADFILENAME=\"+encodeURIComponent(getElementById('fileToUpload').value)); value=\"Upload\">"
|
||||
echo -n "</form>"
|
||||
echo -n "</div>"
|
||||
# info from package sources
|
||||
echo -n "<hr><div style=\"background-color:#A7DEDE\">"
|
||||
echo -n "<div class=\"operationpanelpackageinfo\">"
|
||||
echo -n "<b>Info from package in the works:</b><br>"
|
||||
# show sources
|
||||
echo -n "<select id=sourcefile style=\"width:98%\" onchange="
|
||||
@ -1553,9 +1586,10 @@ if [ "$MAINTAINERMODE" != "true" ]; then
|
||||
echo -n "<span style=\"display:block;overflow:hidden;padding-right:5px;\">"
|
||||
echo -n "<input type=text id=pkgnote value=\"\" style=\"width:100%\">"
|
||||
echo -n "</span>"
|
||||
echo -n "</div>"
|
||||
|
||||
# generic info
|
||||
echo -n "<hr><b>Generic info:</b><br>"
|
||||
echo -n "<div class=\"operationpanelgenericinfo\"><b>Generic info:</b><br>"
|
||||
# allowed groups
|
||||
echo -n "<input type=button value=\"allowed groups\" onclick="
|
||||
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=allowedgroups\");>"
|
||||
@ -1584,16 +1618,15 @@ if [ "$MAINTAINERMODE" != "true" ]; then
|
||||
done
|
||||
echo -n "</select></div>"
|
||||
echo -n "</div>"
|
||||
|
||||
fi
|
||||
echo -n "<hr><b>Host maintainance:</b><br>"
|
||||
echo -n "<div class=\"operationpanelhost\"><b>Host maintainance:</b><br>"
|
||||
## run ldconfig
|
||||
#echo -n "<input type=button id=runldconfig value=\"run ldconfig\" onclick="
|
||||
#echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
|
||||
#echo -n "REQUEST=runldconfig\");>"
|
||||
|
||||
# environment search
|
||||
echo -n "<div style=\"white-space:nowrap;width:100%;\">Provides:<input type=text style=\"width:75%;align:center;padding:0;margin:2px;\" id=environmentsearch value=\"Search package or provide...\" "
|
||||
echo -n "<div style=\"white-space:nowrap;width:100%;\">Provides:<input type=text style=\"width:75%;\" id=\"environmentsearch\" value=\"Search package or provide...\" "
|
||||
echo -n "onfocus=\"if (this.value==this.defaultValue) this.value=''\" "
|
||||
echo -n "onkeypress=if(checkEnter(event))ajax_getvalues(\""
|
||||
echo -n "ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
|
||||
@ -1604,14 +1637,14 @@ if [ "$MAINTAINERMODE" != "true" ]; then
|
||||
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
|
||||
echo -n "REQUEST=smartupgrade\""
|
||||
echo -n ",\"`cgi_encodevar "Upgrade current environment to latest updates now?"`\"); class=redbutton>"
|
||||
|
||||
echo -n "</div>"
|
||||
echo -n "]]></operationpanel>"
|
||||
fi
|
||||
|
||||
echo -n "<chatpanel><![CDATA["
|
||||
# broadcast message
|
||||
echo -n "<div style=\"position:absolute;width:220px;\">"
|
||||
echo -n "<textarea id=broadcastmessage style=\"font-family:sans;height:36px;width:80%;float:left;font-size:8pt;resize:none;\" "
|
||||
echo -n "<div class=\"chatpanel\">"
|
||||
echo -n "<textarea id=broadcastmessage style=\"height:40px;width:80%;float:left;resize:none;\" "
|
||||
echo -n "onfocus=\"if(this.value==this.defaultValue)this.value='';\">Chat with online developers...</textarea>"
|
||||
echo -n "<input type=button style=\"float:right\" onclick=ajax_getvalues(\""
|
||||
echo -n "ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
|
||||
@ -1626,7 +1659,7 @@ if [ "$REQUEST" != "" ]; then
|
||||
echo -n "<b>Console output ($REQUEST"
|
||||
[ "$PACKAGE" ] && echo -n " for $PACKAGE"
|
||||
echo -n "):</b>"
|
||||
echo -n "<div align=left class=output "
|
||||
echo -n "<div class=\"outputbox\" "
|
||||
if [ "$REQUEST" = "rpmbuild" -o "$REQUEST" = "autoportnp" -o "$REQUEST" = "rpmprepare" \
|
||||
-o "$REQUEST" = "sendpackage" -o "$REQUEST" = "sendsource" -o "$REQUEST" = "autospeclistcheck" \
|
||||
-o "$REQUEST" = "autodistbuild" -o "$REQUEST" = "autodistinstall" -o "$REQUEST" = "autodistsend" ]; then
|
||||
@ -1644,7 +1677,7 @@ case $REQUEST in
|
||||
"savespec") echo "File <b>$PACKAGE.spec</b> saved."
|
||||
RET=-1
|
||||
;;
|
||||
"smartupgrade") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "export LANG=C;sudo smart update && sudo smart upgrade"
|
||||
"smartupgrade") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "export LANG=C;sudo dnf update -y"
|
||||
RET=$?
|
||||
;;
|
||||
"runldconfig") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "export LANG=C;sudo /sbin/ldconfig"
|
||||
@ -1724,16 +1757,26 @@ case $REQUEST in
|
||||
;;
|
||||
"autodistsend") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="--force" || AUTODISTADD=
|
||||
autodistjobs=
|
||||
RET=0
|
||||
if [ "$AUTODISTPKGS" ]; then
|
||||
for p in $AUTODISTPKGS; do
|
||||
autodistjobs="$autodistjobs $AUTODISTJOB/$p"
|
||||
if [ "$SENDRECREATESRPM" = "true" ]; then
|
||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "$p" "rpmbuild -bs \
|
||||
--define=\"_topdir $SPECVAR_WORKINGHOME/RPM\" \
|
||||
$p.spec $RPMFORCEADD"
|
||||
RET=$?
|
||||
[ $RET -eq 0 ] || break
|
||||
fi
|
||||
done
|
||||
else
|
||||
autodistjobs="$AUTODISTJOB"
|
||||
fi
|
||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -s $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --server $SENDREPOSITORY --arch $AUTODISTARCH --user $USER $AUTODISTADD -- --colors web"
|
||||
RET=$?
|
||||
[ $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`"
|
||||
if [ $RET -eq 0 ]; then
|
||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -s $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --server $SENDREPOSITORY --arch $AUTODISTARCH --user $USER $AUTODISTADD -- --colors web"
|
||||
RET=$?
|
||||
[ $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`"
|
||||
fi
|
||||
;;
|
||||
"autoport") if [ "$AUTOPORTPACKAGE" ]; then
|
||||
if [ "$AUTOPORTRELEASEREPOSITORY" ]; then
|
||||
@ -1976,7 +2019,7 @@ $PACKAGE.spec $RPMFORCEADD && $AUTOSPEC_CMD -u $PACKAGE -a10 --server $SENDREPOS
|
||||
# fi
|
||||
fi
|
||||
;;
|
||||
"repositorymassrebuilddependant")
|
||||
"repositorymassrebuilddependent")
|
||||
if [ ! "$PACKAGES" ]; then
|
||||
echo "ERROR: no package(s) selected."
|
||||
RET=1
|
||||
@ -2045,6 +2088,14 @@ $PACKAGE.spec $RPMFORCEADD && $AUTOSPEC_CMD -u $PACKAGE -a10 --server $SENDREPOS
|
||||
show_docs `$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cd $SPECVAR_RPMBUILDDIR/$SPECVAR_BUILDDIR && find . $PATTERN -maxdepth 2"`
|
||||
RET=-1
|
||||
;;
|
||||
"consolecmd") if [ ! "$SPECVAR_BUILDDIR" ]; then
|
||||
echo "ERROR: BUILDDIR is undefined"
|
||||
RET=1
|
||||
else
|
||||
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cd $SPECVAR_RPMBUILDDIR/$SPECVAR_BUILDDIR && bash -c '$CONSOLECMD'"
|
||||
RET=$?
|
||||
fi
|
||||
;;
|
||||
"configurehelp") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cd $SPECVAR_RPMBUILDDIR/$SPECVAR_BUILDDIR && ./configure --help || ./waf configure --help"
|
||||
RET=$?
|
||||
[ $RET -eq 0 ] && RET=-1 ;;
|
||||
@ -2130,10 +2181,43 @@ fi
|
||||
if [ "$MAINTAINERMODE" = "true" ]; then
|
||||
echo -n "<packages> </packages>"
|
||||
echo -n "<operationpanel><![CDATA["
|
||||
echo -n "<div class=\"operationpanelinfo\">"
|
||||
echo "Repository: <b>$REPOSITORY</b><br>"
|
||||
showEnvironmentPanel
|
||||
echo -n "<hr>"
|
||||
echo -n "</div>"
|
||||
if [ "$REPOSITORY" ]; then
|
||||
echo -n "<b>Repository maintenance:</b><br>"
|
||||
# send options
|
||||
echo -n "<div class=\"operationpanelsend\"><b>Send options:</b>"
|
||||
# destination repository
|
||||
echo -n "<br>Destination: "
|
||||
echo -n "<select id=repositoryimportto>"
|
||||
if [ "${REPOSITORY:0:10}" = "milestone2" ]; then
|
||||
IMPORT_REPOSITORIES=$AUTOPORT_MILESTONE2_IMPORT_REPOSITORIES
|
||||
elif [ "${REPOSITORY:0:10}" = "milestone3" ]; then
|
||||
IMPORT_REPOSITORIES=$AUTOPORT_MILESTONE3_IMPORT_REPOSITORIES
|
||||
else
|
||||
IMPORT_REPOSITORIES="$AUTOPORT_DEVEL_IMPORT_REPOSITORIES devel-$USER $AUTOPORT_DEVEL_RELEASE_REPOSITORIES"
|
||||
fi
|
||||
for f in $IMPORT_REPOSITORIES; do
|
||||
# [ "$f" = "$REPOSITORY" ] && continue
|
||||
if [ ! "$USER_ALLREPOSITORIES" ]; then
|
||||
for u in $USER_CANMAINTAIN_REPOSITORIES devel-$USER; do
|
||||
[ "$u" = "$f" ] && echo -n "<option value=\"$f\">$f</option>"
|
||||
# -a "$f" != "$REPOSITORY"
|
||||
done
|
||||
else
|
||||
#[ "$f" != "$REPOSITORY" ] &&
|
||||
echo -n "<option value=\"$f\">$f</option>"
|
||||
fi
|
||||
done
|
||||
echo -n "</select><br>"
|
||||
# force checkbox
|
||||
echo -n "<label style=\"background-color:red;padding:1px;\"><input type=checkbox id=\"repositoryforce\" value=\"force\">force</label>"
|
||||
# simulate checkbox
|
||||
echo -n "<label><input type=checkbox id=\"repositorysimulate\" value=\"simulate\">simulate</label></div>"
|
||||
# operations box
|
||||
echo -n "<div class=\"operationpaneloperations\">"
|
||||
echo -n "<b>Operations on selected packages:</b><br>"
|
||||
# echo -n "<select multiple size=8 id=package onchange="
|
||||
# echo -n "i=getElementById('repository').selectedIndex;ajax_getvalues(\"REQUEST=edit&"
|
||||
# echo -n "ENVIRONMENT=$ENVIRONMENT&MAINTAINERMODE=\"+getElementById('maintain').checked+\"&"
|
||||
@ -2165,37 +2249,14 @@ if [ "$MAINTAINERMODE" = "true" ]; then
|
||||
echo -n "<label><input type=checkbox name=packagescheckbox value=\"$pkgname\" $SELECTED>${pkgname} ${pkgver}-${pkgrel}</label>"
|
||||
done < $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY
|
||||
echo -n "</div>"
|
||||
echo -n "Origin: <b>$REPOSITORY</b>"
|
||||
# repository sync
|
||||
echo -n " <input type=button value=\"sync\" onclick="
|
||||
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&"
|
||||
echo -n "PACKAGES=\"+encodeURIComponent(getCheckedValuesByName('packagescheckbox'))+\"&"
|
||||
echo -n "MAINTAINERMODE=\"+getElementById('maintain').checked+\"&"
|
||||
echo -n "REQUEST=repositorysync\""
|
||||
echo -n ",\"`cgi_encodevar "Make <b>$REPOSITORY</b> updates immediately available from public server?"`\""
|
||||
echo -n "); class=redbutton>"
|
||||
echo -n "<br>Destination: "
|
||||
echo -n "<select id=repositoryimportto>"
|
||||
if [ "${REPOSITORY:0:10}" = "milestone2" ]; then
|
||||
IMPORT_REPOSITORIES=$AUTOPORT_MILESTONE2_IMPORT_REPOSITORIES
|
||||
elif [ "${REPOSITORY:0:10}" = "milestone3" ]; then
|
||||
IMPORT_REPOSITORIES=$AUTOPORT_MILESTONE3_IMPORT_REPOSITORIES
|
||||
else
|
||||
IMPORT_REPOSITORIES="$AUTOPORT_DEVEL_IMPORT_REPOSITORIES devel-$USER $AUTOPORT_DEVEL_RELEASE_REPOSITORIES"
|
||||
fi
|
||||
for f in $IMPORT_REPOSITORIES; do
|
||||
# [ "$f" = "$REPOSITORY" ] && continue
|
||||
if [ ! "$USER_ALLREPOSITORIES" ]; then
|
||||
for u in $USER_CANMAINTAIN_REPOSITORIES devel-$USER; do
|
||||
[ "$u" = "$f" ] && echo -n "<option value=\"$f\">$f</option>"
|
||||
# -a "$f" != "$REPOSITORY"
|
||||
done
|
||||
else
|
||||
#[ "$f" != "$REPOSITORY" ] &&
|
||||
echo -n "<option value=\"$f\">$f</option>"
|
||||
fi
|
||||
done
|
||||
echo -n "</select><br>"
|
||||
## repository sync
|
||||
#echo -n " <input type=button value=\"sync\" onclick="
|
||||
#echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&"
|
||||
#echo -n "PACKAGES=\"+encodeURIComponent(getCheckedValuesByName('packagescheckbox'))+\"&"
|
||||
#echo -n "MAINTAINERMODE=\"+getElementById('maintain').checked+\"&"
|
||||
#echo -n "REQUEST=repositorysync\""
|
||||
#echo -n ",\"`cgi_encodevar "Make <b>$REPOSITORY</b> updates immediately available from public server?"`\""
|
||||
#echo -n "); class=redbutton>"
|
||||
# repository compare
|
||||
echo -n "<input type=button value=\"compare\" onclick="
|
||||
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&"
|
||||
@ -2243,16 +2304,6 @@ if [ "$MAINTAINERMODE" = "true" ]; then
|
||||
echo -n "REQUEST=repositoryarchive\""
|
||||
echo -n ",\"`cgi_encodevar "Archive <b>"`\"+p+\"`cgi_encodevar "</b> in <b>$REPOSITORY</b>?"`\""
|
||||
echo -n "); class=redbutton>"
|
||||
# force checkbox
|
||||
echo -n "<label><input type=checkbox id=\"repositoryforce\" value=\"force\">force</label>"
|
||||
# simulate checkbox
|
||||
echo -n "<label><input type=checkbox id=\"repositorysimulate\" value=\"simulate\">simulate</label>"
|
||||
# changelog for mass rebuild
|
||||
echo -n "<hr><b>Mass rebuild of selected packages:</b><br>Changelog:"
|
||||
echo -n "<input type=text id=massrebuildchangelog style=\"width:100%\">"
|
||||
# autodist update buildrequirements
|
||||
echo -n "Add build requirement(s):<br>"
|
||||
echo -n "<textarea id=massrebuildbuildreq style=\"width:98%;font-size:8pt;resize:none;\" rows=2></textarea>"
|
||||
# mass rebuild
|
||||
echo -n "<input type=button value=\"rebuild\" onclick="
|
||||
echo -n "p=getCheckedValuesByName('packagescheckbox');"
|
||||
@ -2268,8 +2319,8 @@ if [ "$MAINTAINERMODE" = "true" ]; then
|
||||
echo -n ",\"`cgi_encodevar "Rebuild <b>"`\"+p+\"`cgi_encodevar "</b> from <b>$REPOSITORY</b> and send to <b>"`\"+getSelectedValueById('repositoryimportto')+"
|
||||
echo -n "\"`cgi_encodevar "</b>?"`\""
|
||||
echo -n "); class=redbutton>"
|
||||
# mass rebuild of dependant packages
|
||||
echo -n "<input type=button value=\"rebuild dependant\" onclick="
|
||||
# mass rebuild of dependent packages
|
||||
echo -n "<input type=button value=\"rebuild deps\" onclick="
|
||||
echo -n "p=getCheckedValuesByName('packagescheckbox');"
|
||||
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&"
|
||||
echo -n "PACKAGES=\"+encodeURIComponent(p)+\"&"
|
||||
@ -2279,10 +2330,17 @@ if [ "$MAINTAINERMODE" = "true" ]; then
|
||||
echo -n "REPOSITORYFORCE=\"+getElementById('repositoryforce').checked+\"&"
|
||||
echo -n "MASSREBUILDCHANGELOG=\"+encodeURIComponent(getElementById('massrebuildchangelog').value)+\"&"
|
||||
echo -n "MASSREBUILDBUILDREQ=\"+encodeURIComponent(getElementById('massrebuildbuildreq').value)+\"&"
|
||||
echo -n "SENDREPOSITORY=$REPOSITORY&REQUEST=repositorymassrebuilddependant\""
|
||||
echo -n ",\"`cgi_encodevar "Rebuild package which depend on <b>"`\"+p+\"`cgi_encodevar "</b> in <b>$REPOSITORY</b> and send to <b>"`\"+getSelectedValueById('repositoryimportto')+"
|
||||
echo -n "SENDREPOSITORY=$REPOSITORY&REQUEST=repositorymassrebuilddependent\""
|
||||
echo -n ",\"`cgi_encodevar "Rebuild package(s) which depend on <b>"`\"+p+\"`cgi_encodevar "</b> in <b>$REPOSITORY</b> and send to <b>"`\"+getSelectedValueById('repositoryimportto')+"
|
||||
echo -n "\"`cgi_encodevar "</b>?"`\""
|
||||
echo -n "); class=redbutton>"
|
||||
# changelog for mass rebuild
|
||||
echo -n "<br>Rebuild changelog:"
|
||||
echo -n "<input type=text id=massrebuildchangelog style=\"width:100%\">"
|
||||
# autodist update buildrequirements
|
||||
echo -n "Add build requirement(s):<br>"
|
||||
echo -n "<textarea id=massrebuildbuildreq style=\"width:98%;font-size:8pt;resize:none;\" rows=2></textarea>"
|
||||
echo -n "</div>"
|
||||
fi
|
||||
echo -n "]]></operationpanel>"
|
||||
fi
|
||||
|
@ -259,6 +259,7 @@ class PasswordHash {
|
||||
}
|
||||
|
||||
$wp_hasher = new PasswordHash(8, TRUE);
|
||||
echo $wp_hasher->HashPassword($argv[1]);
|
||||
if ($wp_hasher->CheckPassword($argv[1], $argv[2]) == "1")
|
||||
exit(0);
|
||||
else
|
||||
|
@ -27,22 +27,28 @@ function set_user_state_var() {
|
||||
|
||||
function social_log() {
|
||||
local line=$1
|
||||
local SPRIVACY=0
|
||||
|
||||
[ "$line" ] || return
|
||||
|
||||
if [ ! "$STATE_FAKEUSER" ]; then
|
||||
STATE_SOCIALLOG_ID=0
|
||||
. $WEBBUILD_STATEDIR/users/webbuild.state
|
||||
STATE_SOCIALLOG_ID=$(($STATE_SOCIALLOG_ID + 1))
|
||||
set_user_state_var STATE_SOCIALLOG_ID $STATE_SOCIALLOG_ID webbuild
|
||||
echo "SID=$STATE_SOCIALLOG_ID SPRIVACY=$STATE_PRIVACYMODE $line" >> $WEBBUILD_STATEDIR/social_log
|
||||
|
||||
[ -e $WEBBUILD_STATEDIR/webbuild.db ] || \
|
||||
sqlite3 $WEBBUILD_STATEDIR/webbuild.db \
|
||||
"CREATE TABLE social_log(id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, privacy BOOLEAN, user CHAR(40), type CHAR(40), target CHAR(40), email CHAR(80), text TEXT, time datetime default current_timestamp);"
|
||||
|
||||
eval "$line"
|
||||
[ "$STATE_PRIVACYMODE" ] && $SPRIVACY=1
|
||||
sqlite3 $WEBBUILD_STATEDIR/webbuild.db \
|
||||
"INSERT into social_log (privacy, user, type, target, email, text) \
|
||||
values ($SPRIVACY,'$SUSER','$STYPE','$STARGET','$SEMAIL','$STEXT');"
|
||||
|
||||
# Note: checking that URL does not point here again to avoid recursive requests
|
||||
if [ "$WEBBUILD_URL" -a "${WEBBUILD_URL/\/localhost\//}" = "$WEBBUILD_URL" ]; then
|
||||
eval $line
|
||||
USER_SECRET_FIXED=`echo $USER_SECRET | sed "s|\$|\\$|"`
|
||||
curl -s "$WEBBUILD_URL?REQUEST=message&USER=$USER&SECRET=`cgi_encodevar \"$USER_SECRET\"`&USER_EMAIL=$USER_EMAIL&\
|
||||
MESSAGE=`cgi_encodevar \"$STEXT\"`" >/dev/null
|
||||
TARGET=$STARGET&MESSAGE=`cgi_encodevar \"$STEXT\"`" >/dev/null
|
||||
fi
|
||||
fi
|
||||
}
|
||||
@ -253,22 +259,27 @@ function parse_patch_output() {
|
||||
}
|
||||
|
||||
function parse_build_output() {
|
||||
#s|\(.\{10000\}\).*|\1 [CUT - LONG LINE]|;
|
||||
sed "s|\r.*||;
|
||||
s|\(.\{10000\}\).*|\1 [CUT - LONG LINE]|;s|\\\|\\\\\\\|g;s|<|\<|g;s|[[:cntrl:]]\[[0-9;]*m||g;
|
||||
s/\x90\x8D.*//g;
|
||||
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>|;
|
||||
s|\(ftp[s]*://[[:alnum:]+\,:&?/_.=~%#-]*\)|<a href=\1 target=new>\1</a>|;
|
||||
s|\(http[s]*://[[:alnum:]+\,:&?/_.=~%#-]*\)|<a href=\1 target=new>\1</a>|;
|
||||
s|\(.*\)\(error[^0-9A-Za-z]*:[[:space:]]*.*\)|<font style=\"background-color:darkred;color:white\">\1<a %SRCURL%\2%SRCURLEND%>\2</a></font>|i;
|
||||
s|^\(== =.*\)|<font style=\"background-color:green;color:white\">\1</font>|;
|
||||
s|\(.*\)\(error[^0-9A-Za-z]*:[[:space:]]*.*\)|<span class=\"outputboxerror\">\1<a %SRCURL%\2%SRCURLEND%>\2</a></span>|i;
|
||||
s|^\(== =.*\)|<span class=\"outputboxok\">\1</span>|;
|
||||
s|^[[:cntrl:]]*\([!%?=][!%!=>] .*\)|<font style=\"color:gold\">\1</font>|;
|
||||
s|[[:cntrl:]]||g;" | google_search $1
|
||||
}
|
||||
|
||||
function parse_generic_output() {
|
||||
# s|\(.\{10000\}\).*|\1 [CUT - LONG LINE]|;
|
||||
sed "s|\r.*||;
|
||||
s|\(.\{10000\}\).*|\1 [CUT - LONG LINE]|;s|<|\<|g;s|[[:cntrl:]]\[[0-9;]*m||g;
|
||||
s|<|\<|g;
|
||||
s|[[:cntrl:]]\[[0-9;]*m||g;
|
||||
s|<font|<font|g;
|
||||
s|</font|</font|g;
|
||||
s|^\([\+#] .*\)|<font style=\"color:cyan\">\1</font>|;
|
||||
@ -278,13 +289,12 @@ function parse_generic_output() {
|
||||
|
||||
function google_search() {
|
||||
while read line; do
|
||||
local SEARCH_STRING=`echo "$line" | sed "s|.*%SRCURL%\(.*\)%SRCURLEND%.*|\1|"`
|
||||
if [ "$SEARCH_STRING" = "$line" ]; then
|
||||
if [ "${line/\%SRCURL\%}" == "${line}" ]; then
|
||||
echo "$line"
|
||||
else
|
||||
SEARCH_STRING=`echo $SEARCH_STRING | sed "s|\<|<|"`
|
||||
local SEARCH_STRING=`echo "$line" | sed "s|.*%SRCURL%\(.*\)%SRCURLEND%.*|\1|;s|\<|<|"`
|
||||
local SEARCH_STRING_ENCODED=`cgi_encodevar "$1 $SEARCH_STRING"`
|
||||
echo "$line" | sed "s|%SRCURL%.*%SRCURLEND%|href=\"http://www.google.com/search?q=$SEARCH_STRING_ENCODED\" target=_new title=\"Search this error on the Web\"|g"
|
||||
echo "$line" | sed "s|%SRCURL%.*%SRCURLEND%|href=\"https://www.google.com/search?q=$SEARCH_STRING_ENCODED\" target=_new title=\"Search this error on the Web\"|g"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ function showlog() {
|
||||
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>"
|
||||
echo "<div align=left class=\"outputbox\" id=\"$LOGOUTPUTID\">"
|
||||
for f in $LOGFILES; do
|
||||
if [ -r $f ]; then
|
||||
LOGFILESIZE=`stat -c %s $f`
|
||||
@ -59,7 +59,7 @@ function showlog() {
|
||||
tail -n +0 -f $f --pid $PROCESSPID | stdbuf -oL sed "s|<\([/]pre>\)|\<\1|g"
|
||||
echo -n "<!-- ENDSCROLL -->"
|
||||
else
|
||||
if [ $LOGFILESIZE -lt 2097152 ]; then
|
||||
if [ $LOGFILESIZE -lt 12097152 ]; then
|
||||
if [ -r $f ]; then
|
||||
cat $f | parse_build_output $PACKAGE
|
||||
else
|
||||
@ -139,6 +139,21 @@ function print_showlogcontrols() {
|
||||
echo -n "REQUEST=showlog&LOGTYPE=send&LOGSTATUSOK=\"+document.all.logstatusOK.checked);> with status: "
|
||||
echo -n "OK <input id=\"logstatusOK\" type=\"radio\" name=\"logstatus\" value=\"OK\"> "
|
||||
echo -n "FAILED <input type=\"radio\" name=\"logstatus\" value=\"FAILED\" checked=\"checked\">"
|
||||
# console cmd
|
||||
echo -n "<hr><b>Command:</b> "
|
||||
echo -n " ["
|
||||
if [ "${AUTOPORT_CHROOT_USER[$ENVIRONMENT]}" ]; then
|
||||
echo -n "${AUTOPORT_CHROOT_USER[$ENVIRONMENT]}@"
|
||||
else
|
||||
echo -n "autodist@"
|
||||
fi
|
||||
echo -n "`hostname -s` ${SPECVAR_BUILDDIR}]\$ <input type=text id=consolecmd value=\"\" size=\"40\"> "
|
||||
echo -n "<input type=button id=consolecmdbutton value=\"submit\" onclick="
|
||||
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
|
||||
echo -n "REQUEST=consolecmd&CONSOLECMD=\"+getElementById('consolecmd').value+\"&"
|
||||
echo -n "RPMFORCE=\"+getElementById('rpmforce').checked+\"&"
|
||||
echo -n "DEBUG=\"+getElementById('debug').checked+\"&"
|
||||
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue()));>"
|
||||
# close tag
|
||||
echo -n "]]></showlogcontrols>"
|
||||
}
|
||||
@ -148,7 +163,7 @@ function print_editorcontrols() {
|
||||
|
||||
echo -n "<editcontrols><![CDATA["
|
||||
# specfile save
|
||||
echo -n "<div style=\"width:100%;overflow:hidden;\"><span style=\"float:left\">"
|
||||
echo -n "<div style=\"width:100%;overflow:hidden;\"><span style=\"width:100%;display:block\">"
|
||||
echo -n "<input type=button id=savebutton value=\"save\" onclick="
|
||||
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
|
||||
echo -n "REQUEST=savespec&SENDREPOSITORY=$SENDREPOSITORY&SPECTEXT=\"+encodeURIComponent(editor.getValue()));"
|
||||
@ -227,7 +242,7 @@ function print_editorcontrols() {
|
||||
echo -n "<label style=\"color:red;padding:0;\"><input type=checkbox id=\"sendrecreatesrpm\" value=\"force\">recreate SRPM</label>"
|
||||
|
||||
# specfile update
|
||||
echo -n "<div style=\"width:100%;overflow:hidden;\"><span style=\"float:left\">"
|
||||
echo -n "<div style=\"width:100%;overflow:hidden;\"><span style=\"display:flex\">"
|
||||
echo -n "<input type=button id=updatespecbutton value=\"update\" onclick="
|
||||
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
|
||||
echo -n "REQUEST=updatespec&UPDATESPECVERSION=\"+getElementById('updatespecversion').value+\"&"
|
||||
@ -235,12 +250,10 @@ function print_editorcontrols() {
|
||||
echo -n "DEBUG=\"+getElementById('debug').checked+\"&"
|
||||
echo -n "REBUILDSPECCHANGELOG=\"+encodeURIComponent(getElementById('rebuildspecchangelog').value)+\"&"
|
||||
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue()));>"
|
||||
echo -n " (automatic or specify new version:<input type=text id=updatespecversion value=\"\" size=\"10\">"
|
||||
echo -n " or new release changelog:"
|
||||
echo -n "</span><span style=\"display:block;float:right\">)</span>"
|
||||
echo -n "<span style=\"display:block;overflow:hidden;padding-right:5px;\">"
|
||||
echo -n "<input type=text id=rebuildspecchangelog value=\"$REBUILDSPECCHANGELOG\" style=\"width:100%\">"
|
||||
echo -n "</span></div>"
|
||||
echo -n " <label>to new version:</label><input type=text id=updatespecversion value=\"\" size=\"10\">"
|
||||
echo -n " <label>or to new release with changelog:</label>"
|
||||
echo -n "<input style=\"flex:1\" type=text id=rebuildspecchangelog value=\"$REBUILDSPECCHANGELOG\">"
|
||||
echo -n "</div>"
|
||||
# close tag
|
||||
echo -n "]]></editcontrols>"
|
||||
|
||||
@ -254,14 +267,14 @@ function show_docs() {
|
||||
done
|
||||
echo -n "<br>"
|
||||
for f in $@; do
|
||||
echo -n "<a name=logfile-$f><p style=\"background-color:gray\"><b>File $f:</b></a><pre>"
|
||||
echo -n "<a name=logfile-$f></a><p><b>File $f:</b><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
|
||||
"cd $SPECVAR_RPMBUILDDIR/$SPECVAR_BUILDDIR && head -c 10240 $f | strings | sed \"s|<|\<|g;s|[[:cntrl:]]\[[0-9;]*m||g\"" | parse_generic_output
|
||||
RET=$?
|
||||
echo -n "</pre>"
|
||||
done
|
||||
@ -309,6 +322,12 @@ function resolve_rpmmanagerdir() {
|
||||
RPMSNOARCH) rpmmanagerdir=../RPMS/noarch
|
||||
rpmmanagermask="*.noarch.rpm"
|
||||
rpmmanagermode=environment ;;
|
||||
RPMS_arm) rpmmanagerdir=../RPMS/arm
|
||||
rpmmanagermask="*.arm.rpm"
|
||||
rpmmanagermode=environment ;;
|
||||
RPMS_i586) rpmmanagerdir=../RPMS/i586
|
||||
rpmmanagermask="*.i586.rpm"
|
||||
rpmmanagermode=environment ;;
|
||||
*) rpmmanagerdir=../RPMS/$RPMMANAGERARCH
|
||||
rpmmanagermask="*.$RPMMANAGERARCH.rpm"
|
||||
rpmmanagermode=environment ;;
|
||||
|
@ -2,6 +2,7 @@
|
||||
. /usr/share/autodist/webbuild-functions
|
||||
. /etc/sysconfig/autoport
|
||||
|
||||
export LANG="C.UTF-8"
|
||||
MODE=$1
|
||||
ENVIRONMENT=$2
|
||||
USER=$3
|
||||
@ -87,7 +88,7 @@ if [ "$MODE" = "specinfo" ]; then
|
||||
done < ${ENVPREFIX}${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec
|
||||
[ "$AUTOBUILDREQ_BEGIN" -a "$AUTOBUILDREQ_END" -a ! "$AUTOBUILDREQ_UNDONE" ] || \
|
||||
echo "SPECVAR_CHECK_NOAUTOBUILDREQ=1"
|
||||
$SUCMDPREFIX "rpm -q --specfile ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec --specedit > ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec.tmp 2>/dev/null"
|
||||
$SUCMDPREFIX "rpmspec -P ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec > ${WORKINGHOME}/RPM/SPECS/$PACKAGE.spec.tmp 2>/dev/null"
|
||||
if [ -e $SPECFILE.tmp ]; then
|
||||
echo "SPECVAR_Specfile=\"$SPECFILE\""
|
||||
BUILDDIR=`grep -m1 "^%setup.*-n " $SPECFILE.tmp | sed "s|.*-n \([^[:space:]]*\).*|\1|"`
|
||||
|
Reference in New Issue
Block a user