Compare commits

...

67 Commits

Author SHA1 Message Date
f23570f228 Release 1.2 (formerly released) 2020-09-27 15:49:51 +02:00
79af8764e1 webbuild-cgi: css fixes 2019-07-30 19:39:22 +02:00
94f1ffcf9a webbuild: more css support for output boxes 2019-07-28 21:57:52 +02:00
1c15fcfb25 webbuild: fixes for sociallog from webbuild.db 2019-07-28 20:40:09 +02:00
5a0fa63a96 webbuild-sudo: switch to using rpmspec from rpm4 instead of rpm --specedit 2019-07-21 11:37:20 +02:00
bbcfce5260 Release 1.0.1 2019-07-15 17:54:01 +02:00
db0354041e webbuild: minor updates synced from running build server 2019-07-15 17:42:52 +02:00
c7d8a76d80 autodist: minor updates synced from running server installation 2019-07-15 17:39:27 +02:00
058a0baa7e Added openmamba bot for telegram 2017-12-30 23:14:48 +01:00
38c75eea33 autoport-fix-environment: fix a syntax error in sed 2017-07-04 19:04:08 +02:00
4cee459385 Release 1.0.0 2017-06-19 15:18:07 +02:00
f47b80b1cc autodist-update: disable icecc to workaround some problems 2017-06-19 14:49:40 +02:00
092e90e004 autoport-native: only upgrade native packages on first loop cycle 2017-06-19 14:49:12 +02:00
e53a62198a automaint: minor fixes 2017-06-19 14:48:35 +02:00
68bacbc599 autodist-upstream-updates: added support for blacklisting 2017-06-19 14:48:01 +02:00
681b2e5ec7 autodist: added --rebuild-srpms 2017-06-19 14:47:30 +02:00
a6d6fd03e4 webbuild: login fix for problem when password is changed on main site 2017-06-19 14:39:08 +02:00
c3cbf7c0e8 webbuild: switch social_log to sqlite3 db; display status also when there are no processes to display 2016-10-30 13:41:46 +01:00
ced497545e webbuild: support for different archs in downloads and some fixes 2016-10-17 12:57:27 +02:00
ee1a94af6f webbuild-functions: some optimizations of sed parsing functions 2016-07-04 21:39:40 +02:00
2c09744bbd Webbuild: support for running a console command from web interface input 2016-05-29 00:23:38 +02:00
7d21e2fa60 webbuild-cgi: red color for Updating indicator in jobs panel 2016-05-04 15:51:41 +02:00
7e78d60c90 webbuild-cgi: fix for files upload and minor cosmetic changes to rebuild deps function 2016-03-11 14:46:59 +01:00
537b80a4c4 update-specfile: remove Requires: kde-workspace from many kde4->kde5 packages and fix kde download url 2016-02-21 14:41:58 +01:00
db8fa88b9b autoport: apply strict repository check at first step only
This means check is applied to command-line passed packages only
2016-02-19 12:06:41 +01:00
f93a093134 40-autodist-cleanold: refresh with currently in use modifications 2016-02-16 13:45:18 +01:00
a49c4ec447 autodist: add --repository-string to limit autoport of pacakges from specified repository
autoport: update accordingly
2016-02-15 08:07:58 +01:00
1c8a7cbbdf webbuild-cgi: add icon button to refresh spec list 2016-01-10 17:10:57 +01:00
73f032afda webbuild-cgi: use https for gravatar 2015-12-08 14:59:48 +01:00
8b9ee4a7b2 webbuild-cgi: alway exit early on refreshsocial request 2015-09-19 23:15:48 +02:00
c3c5a9009e webbuild: fully div based layout and responsive support 2015-08-23 15:59:13 +02:00
4fba9537b5 webbuild: split css adding webbuild-standalone.css and webbuild-post.css 2015-08-22 18:44:38 +02:00
a191ef0eb3 webbuild: fixes to matching autodist jobs with package name and other small fixes 2015-08-22 17:58:14 +02:00
5f2e54f58a webbuild-cgi: small refining of rpmbuild processes detection 2015-05-16 14:28:02 +02:00
90a0d85269 webbuild-cgi: display live server stats in first line of jobs window 2015-05-14 17:13:34 +02:00
6e6d92d5a2 webbuild: redesign of operation panel in maintainance mode 2015-05-07 00:14:06 +02:00
8f2eb49563 webbuild.css: float maintainer panel to the left 2015-05-04 20:46:37 +02:00
4ee59fdbd2 Sync with current server files before releasing 2015-04-18 16:33:42 +02:00
d1493a2edf webbuild: create uploads directory 2015-04-18 15:56:38 +02:00
c6db4b05c9 autodist-cgi: fix showing last log file 2015-04-14 22:08:31 +02:00
3f8d3fb9b2 webbuild: change error background color from red to darkred 2015-04-13 23:16:34 +02:00
77ecc7566d webbuild: implement a var2html function to filter for security variable to html
Currently used in chat messages
2015-04-04 18:49:49 +02:00
aca1323856 webbuild-cgi: fixes for rpm manager install/upgrade from repositories 2015-01-30 11:11:23 +01:00
a6b14a1aa9 autoport: port packages also in milestone rebuild mode and display fetched files in verbose mode (-v) 2015-01-04 10:58:10 +01:00
2e6f2dd33e autoport: don't increment first release number in REBUILD_MILESTONE mode 2014-12-31 14:52:23 +01:00
fe8a60addd Release 0.9.22 2014-12-04 14:42:44 +01:00
ef649ef1c4 webbuild-cgi: some more milestone3 support 2014-12-04 14:41:33 +01:00
a044057f9f webbuild-cgi: fix for distroquery usage while searching for already existing package 2014-11-24 12:48:02 +01:00
8623f8bfd8 autodist-cgi: small changes after wordpress integration 2014-11-23 22:18:37 +01:00
f47f80416d Release 0.9.21 2014-11-22 23:00:08 +01:00
177629094c webbuild: other layout changes 2014-11-22 22:57:12 +01:00
f5a01c61a6 webbuild: move most rpm buttons below the editor plus some other layout adjustements 2014-11-22 19:51:49 +01:00
f492d02d7d webbuild: reallow html tags in processtail to display colors, only filter <[/]pre> tags for now 2014-11-22 12:35:08 +01:00
367e2f7dee webbuild-cgi: fix support for multiple words queries 2014-11-16 16:08:06 +01:00
144f1b0eb6 Release 0.9.20
Added forgotten autodist-tmpfilesd new file
2014-11-13 14:58:59 +01:00
faa153d41e Move pid directory to /run/autodist providing systemd tmpfiles.d configuration 2014-11-13 14:57:50 +01:00
d435051d50 webbuild-cgi: fixes to existing package check through distroquery 2014-11-13 14:30:28 +01:00
9afdb96444 40-autodist-cleanold cron: minor adjustments 2014-11-13 14:29:50 +01:00
eaf4e0220c cgi_getvars(): fix warning when empty key is received 2014-11-13 14:28:19 +01:00
3b032d1d8c webbuild: use distroquery to check and warn about already extisting package when creating a new package 2014-10-31 22:27:05 +01:00
6032d80cdb webbuild: fix autodist prepare and update; run ldconfig in build requirements; support version in autodist update 2014-10-29 22:36:58 +01:00
66ce879682 webbuild.html, autobuilds.html: restrict xmlhttp to fix too many sockets pending in chromium bug 2014-10-12 23:18:14 +02:00
3b15ee14b7 40-autodist-cleanold: improvements in daily file cleaning cron file 2014-10-09 16:14:39 +02:00
949a4c35df webbuild-cgi: support target arch in rpm prepare 2014-10-05 19:27:35 +02:00
d77d29fd37 webbuild: support adding BASE_URL to search result links 2014-10-05 19:26:55 +02:00
4d8a804eee webbuild-cgi: add remote fetch for maintainer recent packages and distromatic log plus add caching support 2014-09-28 12:34:41 +02:00
60f8e3cff0 webbuild: increase logs size before cutting; cache environment info, update every 5 minutes 2014-09-21 02:34:47 +02:00
29 changed files with 1181 additions and 563 deletions

View File

@ -11,13 +11,13 @@ 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
configdir = ${sysconfdir}/autodist
localstatedir= /var
piddir= ${localstatedir}/run/autodist
piddir= /run/autodist
cgidir = ${localstatedir}/www/cgi-bin
htmldir = ${localstatedir}/www/html
@ -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
@ -62,9 +63,9 @@ install-dirs:
@$(INSTALL_DIR) $(DESTDIR)$(pck_logdir)/install/{ok,failed}
@$(INSTALL_DIR) $(DESTDIR)$(pck_logdir)/send/{ok,failed}
@$(INSTALL_DIR) $(DESTDIR)$(pck_statedir)/RPM/{SPECS,SRPMS,BUILD,SOURCES,RPMS/{noarch,i586,ppc,x86_64,arm}}
@$(INSTALL_DIR) $(DESTDIR)$(piddir)
@$(INSTALL_DIR) $(DESTDIR)$(libexecdir)
@$(INSTALL_DIR) $(DESTDIR)$(localstatedir)/webbuild/{cache,home,notes,tmp,users}
@$(INSTALL_DIR) $(DESTDIR)$(localstatedir)/webbuild/{cache,home,notes,tmp,users,uploads}
@$(INSTALL_DIR) $(DESTDIR)$(prefix)/lib/tmpfiles.d/
install-programs:
@$(INSTALL_SCRIPT) autodist $(DESTDIR)$(bindir)/autodist
@ -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:
@ -101,6 +103,8 @@ install-data:
@$(INSTALL_DATA) autospec-conf $(DESTDIR)$(pck_statedir)/.autospec
@$(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

View File

@ -1 +1 @@
VERSION = 0.9.19
VERSION = 1.0.2

View File

@ -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.19
me=(${0##*/} $VERSION "Sat Aug 20 2010")
VERSION=1.0.2
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
@ -94,7 +96,7 @@ CONFIGFILE=$SYSCONFDIR/config
SCRIPT_UPDATE_SPECFILE=$SCRIPTDIR/update-specfile
SCRIPT_UPDATE_SPECFILE_CUSTOM=$SCRIPTDIR/update-specfile-custom
AUTOSPEC_CMD="/usr/bin/autospec"
PIDFILE="/var/run/autodist/autodist.pid"
PIDFILE="/run/autodist/autodist.pid"
# Configuration defaults normally overriden in configuration file
AUTOBUILD_MAXNUM=50
@ -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
@ -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

View File

@ -120,7 +120,7 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
AUTODISTSTATEFILE="$AUTOPORTLOGDIR/autoport-$r-current"
elif [ "${AUTOPORT_NATIVE[$i]}" ]; then
LOGFILE="/var/autodist/log/autoport-native-$r-${AUTOPORT_ARCH[$i]}.log"
LASTLOGFILE="/var/autodist/log/log/autoport-native-$r-${AUTOPORT_ARCH[$i]}-last.log"
LASTLOGFILE="/var/autodist/log/autoport-native-$r-${AUTOPORT_ARCH[$i]}-last.log"
AUTODISTLOGFILE="$AUTOPORTLOGDIR/${AUTOPORT_ARCH[$i]}/$r-current.log"
AUTODISTSTATEFILE="$AUTOPORTLOGDIR/autoport-$r-current"
elif [ "${AUTOPORT_CROSS[$i]}" ]; then
@ -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
@ -164,7 +163,7 @@ _EOF
if [ "${SHOWLOG/\/ok\/}" != "${SHOWLOG}" -o "${SHOWLOG/\failed\/}" != "${SHOWLOG}" ]; then
SHOWLOGPKG=${SHOWLOG/*\/}
[ "${SHOWLOGPKG}" ] || continue
echo "<table style=\"color:black\"><tr><td colspan=3>Last ${SHOWLOGPKG} logs:</td>"
echo "<table style=\"color:black;width:auto;\"><tr><td colspan=3>Last ${SHOWLOGPKG} logs:</td>"
for t in prepare update build install send; do
echo -n "<tr><td>$t:</td><td>"
[ -e ${BUILDLOGDIR}${t}/ok/${SHOWLOGPKG} ] && echo -n "<td><a style=\"color:green;text-decoration:none\" target=_autodist href=\"?NUM=$i&REP=$RNUM$HOST_ADD&SHOWLOG=${t}/ok/${SHOWLOGPKG}\">OK</a></td>" || echo "<td></td>"
@ -192,7 +191,7 @@ _EOF
fi
[ "${AUTOPORT_UPDATE[$i]}" ] && break
elif [ ! "$SHOWLOG" ]; then
RELOADTIME=60000
RELOADTIME=600000
[[ "$NUM" && "$NUM" != "$i" ]] && continue
[[ "$HOST" = "$AS_HOST" ]] || continue
if [ "${AUTOPORT_UPDATE[$i]}" ]; then
@ -215,10 +214,10 @@ _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'>"
echo -n "<pre style='margin:1px;word-wrap:normal;white-space:pre;'>"
unset BUILDNOWIDX BUILDLOG BUILDNOW BUILDNOWSTATUS SCHEDULED STARTTIME AUTODIST_PID ENDTIME
if [ "${AUTOPORT_UPDATE[$i]}" ]; then
BUILDNOWIDX=0

1
autodist-tmpfilesd Normal file
View File

@ -0,0 +1 @@
d /run/autodist 775 autodist packager

View File

@ -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

View File

@ -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

View File

@ -4,7 +4,7 @@
#
# Released under the terms of the GNU GPL release 3 license
#
VERSION=0.9.19
VERSION=1.0.2
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.""
@ -241,12 +241,16 @@ function find_requirements() {
fetch_repfiles() {
local u
[ "$VERBOSE_MODE" = "1" ] && echo "Fetching ${REPS_BASE_URL}/$PORT_REPOSITORY/srcpkglist"
curl -f -L -s ${REPS_BASE_URL}/$PORT_REPOSITORY/srcpkglist -o $DATADIR/$PORT_REPOSITORY/srcpkglist ||
echo "Warning: unable to fetch ${REPS_BASE_URL}/$PORT_REPOSITORY/srcpkglist"
[ "$VERBOSE_MODE" = "1" ] && echo "Fetching $PORT_REPOSITORY_DISTROMATIC_URL/sources-$BASE_ARCH"
curl -f -L -s $PORT_REPOSITORY_DISTROMATIC_URL/sources-$BASE_ARCH -o $DATADIR/$PORT_REPOSITORY/sources-$BASE_ARCH ||
echo "Warning: unable to fetch $PORT_REPOSITORY_DISTROMATIC_URL/sources-$BASE_ARCH"
[ "$VERBOSE_MODE" = "1" ] && echo "Fetching $PORT_REPOSITORY_DISTROMATIC_URL/sources-$TARGET_ARCH"
curl -f -L -s $PORT_REPOSITORY_DISTROMATIC_URL/sources-$TARGET_ARCH -o $DATADIR/$PORT_REPOSITORY/sources-$TARGET_ARCH ||
echo "Warning: unable to fetch $PORT_REPOSITORY_DISTROMATIC_URL/sources-$TARGET_ARCH"
[ "$VERBOSE_MODE" = "1" ] && echo "Fetching $PORT_REPOSITORY_DISTROMATIC_URL/builds-$TARGET_ARCH.sh"
curl -f -L -s $PORT_REPOSITORY_DISTROMATIC_URL/builds-$TARGET_ARCH.sh -o $DATADIR/$PORT_REPOSITORY/builds-$TARGET_ARCH.sh ||
echo "Warning: unable to fetch $PORT_REPOSITORY_DISTROMATIC_URL/builds-$TARGET_ARCH.sh"
for u in ${AUTOPORT_UNSTAGE_ARCHS}; do
@ -255,6 +259,7 @@ fetch_repfiles() {
return
}
done
[ "$VERBOSE_MODE" = "1" ] && echo "Fetching ${REPS_BASE_URL}/${PORT_REPOSITORY/-*}/unstage.$TARGET_ARCH"
curl -f -L -s ${REPS_BASE_URL}/${PORT_REPOSITORY/-*}/unstage.$TARGET_ARCH -o $DATADIR/$PORT_REPOSITORY/unstage.$TARGET_ARCH ||
echo "Warning: unable to fetch ${REPS_BASE_URL}/${PORT_REPOSITORY/-*}/unstage.$TARGET_ARCH"
}
@ -436,12 +441,11 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do
fi
done
echo "Packages to rebuild: ${JOB[*]}"
else
echo "Packages to port: ${needport_list[*]}"
for p in ${needport_list[*]}; do
JOB=(${JOB[*]} $p)
done
fi
echo "Packages to port: ${needport_list[*]}"
for p in ${needport_list[*]}; do
JOB=(${JOB[*]} $p)
done
[ -e $DATADIR/autoport-$PORT_REPOSITORY-current ] && \
mv $DATADIR/autoport-$PORT_REPOSITORY-current $DATADIR/autoport-$PORT_REPOSITORY-last
@ -538,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
@ -601,10 +609,11 @@ for TARGET_ARCH in ${TARGET_ARCHS}; do
echo "(FAILED) [can't get repository information for this package]"
continue
}
src_release_num=`echo $src_release | sed "s|\([0-9.]*\).*|\1|"`
[ "$VERBOSE_MODE" ] && echo "
%% COMMAND: LANG=C LC_ALL=C autospec -u ${JOB_CURRENT} -a4 --rebuild --changelog \"$REBUILD_MILESTONE milestone rebuild\""
%% COMMAND: LANG=C LC_ALL=C autospec -u ${JOB_CURRENT} -a4 --changelog \"$REBUILD_MILESTONE milestone rebuild\" $src_version $src_release_num${REBUILD_MILESTONE}"
# FIXME: should be implemented in autodist
LANG=C LC_ALL=C autospec -u ${JOB_CURRENT} -a4 --rebuild --changelog "$REBUILD_MILESTONE milestone rebuild" &>$tmpfile
LANG=C LC_ALL=C autospec -u ${JOB_CURRENT} -a4 --changelog "$REBUILD_MILESTONE milestone rebuild" $src_version $src_release_num${REBUILD_MILESTONE} &>$tmpfile
[ $? -gt 0 ] && {
if [ "$VERBOSE_MODE" ]; then
echo

View File

@ -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
}

View File

@ -12,7 +12,6 @@ makedist
makedist-openmamba
postplug
grub-theme-openmamba
kdevelop
lxde
distromatic
u-boot

View File

@ -1,7 +1,8 @@
# Global configuration file for autodist
#
AUTODIST_ARCHS=(i586 x86_64 arm)
REPS_BASE_URL=http://www.openmamba.org/pub/openmamba
SITE_BASE_URL=http://www.openmamba.org
REPS_BASE_URL=${SITE_BASE_URL}/pub/openmamba
LOCAL_REPS_BASE_DIR=/var/ftp/pub/openmamba
SEND_SERVER=devel-autodist
#WEBBUILD_URL=http://localhost/cgi-bin/webbuild

View File

@ -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

View File

@ -1,33 +1,48 @@
#!/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="+40"
SOURCES_PATH_CTIME_OLD="+730"
SRPMS_CTIME_OLD="+14"
TMP_CTIME_OLD="+2"
function clean() {
dir=$1
arch=$2
find $dir/RPM/RPMS/$arch/ -maxdepth 1 -ctime +21 -exec rm -rf {} \;
find $dir/RPM/RPMS/noarch/ -maxdepth 1 -ctime +21 -exec rm -rf {} \;
find $dir/RPM/BUILD/ -maxdepth 1 -ctime +21 -exec rm -rf {} \;
find $dir/RPM/SOURCES/ -maxdepth 1 -ctime +120 -a ! -name "*.patch" -exec rm -rf {} \;
find $dir/RPM/SRPMS/ -maxdepth 1 -ctime +48 -exec rm -rf {} \;
[ "$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 {} \;
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 {} \;
[ -e $dir/RPM/BUILD/ ] && find $dir/RPM/BUILD/ -mindepth 1 -maxdepth 1 -type d -ctime ${BUILD_CTIME_OLD} -exec rm -rf {} \;
[ -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_PATH_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/ -maxdepth 1 -ctime +25 -exec rm -rf {} \;
find /var/autoport/$a/tmp/ -maxdepth 1 -ctime +25 -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/ -maxdepth 1 -ctime +25 -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/ -maxdepth 1 -ctime +25 -exec rm -rf {} \;
find /var/autodist-tmp/ -mindepth 1 -maxdepth 1 -type f -mtime ${TMP_CTIME_OLD} -exec rm -rf {} \;
fi
done

View File

@ -1,13 +1,16 @@
#!/bin/bash
#
# autodist autoupdate hourly cron script
# (c) 2008-2013 by Silvan Calarco <silvan.calarco@mambasoft.it>
# (c) 2008-2014 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
. /etc/autodist/config
. /etc/sysconfig/autoport
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
@ -18,7 +21,7 @@ fi
exit 0
}
PIDFILE=/var/run/autodist/autodist.pid
PIDFILE=/run/autodist/autodist.pid
HOUR=`date +%H`
[ "`uname -m`" = "x86_64" ] && HOST_IS_X86_64=1

View File

@ -1,7 +1,7 @@
#!/bin/bash
#
# openmamba-autobuild-autoport daily cron script
# (c) 2008-2012 by Silvan Calarco <silvan.calarco@mambasoft.it>
# (c) 2008-2014 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
#. /etc/sysconfig/openmamba-central
. /etc/sysconfig/autoport
@ -14,7 +14,7 @@ ME=`basename $0`
exit 0
}
PIDFILE=/var/run/autodist/autoport.pid
PIDFILE=/run/autodist/autoport.pid
HOUR=`date +%H`
[ "`uname -m`" = "x86_64" ] && HOST_IS_X86_64=1
@ -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,13 @@ 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 smart update > /dev/null
LANG=C smart upgrade -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`

View File

@ -14,7 +14,7 @@ ME=`basename $0`
exit 0
}
PIDFILE=/var/run/autodist/autoport.pid
PIDFILE=/run/autodist/autoport.pid
HOUR=`date +%H`
[ "`uname -m`" = "x86_64" ] && HOST_IS_X86_64=1

191
telegram/openmamba_bot.py Executable file
View 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()

View 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

View File

@ -21,6 +21,7 @@ var reloadtime = 0;
function ajax_getvalues() {
var url = window.location.protocol+"//"+window.location.hostname+"/cgi-bin/autodist?FORMAT=xml&"+window.location.href.replace(/.*\?/,"");
var xmlhttp;
if (window.XMLHttpRequest)
xmlhttp = new XMLHttpRequest();
else if (window.ActiveXObject)

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

View 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;
}

View 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; }

View File

@ -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; }

View File

@ -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>
@ -92,6 +94,7 @@ function editorChanged() {
function ajax_getvalues(request,confirm) {
var url = "/cgi-bin/webbuild"
var xmlhttp;
if (!user) {
user=getCookie("webbuild-user");
@ -258,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">
&nbsp;&nbsp;&nbsp;<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>
@ -304,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>

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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
}
@ -168,7 +174,7 @@ function cgi_getvars()
p=`echo $q | sed "s|&.*||"`
q=`echo $q | sed "s|[^&]*&||"`
k="${p%%=*}" # get the key (variable name) from it
[ "$k" = "REMOTE_ADDR" -o "$k" = "REMOTE_HOST" -o "$k" = "REMOTE_PORT" -o "$k" = "REMOTE_USER" ] && continue
[ ! "$k" -o "$k" = "REMOTE_ADDR" -o "$k" = "REMOTE_HOST" -o "$k" = "REMOTE_PORT" -o "$k" = "REMOTE_USER" ] && continue
v="${p#*=}" # get the value from it
# decode and evaluate var if requested
if [ "$k" != "SPECTEXT" ]; then
@ -179,6 +185,20 @@ function cgi_getvars()
return
}
function var2html()
{
eval r=\$$1
r="${r//\&/&amp;}"
r="${r//\</&lt;}"
r="${r//\\\n/<br>}"
r="${r//\\/&#92;}"
r="${r//\"/&quot;}"
r="${r//\$/&#36;}"
r="${r//\`/&#96;}"
r="${r//\*/&#42;}"
echo "${r}"
}
function kill_tree() {
local killpid=$1
@ -239,22 +259,26 @@ 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|<|\&lt;|g;s|[[:cntrl:]]\[[0-9;]*m||g;
s|\\\|\\\\\\\|g;s|<|\&lt;|g;
s|[[:cntrl:]]\[[0-9;]*m||g;
s|&lt;font|<font|g;
s|&lt;/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:red;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|<|\&lt;|g;s|[[:cntrl:]]\[[0-9;]*m||g;
s|<|\&lt;|g;
s|[[:cntrl:]]\[[0-9;]*m||g;
s|&lt;font|<font|g;
s|&lt;/font|</font|g;
s|^\([\+#] .*\)|<font style=\"color:cyan\">\1</font>|;
@ -264,13 +288,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|\&lt;|<|"`
local SEARCH_STRING=`echo "$line" | sed "s|.*%SRCURL%\(.*\)%SRCURLEND%.*|\1|;s|\&lt;|<|"`
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
}

View File

@ -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`
@ -56,10 +56,10 @@ function showlog() {
echo -n "<pre>"
if [ "$LOGTYPE" = "processtail" ]; then
echo -n "<!-- SCROLL -->"
tail -n +0 -f $f --pid $PROCESSPID | stdbuf -oL sed "s|<|\&lt;|g"
tail -n +0 -f $f --pid $PROCESSPID | stdbuf -oL sed "s|<\([/]pre>\)|\&lt;\1|g"
echo -n "<!-- ENDSCROLL -->"
else
if [ $LOGFILESIZE -lt 524288 ]; then
if [ $LOGFILESIZE -lt 12097152 ]; then
if [ -r $f ]; then
cat $f | parse_build_output $PACKAGE
else
@ -67,13 +67,13 @@ function showlog() {
fi
else
if [ -r $f ]; then
head -c 262144 $f | parse_build_output $PACKAGE
head -c 1048576 $f | parse_build_output $PACKAGE
echo "<br><font style=\"background-color:yellow;color:black\">&lt;------ CUT (long file) -------&gt;</font>"
tail -c 262144 $f | parse_build_output $PACKAGE
tail -c 1048576 $f | parse_build_output $PACKAGE
else
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "head -c 262144 $f" | parse_build_output $PACKAGE
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "head -c 1048576 $f" | parse_build_output $PACKAGE
echo "<br><font style=\"background-color:yellow;color:black\">&lt;------ CUT (long file) -------&gt;</font>"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "tail -c 262144 $f" | parse_build_output $PACKAGE
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "tail -c 1048576 $f" | parse_build_output $PACKAGE
fi
fi
fi
@ -84,7 +84,7 @@ function showlog() {
function showEnvironmentPanel() {
echo -n "Build host: <b>`hostname`</b><br>"
echo -n "Host: <b>`hostname`</b><br>"
echo -n "Environment: <b>"
if [ "${AUTOPORT_CHROOT_USER[$ENVIRONMENT]}" ]; then
echo -n "${AUTOPORT_CHROOT_USER[$ENVIRONMENT]} - "
@ -108,33 +108,18 @@ function showEnvironmentPanel() {
# toolchain
echo -n "<br>"
local toolchain_output=`LANGUAGE=C $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "gcc --version | head -n1; LANGUAGE=C ld -v"`
local gcc_ver=`echo $toolchain_output | sed "s|.*(GCC) \([0-9.]*\) .*|\1|"`
local binutils_ver=`echo $toolchain_output | sed "s|.*GNU \(.*\) (GNU Binutils.*)\(.*\)|\1 \2|"`
echo "Toolchain: gcc $gcc_ver, $binutils_ver"
# system upgrade
echo -n "<br><input type=button id=smartupgrade value=\"system upgrade\" onclick="
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>"
## 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\");>"
# rpm manager
echo -n "<input type=button id=rpmmanager value=\"RPM manager\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "REQUEST=rpmmanager\");>"
# environment search
echo -n "<br><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 "onfocus=\"if (this.value==this.defaultValue) this.value=''\" "
echo -n "onkeypress=if(checkEnter(event))ajax_getvalues(\""
echo -n "ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "REQUEST=environmentsearch&ENVSEARCHTEXT=\"+encodeURIComponent(getElementById('environmentsearch').value));></div>"
if [ ! -e $WEBBUILD_STATEDIR/cache/environment-$ENVIRONMENT-data -o \
"`find $WEBBUILD_STATEDIR/cache/environment-$ENVIRONMENT-data -mmin +5`" ]; then
local toolchain_output=`LANGUAGE=C $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "gcc --version | head -n1; LANGUAGE=C clang -v | head -n1; LANGUAGE=C ld -v"`
local gcc_ver=`echo $toolchain_output | sed "s|.*(GCC) \([0-9.]*\) .*|\1|"`
local binutils_ver=`echo $toolchain_output | sed "s|.*GNU \(.*\) (GNU Binutils.*)\(.*\)|\1 \2|"`
local clang_ver=`echo $toolchain_output | sed "s|.*clang version \([0-9.]*\) .*|\1|"`
local toolchain_text="gcc $gcc_ver, clang $clang_ver, $binutils_ver"
echo "$toolchain_text" > $WEBBUILD_STATEDIR/cache/environment-$ENVIRONMENT-data
else
local toolchain_text=`cat $WEBBUILD_STATEDIR/cache/environment-$ENVIRONMENT-data`
fi
echo "Toolchain: $toolchain_text"
}
@ -154,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>"
}
@ -163,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()));"
@ -178,22 +178,71 @@ function print_editorcontrols() {
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "REQUEST=deletespec\",\"`cgi_encodevar "Really delete <b>$PACKAGE.spec</b>?"`\")>"
# specfile rename
echo -n "<input type=button id=updatespecbutton value=\"rename to:\" onclick="
echo -n "<input type=button id=updatespecbutton value=\"rename:\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&RENAMESPECFROM=$PACKAGE&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&"
echo -n "REQUEST=renamespec&PACKAGE=\"+encodeURIComponent(getElementById('specnewname').value));>"
echo -n "<input type=text id=specnewname value=\"\" size=12>.spec"
# add a note
echo -n "<label>"
echo -n "<input type=button id=addpkgnote value=\"add a note:\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "<input type=text id=specnewname value=\"\" size=6>"
# unpack
echo -n "<input type=button value=\"prepare\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=rpmprepare&"
echo -n "RPMBUILDARCH=\"+getSelectedValueById('rpmbuildarch')+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue()));>"
# build
echo -n "<input type=button value=\"build\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=rpmbuild&"
echo -n "RPMBUILDARCH=\"+getSelectedValueById('rpmbuildarch')+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&RPMFORCE=\"+getElementById('rpmforce').checked); class=boldbutton>"
# unpackaged files
echo -n "<input type=button value=\"unpackaged list\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autospeclistcheck&"
echo -n "RPMBUILDARCH=\"+getSelectedValueById('rpmbuildarch')+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue()));>"
# build requirements
echo -n "<input type=button value=\"build reqs\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autospecbuildreq\");>"
# rpm install
[ ! "$USER_CANINSTALL" ] && DISABLED="disabled=disabled"
echo -n "<input type=button id=rpminstallbutton value=\"install\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=rpminstall&"
echo -n "RPMFORCE=\"+getElementById('rpmforce').checked"
echo -n ",\"`cgi_encodevar "Install <b>$PACKAGE</b> in current environment?"`\""
echo -n "); class=redbutton $DISABLED>"
# rpm send
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 id=sendpackagebutton value=\"send\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=sendpackage&"
echo -n "SENDRECREATESRPM=\"+getElementById('sendrecreatesrpm').checked+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&"
echo -n "REQUEST=addpkgnote&PKGNOTE=\"+encodeURIComponent(getElementById('pkgnote').value));></label></span>"
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></div>"
echo -n "AUTODISTARCH=\"+getSelectedValueById('rpmbuildarch')+\"&"
echo -n "SENDREPOSITORY=\"+getSelectedValueById('sendrepository')"
echo -n ",\"`cgi_encodevar "Send <b>$PACKAGE</b> built packages to <b>"`\"+getSelectedValueById('sendrepository')+"
echo -n "\"`cgi_encodevar "</b>?<br><br><font color=goldenrod>HINT: does summary look short and good?</font><br><b>${SPECVAR_Name[0]} - ${SPECVAR_Summary[0]}.</b>"`\""
echo -n "); class=redbutton $HREFADD>"
# recreate and send SRPM
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 id=sendsourcebutton value=\"send SRPM\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=sendsource&"
echo -n "RPMFORCE=\"+getElementById('rpmforce').checked+\"&"
echo -n "SENDRECREATESRPM=\"+getElementById('sendrecreatesrpm').checked+\"&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&"
echo -n "SENDREPOSITORY=\"+getSelectedValueById('sendrepository')"
echo -n ",\"`cgi_encodevar "Send <b>$PACKAGE</b> source package only to <b>"`\"+getSelectedValueById('sendrepository')+"
echo -n "\"`cgi_encodevar "</b>?<br><br>WARNING: use this to refresh the SRPM of a package which already exists with same release in repository"`\""
echo -n "); class=redbutton $HREFADD>"
# recreate SRPM before sending checkbox
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+\"&"
@ -201,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 "&nbsp;<label>to new version:</label><input type=text id=updatespecversion value=\"\" size=\"10\">"
echo -n "&nbsp;<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>"
@ -220,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|<|\&lt;|g;s|[[:cntrl:]]\[[0-9;]*m||g\"" | parse_generic_output
"cd $SPECVAR_RPMBUILDDIR/$SPECVAR_BUILDDIR && head -c 10240 $f | strings | sed \"s|<|\&lt;|g;s|[[:cntrl:]]\[[0-9;]*m||g\"" | parse_generic_output
RET=$?
echo -n "</pre>"
done
@ -241,7 +288,6 @@ function download_file() {
local f
for f in $download_files; do
echo $f >> /tmp/down
echo -e "Content-Type: application/octet-stream"
echo -e "Content-Disposition: attachment; filename=\"${f/*\/}\"\n"
if [ "$download_environment" ]; then
@ -250,7 +296,7 @@ echo $f >> /tmp/down
cat $f 2>/dev/null
fi
done
RET=$?
return $RET
}
@ -276,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 ;;

View File

@ -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|"`