Compare commits

...

37 Commits

Author SHA1 Message Date
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
73791f2c58 Release 0.9.19 2014-09-05 22:39:23 +02:00
8aaf239342 webbuild-cgi: honour selected target arch when sending package 2014-09-05 22:36:46 +02:00
9ab37c25c2 autodist-upstream-updates: only accept even numbers (also 1.x and 2.x) as stable from Gnome upstream list 2014-09-05 19:10:42 +02:00
491357aebb autodist-repository: new "install" option to install packages with rpm directly from local repositories 2014-09-05 19:08:34 +02:00
bf3085f435 autodist-cgi: check if host is up before fetching cgi data from secondary sites 2014-08-23 13:30:45 +02:00
f6543e78fa Release 0.9.18 2014-08-21 13:26:47 +02:00
ea098185e1 autoport: check if source is present in target arch, not source, before rebuilding 2014-08-21 13:13:36 +02:00
52f9b3e9e0 autodist-upstream-updates: try to detect and remove unstable releases in parse_gnome() 2014-07-27 13:49:10 +02:00
18 changed files with 459 additions and 268 deletions

View File

@ -17,7 +17,7 @@ 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
@ -62,9 +62,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
@ -101,6 +101,7 @@ 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
@touch $(DESTDIR)$(pck_statedir)/template/autoupdate/auto.success
@touch $(DESTDIR)$(pck_statedir)/template/autoupdate/auto.skip

View File

@ -1 +1 @@
VERSION = 0.9.16
VERSION = 0.9.22

View File

@ -5,7 +5,7 @@
#
# Released under the terms of the GNU GPL release 3 license
#
VERSION=0.9.16
VERSION=0.9.21
me=(${0##*/} $VERSION "Sat Aug 20 2010")
exec 3>`readlink /proc/self/fd/0`
@ -94,7 +94,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

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
@ -164,7 +164,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 +192,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
@ -218,7 +218,7 @@ _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;">
_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
@ -358,10 +358,14 @@ done
# only root host (0) calls other hosts
if [ "$AS_HOST" = "0" -a ! "$SHOWLOG" ]; then
for h in `seq 1 ${#AUTOPORT_CGI_HOST[*]}`; do
if [ "$NUM" -a "$HOST" = "$h" ]; then
curl "${AUTOPORT_CGI_HOST[$h]}?AS_HOST=$h&LINES=$LINES&NUM=$NUM&REP=$RNUM&HOST=$HOST" 2>/dev/null
elif [ ! "$NUM" ]; then
curl "${AUTOPORT_CGI_HOST[$h]}?AS_HOST=$h&LINES=$LINES" 2>/dev/null
WBHOSTURL=`echo ${AUTOPORT_CGI_HOST[$h]} | sed "s|^\(http[s]*://[^/]*\).*$|\1|"`
if [ "$WBHOSTURL" ]; then
curl -m1 -s -I ${WBHOSTURL} >/dev/null || continue
if [ "$NUM" -a "$HOST" = "$h" ]; then
curl "${AUTOPORT_CGI_HOST[$h]}?AS_HOST=$h&LINES=$LINES&NUM=$NUM&REP=$RNUM&HOST=$HOST" 2>/dev/null
elif [ ! "$NUM" ]; then
curl "${AUTOPORT_CGI_HOST[$h]}?AS_HOST=$h&LINES=$LINES" 2>/dev/null
fi
fi
done
fi

View File

@ -15,21 +15,22 @@ function usage() {
echo "Copyright (c) 2007-2014 by Silvan Calarco"
echo
echo "Usage:"
echo "$me list"
echo "$me import REPOSITORY [PKGS ...] [-d REPOSITORY] [-s] [-y]"
echo "$me release REPOSITORY [PKGS ...] [-d REPOSITORY] [-s] [-y]"
echo "$me archive REPOSITORY PKGS ..."
echo "$me restore REPOSITORY PKGS ..."
echo "$me query REPOSITORY PKGS ..."
echo "$me search [-i] [-r regexp] STRING"
echo "$me verify REPOSITORY [PKGS ...]"
echo "$me inspect REPOSITORY {PKGS ...} [-d REPOSITORY]"
echo "$me setwarning REPOSITORY {PKG ...} -t \"TEXT\""
echo "$me diff REPOSITORY [PKGS ...] [-d REPOSITORY]"
echo "$me distromatic REPOSITORY"
echo "$me install REPOSITORY [PKGS ...] [-f]"
echo "$me import REPOSITORY [PKGS ...] [-d REPOSITORY] [-s] [-y]"
echo "$me inspect REPOSITORY {PKGS ...} [-d REPOSITORY]"
echo "$me list"
echo "$me query REPOSITORY PKGS ..."
echo "$me release REPOSITORY [PKGS ...] [-d REPOSITORY] [-s] [-y]"
echo "$me restore REPOSITORY PKGS ..."
echo "$me search [-i] [-r regexp] STRING"
echo "$me setwarning REPOSITORY {PKG ...} -t \"TEXT\""
echo "$me verify REPOSITORY [PKGS ...]"
echo
echo " -d use given repository as destination (default: devel)"
echo " -f force import to destination repository"
echo " -f force operation"
echo " -r match repositories with given regexp"
echo " -s simulate operations to see if it would work"
echo " -t warning text"
@ -152,6 +153,38 @@ function get_pkg_buildinfo() {
return 0
}
# get_pkg_info - uses distromatic generated build file to get packages information from the repository
#
# $1: repository name
# $2: architecture
# $3: pkg name
function get_pkg_info() {
local pkg buildarch rep line
[ $1 ] && rep=$1 || exit 200
[ $2 ] && buildarch=$2 || exit 200
[ $3 ] && pkg=$3 || exit 200
[ -e ${PKGLIST}.$buildarch ] || {
echo "ERROR: get_pkg_info: file ${PKGLIST}.$buildarch missing; aborting."
exit 1
}
line=`grep "^$pkg " ${PKGLIST}.$buildarch 2>/dev/null | tail -n1`
set -- $line
pkg_name=$1
pkg_version=$2
pkg_size=$3
pkg_unknown=$4
pkg_repository=$5
pkg_unknown2=$6
pkg_release=$7
pkg_arch=$buildarch
return 0
}
function import_file() {
[ $1 ] || exit 200
@ -638,7 +671,7 @@ while [ "$1" ]; do
*)
if [ "$command" ]; then
case "$command" in
"import"|"release"|"query"|"verify"|"archive"|"restore"|"diff"|"inspect"|"setwarning"|"distromatic")
"import"|"release"|"query"|"verify"|"archive"|"restore"|"diff"|"inspect"|"install"|"setwarning"|"distromatic")
[ "$origrepository" ] &&
packages="$packages $1" ||
origrepository=$1
@ -657,7 +690,7 @@ while [ "$1" ]; do
esac
else
case "$1" in
"import"|"release"|"query"|"verify"|"archive"|"restore"|"list"|"diff"|"inspect"|"setwarning"|"distromatic"|"search") command=$1 ;;
"import"|"release"|"query"|"verify"|"archive"|"restore"|"list"|"diff"|"inspect"|"install"|"setwarning"|"distromatic"|"search") command=$1 ;;
*)
usage
echo "Errror: $1 is not a valid command; aborting."
@ -711,6 +744,7 @@ done
[ "$origrepository" ] || { usage; exit 200; }
SRCPKGLIST="${LOCAL_REPS_BASE_DIR}/$origrepository/srcpkglist"
PKGLIST="${LOCAL_REPS_BASE_DIR}/$origrepository/pkglist"
[ "$DEST_MODE" ] || { echo "ERROR: $destrepository is not a valid repository; aborting." >&2; exit 200; }
[ "$ORIG_MODE" ] || { echo "ERROR: $origrepository is not a valid repository; aborting." >&2; exit 200; }
@ -896,6 +930,60 @@ SRCPKGLIST="${LOCAL_REPS_BASE_DIR}/$origrepository/srcpkglist"
exit 0;
}
[ "$command" = "install" ] && {
[ "$packages" ] || { usage; exit 1; }
myarch=`uname -p`
if [ "$myarch" = "*686" -o "$myarch" = "athlon" -o "$myarch" = "pentium*" ]; then
myarch="i586"
fi
for i in $packages; do
pkg=$i
pkgarch=
if [ "${i/.*}" != "${i}" ]; then
pkg=${i/.*}
pkgarch=${i/*.}
fi
if [ "$pkgarch" -a "$pkgarch" != "$myarch" ]; then
get_pkg_info $origrepository $pkgarch $pkg
[ "$pkg_name" ] || {
echo "WARNING: $pkg not found in $origrepository for arch $pkgarch; skipping."
continue
}
else
get_pkg_info $origrepository $myarch $pkg
[ "$pkg_name" ] || {
echo "WARNING: $pkg not found in $origrepository for arch $myarch; skipping."
continue
}
fi
pkg_file=${pkg_name}-${pkg_version}-${pkg_release}.$pkg_arch.rpm
pkg_path=${LOCAL_REPS_BASE_DIR}/$pkg_repository/RPMS.$pkg_arch/${pkg_file}
[ -r $pkg_path ] || {
echo "WARNING: file $pkg_path should exist but doesn't; skipping."
continue
}
echo "Installing $pkg_file..."
if [ "$force" = "1" ]; then
rpm -i $pkg_path --force
rpmret=$?
[ $rpmret -gt 0 ] && echo "WARNING: rpm returned $rpmret"
if [ "$pkg_arch" != "$myarch" ]; then
pkg_file=${pkg_name}-${pkg_version}-${pkg_release}.$myarch.rpm
pkg_path=${LOCAL_REPS_BASE_DIR}/$pkg_repository/RPMS.$myarch/${pkg_file}
echo "Other arch installation forced; reinstalling native arch package after..."
rpm -i $pkg_path --force
rpmret=$?
[ $rpmret -gt 0 ] && echo "WARNING: rpm returned $rpmret"
fi
else
rpm -i $pkg_path
rpmret=$?
[ $rpmret -gt 0 ] && echo "WARNING: rpm returned $rpmret"
fi
done
exit 0;
}
[ "$command" = "distromatic" ] && {
[ -r $SRCPKGLIST ] || {
echo "ERROR: srcpkglist file missing for $origrepository repository; aborting." >&2

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-2013 by Silvan Calarco <silvan.calarco@mambasoft.it>
# Copyright (c) 2004-2014 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
#[ -r /etc/sysconfig/openmamba-central ] || {
@ -231,7 +231,16 @@ parse_gnome() {
ver="$3"
alias=`grep "^$pkg " $ALIASES_DB`
[ "$alias" ] || alias=`grep "^lib$pkg " $ALIASES_DB`
[ "$pkg" -a "$ver" ] && echo "$pkg $ver $SOURCEURL ${alias/* /}" >> $tmpfile
if [ "$pkg" -a "$ver" ]; then
ver1=$(echo $ver | cut -d. -f1)
ver2=$(echo $ver | cut -d. -f2)
if [ "$ver2" -a $(($ver2 % 2)) -ne 0 ]; then
# skip unstable versions with odd numbers
continue
else
echo "$pkg $ver $SOURCEURL ${alias/* /}" >> $tmpfile
fi
fi
fi
done
done

View File

@ -4,7 +4,7 @@
#
# Released under the terms of the GNU GPL release 3 license
#
VERSION=0.9.16
VERSION=0.9.22
BASE_ARCH=i586
BASE_REPOSITORY=devel
@ -148,24 +148,22 @@ function get_pkg_buildinfo() {
# }
# . $DISTROMATIC_BUILD_FILE
for i in ${pkg_list[*]}; do
if [ "$i" == "${pkg_header[0]}" ]; then
pkg_name=${pkg_header[0]};
# Note: pkg_arch reported in builds file is just last arch source was
# built for, so we use repository arch instead
pkg_arch=${pkg_header[1]};
[ "$pkg_arch" = "noarch" ] || pkg_arch=${local_arch}
pkg_version=${pkg_header[2]};
pkg_release=${pkg_header[3]};
pkg_group=${pkg_header[4]};
pkg_license=${pkg_header[5]};
pkg_size=${pkg_header[6]};
pkg_buildtime=${pkg_header[7]};
pkg_altrep=${pkg_header[8]};
pkg_repository=${pkg_header[9]};
return 0
fi
done
if [ "${pkg_header[0]}" ]; then
pkg_name=${pkg_header[0]};
# Note: pkg_arch reported in builds file is just last arch source was
# built for, so we use repository arch instead
pkg_arch=${pkg_header[1]};
[ "$pkg_arch" = "noarch" ] || pkg_arch=${local_arch}
pkg_version=${pkg_header[2]};
pkg_release=${pkg_header[3]};
pkg_group=${pkg_header[4]};
pkg_license=${pkg_header[5]};
pkg_size=${pkg_header[6]};
pkg_buildtime=${pkg_header[7]};
pkg_altrep=${pkg_header[8]};
pkg_repository=${pkg_header[9]};
return 0
fi
unset pkg_name pkg_arch pkg_version pkg_release \
pkg_group pkg_license pkg_size pkg_buildtime pkg_altrep pkg_repository
@ -186,7 +184,7 @@ _EOF
function find_source_by_provide() {
local pkg=`echo $2 | sed "s|(|\\\\\[|g;s|)|\\\\\]|g;s|:|_|g"`
grep "^$pkg:" $DATADIR/$1/sources-$BASE_ARCH | \
grep "^$pkg:" $DATADIR/$1/sources-{$BASE_ARCH,$TARGET_ARCH} | \
awk '{ $1=""; print $0 }' | \
sed "s|[[:space:]]_| |g"
}
@ -213,9 +211,16 @@ function find_requirements() {
> $tf
sort -u $tf1 | while read line; do
REQ=`find_source_by_provide $PORT_REPOSITORY ${line}`
[ "$REQ" ] && \
echo "${REQ}" >> $tf || \
if [ "$REQ" ]; then
get_pkg_buildinfo $DATADIR/$PORT_REPOSITORY $TARGET_ARCH $REQ
if [ "$pkg_name" ]; then
echo -n "$line(notrebuilding) "
else
echo "${REQ}" >> $tf
fi
else
echo -n "$line(unresolved) "
fi
done
> $tf1
cat $tf | sort -u 2>/dev/null | while read line; do
@ -236,10 +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
@ -248,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"
}
@ -429,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
@ -594,10 +605,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

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

@ -1,14 +1,23 @@
#!/bin/bash
[ -e /etc/sysconfig/autoport ] && . /etc/sysconfig/autoport
RPMS_CTIME_OLD="+14"
BUILD_CTIME_OLD="+14"
SOURCES_CTIME_OLD="+60"
SRPMS_CTIME_OLD="+30"
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 {} \;
[ -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 i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
@ -18,16 +27,16 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
[ -e /var/autoport/$a/var/autodist/RPM/RPMS/$arch ] && \
clean /var/autoport/$a/var/autodist ${AUTOPORT_ARCH[$i]}
[ -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 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \;
find /var/autoport/$a/tmp/ -mindepth 1 -maxdepth 1 -ctime ${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 {} \;
find /var/autodist-tmp/ -mindepth 1 -maxdepth 1 -ctime ${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]}
fi
find /var/autodist-tmp/ -maxdepth 1 -ctime +25 -exec rm -rf {} \;
find /var/autodist-tmp/ -mindepth 1 -maxdepth 1 -ctime ${TMP_CTIME_OLD} -exec rm -rf {} \;
fi
done

View File

@ -1,7 +1,7 @@
#!/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
@ -18,7 +18,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

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

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)

View File

@ -92,6 +92,7 @@ function editorChanged() {
function ajax_getvalues(request,confirm) {
var url = "/cgi-bin/webbuild"
var xmlhttp;
if (!user) {
user=getCookie("webbuild-user");

View File

@ -1,7 +1,7 @@
#!/bin/bash
#
# webbuild cgi script
# Copyright (c) 2012-2014 by Silvan Calarco <silvan.calarco@mambasoft.it>
# Copyright (c) 2012-2015 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
. /usr/share/autodist/webbuild-functions
. /usr/share/autodist/webbuild-functions-private
@ -466,8 +466,10 @@ 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 "<pre><!-- SCROLL -->"
curl -s "${WEBBUILD_DISTROQUERY_URL}?query=$REPSEARCHTEXT&search_milestone2=true&search_devel=true\
&search_i586=true&search_x86_64=true&search_arm=true&search_sources=true&query_compact=true&replyplain=true"
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\
&search_i586=true&search_x86_64=true&search_arm=true&search_sources=true&query_compact=true&replyplain=true" | \
sed "s| \(href=.\)/| \1${SITE_BASE_URL}/|g"
# $SUDO_WRAPPER 0 local "$USER" "" "autodist-repository search -i ${REPSEARCHTEXT/-/\-}" | \
# parse_search_output ${AUTOPORT_ARCH[$ENVIRONMENT]}
# sed "s|\(.*(source).*\)|<font color=white><b>\1</b></font>|;
@ -577,6 +579,7 @@ if [ "$REQUEST" = "rpmmanager" ]; then
echo -n "<input type=button value=\"install\" onclick="
echo -n "p=getCheckedValuesByName('rpmmanagercheckbox');"
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "RPMMANAGERDIR=$RPMMANAGERDIR&"
echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&"
echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&"
echo -n "RPMMANAGERFORCE=\"+getElementById('rpmmanagerforce').checked+\"&"
@ -588,6 +591,7 @@ if [ "$REQUEST" = "rpmmanager" ]; then
echo -n "<input type=button value=\"upgrade\" onclick="
echo -n "p=getCheckedValuesByName('rpmmanagercheckbox');"
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "RPMMANAGERDIR=$RPMMANAGERDIR&"
echo -n "RPMMANAGERPACKAGES=\"+encodeURIComponent(p)+\"&"
echo -n "RPMMANAGERFORCE=\"+getElementById('rpmmanagerforce').checked+\"&"
echo -n "REQUEST=rpmmanagerupgrade\""
@ -650,6 +654,10 @@ echo -n "<topcontrols><![CDATA["
# new session button
echo -n "<input type=button id=newsessionbutton value=\"New session\" onclick="
echo -n "window.open(document.URL);>"
# 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\");>"
# expert mode checkbox
[ "$STATE_ADVANCEDCONTROLS" ] && CHECKED="checked=checked" || CHECKED=
echo -n " <span style=\"white-space:nowrap\">Autodist:<input type=checkbox id=\"advancedcontrols\" "
@ -889,12 +897,12 @@ if [ "$MAINTAINERMODE" = "true" -o ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then
#(getElementById('package').selectedIndex);>"
echo "<option value=\"\">-- Select a SRPM package --</option>"
SRPMBUTTONDISABLED="disabled=disabled"
if [ -e $local_ftp/$REPOSITORY ]; then
if [ "$local_ftp" -a -e $local_ftp/$REPOSITORY ]; then
if [ $local_ftp/$REPOSITORY/SRPMS.base -nt $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY ]; then
ls --color=none $local_ftp/$REPOSITORY/SRPMS.base/ | grep ".src.rpm$" | sort -f > $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY
fi
else
curl $REPS_BASE_URL/$REPOSITORY/SRPMS.base/ | grep .src.rpm | \
curl -s $REPS_BASE_URL/$REPOSITORY/SRPMS.base/ | grep .src.rpm | \
sed "s|.*\.src\.rpm\">\(.*\)</a>.*|\1|" | sort -f > $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY
fi
while read f; do
@ -972,8 +980,7 @@ if [ "$REQUEST" = "changespec" ]; then
REQUEST="edit";
fi
elif [ "$REQUEST" = "broadcastmessage" ]; then
BROADCASTMESSAGE=`echo $BROADCASTMESSAGE | sed "s|<|\&lt;|g"`
social_log "SUSER=$USER STYPE=broadcastmessage SEMAIL=$USER_EMAIL STEXT=\"said:&quot;<i>$BROADCASTMESSAGE</i>&quot;\" STIME=`date +%s`"
social_log "SUSER=$USER STYPE=broadcastmessage SEMAIL=$USER_EMAIL STEXT=\"said:&quot;<i>`var2html BROADCASTMESSAGE`</i>&quot;\" STIME=`date +%s`"
REQUEST=
fi
@ -1005,7 +1012,12 @@ fi
if [ "$REQUEST" = "prepare" -o "$REQUEST" = "updatespec" -o "$REQUEST" = "speccreate" -o \
"$REQUEST" = "rebuildspec" -o "$REQUEST" = "renamespec" -o "$REQUEST" = "deletespec" -o \
"$REQUEST" = "autodistprepare" -o "$REQUEST" = "autodistupdate" -o "$REQUEST" = "addpkgnote" ]; then
echo -n "<output><![CDATA[<hr><b>Console output:</b><div align=left class=output id=outputbottom>"
if [ "$REQUEST" = "speccreate" ]; then
OUTPUTMODE="outputtop"
else
OUTPUTMODE="outputbottom"
fi
echo -n "<output><![CDATA[<hr><b>Console output:</b><div align=left class=output id=$OUTPUTMODE>"
echo -n "<pre>"
RET=255
case $REQUEST in
@ -1028,30 +1040,40 @@ if [ "$REQUEST" = "prepare" -o "$REQUEST" = "updatespec" -o "$REQUEST" = "speccr
RET=$?
;;
"speccreate") if [ "$SPECCREATEURL" -a "$PACKAGE" ]; then
if [ "${SPECCREATEURL/\/}" = "$SPECCREATEURL" ]; then
# local source in /SOURCES
SPECCREATEURL="../SOURCES/$SPECCREATEURL"
fi
AUTOSPEC_CMDLINE="-n $PACKAGE -o $PACKAGE.spec"
#DECODEDURL=`cgi_decodevar $SPECCREATEURL`
[ "$SPECCREATETYPE" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE -t $SPECCREATETYPE"
[ "$SPECCREATEVERSION" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE -v $SPECCREATEVERSION"
[ "$SPECCREATEGITBRANCH" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE --git-branch $SPECCREATEGITBRANCH"
[ "$USER_FULLNAME" -a "$USER_EMAIL" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE --packager-fullname=\"$USER_FULLNAME\" --packager-email=\"$USER_EMAIL\""
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "$AUTOSPEC_CMD -s \"$SPECCREATEURL\" $AUTOSPEC_CMDLINE \
--changelog \"package created using the webbuild interface\""
RET=$?
[ $RET -eq 0 ] && {
eval `$SUDO_WRAPPER specinfo $ENVIRONMENT "$USER" $PACKAGE ""`
social_log "SUSER=$USER SEMAIL=$USER_EMAIL STARGET=developers STEXT=\"is working on <b>$PACKAGE</b> new package in <b>`print_environment_descr $ENVIRONMENT`</b> environment\" STIME=`date +%s`"
# prepare
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bp $PACKAGE.spec --nodeps --define=\"_topdir $SPECVAR_WORKINGHOME/RPM\""
RET=$?
if [ $RET -eq 0 ]; then
REQUEST_NEXT="showbuilddocs"
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 "<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>"
RET=1
continue
else
if [ "${SPECCREATEURL/\/}" = "$SPECCREATEURL" ]; then
# local source in /SOURCES
SPECCREATEURL="../SOURCES/$SPECCREATEURL"
fi
#echo "<br><font color=gold>HINT: don't forget to add build requirements after successful build! Edit specfile and check <i>recreate SRPM</i> before sending the package.</font>"
}
AUTOSPEC_CMDLINE="-n $PACKAGE -o $PACKAGE.spec"
#DECODEDURL=`cgi_decodevar $SPECCREATEURL`
[ "$SPECCREATETYPE" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE -t $SPECCREATETYPE"
[ "$SPECCREATEVERSION" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE -v $SPECCREATEVERSION"
[ "$SPECCREATEGITBRANCH" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE --git-branch $SPECCREATEGITBRANCH"
[ "$USER_FULLNAME" -a "$USER_EMAIL" ] && AUTOSPEC_CMDLINE="$AUTOSPEC_CMDLINE --packager-fullname=\"$USER_FULLNAME\" --packager-email=\"$USER_EMAIL\""
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "$AUTOSPEC_CMD -s \"$SPECCREATEURL\" $AUTOSPEC_CMDLINE \
--changelog \"package created using the webbuild interface\""
RET=$?
[ $RET -eq 0 ] && {
eval `$SUDO_WRAPPER specinfo $ENVIRONMENT "$USER" $PACKAGE ""`
social_log "SUSER=$USER SEMAIL=$USER_EMAIL STARGET=developers STEXT=\"is working on <b>$PACKAGE</b> new package in <b>`print_environment_descr $ENVIRONMENT`</b> environment\" STIME=`date +%s`"
# prepare
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bp $PACKAGE.spec --nodeps --define=\"_topdir $SPECVAR_WORKINGHOME/RPM\""
RET=$?
if [ $RET -eq 0 ]; then
:
REQUEST_NEXT="showbuilddocs"
fi
}
fi
else
echo "ERROR: both source archive URL and name are needed."
RET=1
@ -1078,7 +1100,7 @@ if [ "$REQUEST" = "prepare" -o "$REQUEST" = "updatespec" -o "$REQUEST" = "speccr
autodistjobs="$AUTODISTJOB"
fi
[ "$REPOSITORY" ] && REPOSITORYADD="--repository $REPOSITORY" || REPOSITORYADD="--repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]}"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -p $autodistjobs $REPOSITORYADD --arch $AUTODISTARCH --user $USER $AUTODISTADD"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -p $autodistjobs $REPOSITORYADD --arch $AUTODISTARCH --user $USER $AUTODISTADD -- --colors web"
RET=$?
;;
"autodistupdate") [ "$AUTODISTFORCE" = "true" ] && AUTODISTADD="--force" || AUTODISTADD=
@ -1087,15 +1109,18 @@ if [ "$REQUEST" = "prepare" -o "$REQUEST" = "updatespec" -o "$REQUEST" = "speccr
AUTODISTADD="$AUTODISTADD --rebuild -- --changelog \"${AUTODISTUPDATECHANGELOG}\""
fi
autodistjobs=
if [ "$AUTODISTVERSION" ]; then
AUTODISTVER="\#$AUTODISTVERSION"
fi
if [ "$AUTODISTPKGS" ]; then
for p in $AUTODISTPKGS; do
autodistjobs="$autodistjobs $AUTODISTJOB/$p"
autodistjobs="$autodistjobs $AUTODISTJOB/$p${AUTODISTVER}"
done
else
autodistjobs="$AUTODISTJOB"
autodistjobs="$AUTODISTJOB${AUTODISTVER}"
fi
[ "$REPOSITORY" ] && REPOSITORYADD="--repository $REPOSITORY" || REPOSITORYADD="--repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]}"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -u $autodistjobs $REPOSITORYADD --arch $AUTODISTARCH --user $USER $AUTODISTADD"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist -v -u $autodistjobs $REPOSITORYADD --arch $AUTODISTARCH --user $USER $AUTODISTADD -- --colors web"
RET=$?
;;
"addpkgnote") echo "`date +%s` $USER $ENVIRONMENT $PKGNOTE" >> $WEBBUILD_STATEDIR/notes/$PACKAGE.notes; RET=$? ;;
@ -1140,9 +1165,19 @@ if [ "$MAINTAINERMODE" = "true" ]; then
echo -n "<editor><![CDATA["
echo -n "<div class=maintainer>"
echo -n "<b>Recent packages in $REPOSITORY:</b><br>"
cat $local_ftp/distromatic/$REPOSITORY/_recent.inc | sed "s|a href=|a target=new href=|g"
if [ "$local_ftp" -a -e $local_ftp/distromatic/$REPOSITORY ]; then
if [ $local_ftp/distromatic/$REPOSITORY/_recent.inc -nt $WEBBUILD_STATEDIR/cache/repository-recent-$REPOSITORY ]; then
cat $local_ftp/distromatic/$REPOSITORY/_recent.inc > $WEBBUILD_STATEDIR/cache/repository-recent-$REPOSITORY
cat $local_ftp/$REPOSITORY/distromatic.log > $WEBBUILD_STATEDIR/cache/repository-distromaticlog-$REPOSITORY
fi
else
curl -s $REPS_BASE_URL/distromatic/$REPOSITORY/_recent.inc > $WEBBUILD_STATEDIR/cache/repository-recent-$REPOSITORY
curl -s $REPS_BASE_URL/$REPOSITORY/distromatic.log > $WEBBUILD_STATEDIR/cache/repository-distromaticlog-$REPOSITORY
fi
cat $WEBBUILD_STATEDIR/cache/repository-recent-$REPOSITORY | sed "s|a \(href=.\)/|a target=new \1${SITE_BASE_URL}/|g"
echo -n "<br><b>Log:</b><br><pre>"
cat $local_ftp/$REPOSITORY/distromatic.log
cat $WEBBUILD_STATEDIR/cache/repository-distromaticlog-$REPOSITORY
echo -n "</pre></div>"
echo -n "<input type=button id=updatespecbutton value=\"refresh\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
@ -1207,14 +1242,15 @@ fi
# operation panel
if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "<operationpanel><![CDATA["
echo -n "<div style=\"margin-top:140px;background-color:#E0F2D0;border:1px;\">"
if [ "$PACKAGE" ]; then
echo -n "Package: <b>$PACKAGE</b><br>Version: "
[ "${SPECVAR_Epoch[0]}" ] && echo -n "${SPECVAR_Epoch[0]}:"
echo -n "<b>${SPECVAR_Version[0]}-${SPECVAR_Release[0]}</b><br>"
fi
showEnvironmentPanel
echo -n "<hr>"
[ "$PACKAGE" ] && {
echo -n "Package: <b>$PACKAGE</b><br>Version: <b>"
[ "${SPECVAR_Epoch[0]}" ] && echo -n "${SPECVAR_Epoch[0]}:" || echo -n "0:"
echo -n "${SPECVAR_Version[0]}-${SPECVAR_Release[0]}</b><br>"
}
echo -n "Target arch:<select id=rpmbuildarch>"
echo -n "</div>"
echo -n "<br><b>Build/Send options:</b><br>Arch:<select id=rpmbuildarch>"
for f in i586 arm x86_64 ppc; do
SELECTED=
if [ "$f" = "$RPMBUILDARCH" ]; then
@ -1225,8 +1261,8 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "<option value=\"$f\" $SELECTED>$f</option>"
done
echo -n "</select>"
echo -n "<label style=\"background-color:red;padding:1px;\"><input type=checkbox id=\"rpmforce\" value=\"force\">force&nbsp;</label>"
echo -n "<label style=\"padding:1px;\"><input type=checkbox id=\"debug\" value=\"debug\">debug&nbsp;</label>"
echo -n "&nbsp;<label style=\"background-color:red;padding:1px;\"><input type=checkbox id=\"rpmforce\" value=\"force\">force&nbsp;</label>"
echo -n "&nbsp;<label style=\"padding:1px;\"><input type=checkbox id=\"debug\" value=\"debug\">debug&nbsp;</label>"
# destination repository select
echo -n "<br>Send to:"
echo -n "<select id=sendrepository>"
@ -1252,7 +1288,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "<option value=\"$repname\" $SELECTED>$repname</option>"
done
echo -n "</select><br>"
[ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -o "$STATE_ADVANCEDCONTROLS" ] && echo -n "<hr><div style=\"background-color:#FFFFDE\"><b>Autodist batch builds:</b><br>"
[ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -o "$STATE_ADVANCEDCONTROLS" ] && echo -n "<br><div style=\"background-color:#FFFFDE\"><b>Autodist batch builds:</b><br>"
if [ "$PACKAGE" ]; then
if [ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" ]; then
echo -n "Patch for $PACKAGE:<br>"
@ -1316,6 +1352,9 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "<option value=\"$PACKAGEENCODED\" $SELECTED>$PACKAGE (defaults)</option>"
fi
echo -n "</select>"
if [ "$AUTODISTJOBSELECTED" -a "$AUTODISTJOB" = "$PACKAGE" ]; then
echo -n "<br><font color=red>You should use autodist for this package!</font>"
fi
if [ "$AUTODISTJOB" ]; then
echo -n "<br>Job packages:"
echo -n "<label><input type=checkbox name=autodistpkgsselectallcheckbox value=\"\" onclick=checkAllBoxes('autodistpkgscheckbox',this.checked);>select/unselect all</label>"
@ -1348,6 +1387,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "AUTODISTJOB=\"+getSelectedValueById('autodistjobs')+\"&"
echo -n "AUTODISTPKGS=\"+encodeURIComponent(p)+\"&"
echo -n "AUTODISTUPDATECHANGELOG=\"+encodeURIComponent(getElementById('autodistupdatechangelog').value)+\"&"
echo -n "AUTODISTVERSION=\"+getElementById('autodistversion').value+\"&"
echo -n "ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autodistupdate\");>"
# autodist build
echo -n "<input type=button value=\"build\" onclick="
@ -1382,16 +1422,16 @@ if [ "$MAINTAINERMODE" != "true" ]; then
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>"
# autodist update changelog
echo -n "Rebuild changelog:<br>"
echo -n "<input type=text id=autodistupdatechangelog style=\"width:95%\">"
# autodist schedule
echo -n "<br><input type=button value=\"schedule job\" onclick="
echo -n "<br>New version:<input type=text id=autodistversion value=\"\" style=\"width:20%\"> "
echo -n "<input type=button value=\"schedule job\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "AUTODISTJOB=\"+getSelectedValueById('autodistjobs')+\"&"
echo -n "REQUEST=schedule&SCHEDULEVERSION=\"+getElementById('scheduleversion').value"
echo -n "REQUEST=schedule&AUTODISTVERSION=\"+getElementById('autodistversion').value"
echo -n ",\"`cgi_encodevar "Schedule <b>"`\"+getSelectedValueById('autodistjobs')+\"`cgi_encodevar "</b> autodist job for automatic update?"`\"); class=boldbutton>"
echo -n "(version:<input type=text id=scheduleversion value=\"\" size=\"6\">)"
# autodist update changelog
echo -n "<br>Rebuild changelog:<br>"
echo -n "<input type=text id=autodistupdatechangelog style=\"width:95%\">"
# autodist show schedule
echo -n "<input type=button value=\"show schedule\" onclick=ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "REQUEST=showscheduled\");>"
@ -1424,85 +1464,26 @@ if [ "$MAINTAINERMODE" != "true" ]; then
fi
fi
if [ "$PACKAGE" ]; then
echo -n "<hr><div style=\"background-color:#E0F2D0\"><b>RPM packaging commands:</b><br>"
# 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&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue()));>"
# unpack
echo -n "<input type=button value=\"prepare\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=rpmprepare&"
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 files\" 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 requirements\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=autospecbuildreq\");>"
echo -n "<hr><div style=\"background-color:#E0F2D0\">"
## 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&"
#echo -n "RPMBUILDARCH=\"+getSelectedValueById('rpmbuildarch')+\"&"
#echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue()));>"
## recreate SRPM
#echo -n "<input type=button value=\"recreate SRPM\" onclick="
#echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=srpmbuild&"
#echo -n "RPMFORCE=\"+getElementById('rpmforce').checked+\"&"
#echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&RPMFORCE=\"+getElementById('rpmforce').checked);>"
# rpm checks
echo -n "<input type=button id=rpmchecks value=\"checks\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=rpmchecks\");>"
echo -n "<input type=button id=rpmsimulateinstallbutton value=\"simulate install\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=rpmsimulateinstall\");>"
# 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 "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>"
# add patches
echo -n "<hr><b>Add patches:</b>"
echo -n "<b>Add patches:</b>"
echo -n "<input type=button id=addpatchbutton value=\"submit\" onclick=ajax_getvalues(\""
echo -n "REQUEST=addpatch&ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&"
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&"
echo -n "ADDPATCHURL=\"+encodeURIComponent(getElementById('addpatchurl').value)+\"&"
echo -n "ADDPATCHNAME=\"+encodeURIComponent(getElementById('addpatchname').value));>"
echo -n "&nbsp;<a href=\"http://pastebin.com\" target=_new>pastebin</a><br>"
echo -n "URL:<input type=text id=addpatchurl value=\"\" style=\"size:100%\">"
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 "<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>"
@ -1515,11 +1496,12 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "SPECTEXT=\"+encodeURIComponent(editor.getValue())+\"&"
echo -n "UPLOADFILENAME=\"+encodeURIComponent(getElementById('fileToUpload').value));>Upload</button>"
echo -n "</form>"
echo -n "</div><hr>"
echo -n "</div>"
# info from package sources
echo -n "<hr><div style=\"background-color:#A7DEDE\">"
echo -n "<b>Info from package in the works:</b><br>"
# show sources
echo -n "<select id=sourcefile onchange="
echo -n "<select id=sourcefile style=\"width:98%\" onchange="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=showsourcefile&"
echo -n "SOURCEFILE=\"+getSelectedValueById('sourcefile'));>"
echo -n "<br><option value=\"\">-- select a source to display --</option>"
@ -1529,7 +1511,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then
done
echo -n "</select>"
# show patches
echo -n "<select id=patchfile onchange="
echo -n "<select id=patchfile style=\"width:98%\" onchange="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=showpatchfile&"
echo -n "PATCHFILE=\"+getSelectedValueById('patchfile'));>"
echo -n "<option value=\"\">-- select a patch to display --</option>"
@ -1562,6 +1544,15 @@ if [ "$MAINTAINERMODE" != "true" ]; then
# show package changelog
echo -n "<input type=button value=\"changelog(s)\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=showchangelogs\");>"
# 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 "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>"
# generic info
echo -n "<hr><b>Generic info:</b><br>"
@ -1572,7 +1563,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "<input type=button value=\"approved licenses\" onclick="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=approvedlicenses\");>"
# templates
echo -n "<select id=autospectemplate onchange="
echo -n "<select id=autospectemplate style=\"width:98%\" onchange="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=showautospectemplate&"
echo -n "AUTOSPECTEMPLATE=\"+getSelectedValueById('autospectemplate'));>"
echo -n "<option value=\"\">-- display a .spec template --</option>"
@ -1582,7 +1573,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then
done
echo -n "</select>"
# macros
echo -n "<select id=macrosfile onchange="
echo -n "<select id=macrosfile style=\"width:98%\" onchange="
echo -n "ajax_getvalues(\"ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGEENCODED&REQUEST=showmacrosfile&"
echo -n "MACROSFILE=\"+getSelectedValueById('macrosfile'));>"
echo -n "<option value=\"\">-- display a RPM macros file --</option>"
@ -1592,7 +1583,28 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "<option value=\"$macrosfile\">$macrosfile</option>"
done
echo -n "</select></div>"
echo -n "</div>"
fi
echo -n "<hr><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 "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>"
# system upgrade
echo -n "<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>"
echo -n "]]></operationpanel>"
fi
@ -1635,7 +1647,7 @@ case $REQUEST in
"smartupgrade") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "export LANG=C;sudo smart update && sudo smart upgrade"
RET=$?
;;
"runldconfig") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "/sbin/ldconfig"
"runldconfig") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "export LANG=C;sudo /sbin/ldconfig"
RET=$?
;;
"showpatch") $SUDO_WRAPPER binary $ENVIRONMENT "$USER" $PACKAGE "autodist-tool makepatch $PACKAGE"; RET=$? ;;
@ -1660,11 +1672,11 @@ case $REQUEST in
social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"made an autodist <b>build</b> patch for <b>$PACKAGE</b>\" STIME=`date +%s`"
fi ;;
"showscheduled") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist-tool schedule"; RET=$? ;;
"schedule") if [ "$SCHEDULEVERSION" ]; then
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist-tool schedule $AUTODISTJOB#$SCHEDULEVERSION"
"schedule") if [ "$AUTODISTVERSION" ]; then
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist-tool schedule $AUTODISTJOB#$AUTODISTVERSION"
RET=$?
if [ $RET -eq 0 ]; then
social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"scheduled autodist job <b>$AUTODISTJOB</b> for update to version $SCHEDULEVERSION\" STIME=`date +%s`"
social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"scheduled autodist job <b>$AUTODISTJOB</b> for update to version $AUTODISTVERSION\" STIME=`date +%s`"
fi
else
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "autodist-tool schedule $AUTODISTJOB"
@ -1688,7 +1700,7 @@ case $REQUEST in
else
autodistjobs="$AUTODISTJOB"
fi
$SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autodist -v -b $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH --user $USER $AUTODISTADD" &>/dev/null
$SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autodist -v -b $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH --user $USER $AUTODISTADD -- --colors web" &>/dev/null
[ $? -ne 0 ] && RET=$? || {
RET=-1
echo "Autodist build start. You may see the output in the <b>Webbuild jobs</b> box above."
@ -1704,7 +1716,7 @@ case $REQUEST in
else
autodistjobs="$AUTODISTJOB"
fi
$SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autodist -v -i $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH --user $USER $AUTODISTADD" &>/dev/null
$SUDO_WRAPPER background $ENVIRONMENT "$USER" "$PACKAGE" "autodist -v -i $autodistjobs --repository ${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]} --arch $AUTODISTARCH --user $USER $AUTODISTADD -- --colors web" &>/dev/null
[ $? -ne 0 ] && RET=$? || {
RET=-1
echo "Autodist install start. You may see the output in the <b>Webbuild jobs</b> box above."
@ -1719,7 +1731,7 @@ case $REQUEST in
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"
$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`"
;;
@ -1739,7 +1751,11 @@ case $REQUEST in
fi
;;
"autospecupdatescheck") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a2"; RET=$? ;;
"rpmprepare") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bp $PACKAGE.spec --nodeps --define=\"_topdir $SPECVAR_WORKINGHOME/RPM\""; RET=$? ;;
"rpmprepare") [ "$RPMBUILDARCH" -a "$RPMBUILDARCH" != "${AUTOPORT_ARCH[$ENVIRONMENT]}" ] && \
RPMARCHADD="--target $RPMBUILDARCH --define=\"cross_target_cpu $RPMBUILDARCH\""
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bp $PACKAGE.spec $RPMARCHADD --nodeps --define=\"_topdir $SPECVAR_WORKINGHOME/RPM\""
RET=$?
;;
"rpmbuild") [ "$RPMFORCE" = "true" ] && RPMFORCEADD="--force-build"
[ "$RPMBUILDARCH" -a "$RPMBUILDARCH" != "${AUTOPORT_ARCH[$ENVIRONMENT]}" ] && \
RPMARCHADD="-A $RPMBUILDARCH --define \"cross_target_cpu=$RPMBUILDARCH\""
@ -1762,7 +1778,9 @@ $RPMFORCEADD $PACKAGE.spec"
RPMARCHADD="-A $RPMBUILDARCH --define \"cross_target_cpu=$RPMBUILDARCH\""
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a5 --list-check --force $RPMARCHADD"
RET=$? ;;
"autospecbuildreq") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a6"
"autospecbuildreq")
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "sudo /sbin/ldconfig"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a6"
RET=$? ;;
"rpmchecks") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a8"; RET=$? ;;
"rpmsimulateinstall") $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a7"; RET=$? ;;
@ -1777,10 +1795,10 @@ $RPMFORCEADD $PACKAGE.spec"
if [ "$SENDRECREATESRPM" = "true" ]; then
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "rpmbuild -bs \
--define=\"_topdir $SPECVAR_WORKINGHOME/RPM\" \
$PACKAGE.spec $RPMFORCEADD && $AUTOSPEC_CMD -u $PACKAGE -a10 --server $SENDREPOSITORY"
$PACKAGE.spec $RPMFORCEADD && $AUTOSPEC_CMD -u $PACKAGE -a10 --server $SENDREPOSITORY --arch $AUTODISTARCH"
RET=$?
else
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a10 --server $SENDREPOSITORY"
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "$AUTOSPEC_CMD -u $PACKAGE -a10 --server $SENDREPOSITORY --arch $AUTODISTARCH"
RET=$?
fi
if [ $RET -eq 0 ]; then
@ -2068,18 +2086,10 @@ $PACKAGE.spec $RPMFORCEADD && $AUTOSPEC_CMD -u $PACKAGE -a10 --server $SENDREPOS
if [ "$installpackages" ]; then
if [ "$REQUEST" = "rpmmanagerinstall" ]; then
echo "Installing packages: $RPMMANAGERPACKAGES<br>"
if [ "$rpmmanagermode" = "environment" ]; then
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "sudo rpm -i $installpackages $rpmforceadd"
else
sudo rpm -i $installpackages $rpmforceadd
fi
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "sudo rpm -i $installpackages $rpmforceadd 2>&1"
elif [ "$REQUEST" = "rpmmanagerupgrade" ]; then
echo "Upgrading packages: $RPMMANAGERPACKAGES<br>"
if [ "$rpmmanagermode" = "environment" ]; then
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "sudo rpm -U $installpackages $rpmforceadd"
else
sudo rpm -U $installpackages $rpmforceadd
fi
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "sudo rpm -U $installpackages $rpmforceadd 2>&1"
fi
RET=$?
else
@ -2132,8 +2142,13 @@ if [ "$MAINTAINERMODE" = "true" ]; then
# echo "<option value=\"\">-- Select a SRPM package --</option>"
echo -n "<label><input type=checkbox name=pkgsselectallcheckbox value=\"\" onclick=checkAllBoxes('packagescheckbox',this.checked);>select/unselect all</label>"
echo -n "<div class=multiselect>"
if [ $local_ftp/$REPOSITORY/SRPMS.base -nt $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY ]; then
ls --color=none $local_ftp/$REPOSITORY/SRPMS.base/ | grep ".src.rpm$" | sort -f > $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY
if [ "$local_ftp" -a -e $local_ftp/$REPOSITORY ]; then
if [ $local_ftp/$REPOSITORY/SRPMS.base -nt $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY ]; then
ls --color=none $local_ftp/$REPOSITORY/SRPMS.base/ | grep ".src.rpm$" | sort -f > $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY
fi
else
curl -s $REPS_BASE_URL/$REPOSITORY/SRPMS.base/ | grep .src.rpm | \
sed "s|.*\.src\.rpm\">\(.*\)</a>.*|\1|" | sort -f > $WEBBUILD_STATEDIR/cache/repository-src-$REPOSITORY
fi
while read f; do
pkgname=${f/.src.rpm}
@ -2163,6 +2178,8 @@ if [ "$MAINTAINERMODE" = "true" ]; then
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

View File

@ -168,7 +168,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 +179,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
@ -246,7 +260,7 @@ function parse_build_output() {
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|\(.*\)\(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|^[[:cntrl:]]*\([!%?=][!%!=>] .*\)|<font style=\"color:gold\">\1</font>|;
s|[[:cntrl:]]||g;" | google_search $1

View File

@ -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 2097152 ]; 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"
}
@ -178,20 +163,69 @@ 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 "<input type=button id=updatespecbutton value=\"update\" onclick="
@ -241,7 +275,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 +283,7 @@ echo $f >> /tmp/down
cat $f 2>/dev/null
fi
done
RET=$?
return $RET
}