Added autodist-repository tool, further fixes to support a central sociallog and more fixes
This commit is contained in:
parent
2979f8d61b
commit
6fc6b0bda6
1
Makefile
1
Makefile
@ -71,6 +71,7 @@ install-programs:
|
||||
@$(INSTALL_SCRIPT) autoport $(DESTDIR)$(bindir)/autoport
|
||||
@$(INSTALL_SCRIPT) automaint $(DESTDIR)$(sbindir)/automaint
|
||||
@$(INSTALL_SCRIPT) autoport-chroot $(DESTDIR)$(sbindir)/autoport-chroot
|
||||
@$(INSTALL_SCRIPT) autodist-repository $(DESTDIR)$(sbindir)/autodist-repository
|
||||
@$(INSTALL_SCRIPT) autodist-upstream-updates $(DESTDIR)$(sbindir)/autodist-upstream-updates
|
||||
@$(INSTALL_SCRIPT) autoport-fix-environment $(DESTDIR)$(bindir)/autoport-fix-environment
|
||||
@$(INSTALL_SCRIPT) etc/autodist/scripts/* $(DESTDIR)$(configdir)/scripts/
|
||||
|
1011
autodist-repository
Executable file
1011
autodist-repository
Executable file
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
# automaint -- batch automatic maintainance tool of the autodist suite
|
||||
# Copyright (C) 2013 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
# Copyright (C) 2013-2014 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
#
|
||||
# Released under the terms of the GNU GPL release 3 license
|
||||
#
|
||||
@ -212,7 +212,7 @@ for p in ${pkglist[0]}; do
|
||||
if [ "$needsport" ]; then
|
||||
echo "$p: importing from $SOURCE_REPOSITORY to $PORT_REPOSITORY ($spkg_version-$spkg_release -> $pkg_version-$pkg_release)"
|
||||
if [ ! "$TESTMODE" ]; then
|
||||
openmamba-repository import $SOURCE_REPOSITORY $p -d $PORT_REPOSITORY -y >/dev/null
|
||||
autodist-repository import $SOURCE_REPOSITORY $p -d $PORT_REPOSITORY -y >/dev/null
|
||||
if [ $? -eq 0 -a "$WEBBUILD_URL" -a "$WEBBUILD_USER" ]; then
|
||||
curl -s "$WEBBUILD_URL?REQUEST=message&USER=$WEBBUILD_USER&SECRET=${WEBBUILD_SECRET}&USER_EMAIL=$WEBBUILD_EMAIL&\
|
||||
MESSAGE=`cgi_encodevar \"imported <b>$p</b> from <b>$SOURCE_REPOSITORY</b> to <b>$PORT_REPOSITORY</b> for porting\"`" >/dev/null
|
||||
@ -221,7 +221,7 @@ MESSAGE=`cgi_encodevar \"imported <b>$p</b> from <b>$SOURCE_REPOSITORY</b> to <b
|
||||
else
|
||||
echo "$p: importing from $SOURCE_REPOSITORY to $DEST_REPOSITORY ($spkg_version-$spkg_release -> $pkg_version-$pkg_release; update type: $update_type)"
|
||||
if [ ! "$TESTMODE" ]; then
|
||||
openmamba-repository import $SOURCE_REPOSITORY $p -d $DEST_REPOSITORY -y >/dev/null
|
||||
autodist-repository import $SOURCE_REPOSITORY $p -d $DEST_REPOSITORY -y >/dev/null
|
||||
if [ $? -eq 0 -a "$WEBBUILD_URL" -a "$WEBBUILD_USER" ]; then
|
||||
curl -s "$WEBBUILD_URL?REQUEST=message&USER=$WEBBUILD_USER&SECRET=${WEBBUILD_SECRET}&USER_EMAIL=$WEBBUILD_EMAIL&\
|
||||
MESSAGE=`cgi_encodevar \"imported <b>$p</b> from <b>$SOURCE_REPOSITORY</b> to <b>$DEST_REPOSITORY</b>\"`" >/dev/null
|
||||
|
@ -47,7 +47,6 @@ var socialbox_reloadtime = 15000;
|
||||
|
||||
function ajax_getvalues_refresh(request,user,user_email,secret) {
|
||||
var fromid = 0;
|
||||
//alert("refresh");
|
||||
if (socialbox_interval != null) {
|
||||
clearInterval(socialbox_interval);
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ cgi_getvars BOTH ALL
|
||||
[ "$PACKAGE" ] && PACKAGEENCODED=`cgi_encodevar "$PACKAGE"` || PACKAGEENCODED=
|
||||
|
||||
#cgi_getvars POST
|
||||
if [ "$REQUEST" != "refresh" ]; then
|
||||
if [ "${REQUEST:0:7}" != "refresh" ]; then
|
||||
echo "`date` - USER=$USER&REQUEST=$REQUEST&ENVIRONMENT=$ENVIRONMENT&REPOSITORY=$REPOSITORY&PACKAGE=$PACKAGE&MAINTAINERMODE=$MAINTAINERMODE" >> $LOG
|
||||
fi
|
||||
|
||||
@ -65,7 +65,7 @@ if [ "$USER" ]; then
|
||||
else
|
||||
USER_ENABLED=
|
||||
fi
|
||||
elif [ "$REQUEST" != "refresh" ]; then
|
||||
elif [ "${REQUEST:0:7}" != "refresh" ]; then
|
||||
# no "$USER_SECRET" set; require password
|
||||
echo -n "<output><![CDATA[Please enter your password: <input type=password id=password "
|
||||
echo -n "onkeypress=if(checkEnter(event))"
|
||||
@ -88,7 +88,7 @@ if [ "$USER" ]; then
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
elif [ "$REQUEST" != "refresh" ]; then
|
||||
elif [ "${REQUEST:0:7}" != "refresh" ]; then
|
||||
echo -n "<output><![CDATA[Please enter your username: <input type=text id=username "
|
||||
echo -n "onkeypress=if(checkEnter(event)){"
|
||||
echo -n "user=encodeURIComponent(getElementById('username').value);"
|
||||
@ -110,7 +110,7 @@ elif [ "$REQUEST" != "refresh" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ "$USER_ENABLED" != "1" -a "$REQUEST" != "refresh" ]; then
|
||||
if [ "$USER_ENABLED" != "1" -a "${REQUEST:0:7}" != "refresh" ]; then
|
||||
echo -n "<environments> </environments>"
|
||||
echo -n "<speccreate> </speccreate>"
|
||||
echo -n "<specedit> </specedit>"
|
||||
@ -210,11 +210,15 @@ fi
|
||||
#
|
||||
# Public requests
|
||||
#
|
||||
if [ "$REQUEST" = "refresh" -o ! "$USER" ]; then
|
||||
if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshsocial" -o ! "$USER" ]; then
|
||||
if [ "$WEBBUILD_URL" -a "$USER" ]; then
|
||||
curl -s "$WEBBUILD_URL?REQUEST=refreshsocial&USER=$USER&SECRET=`cgi_encodevar \"$USER_SECRET\"`&USER_EMAIL=$USER_EMAIL&FROMID=$FROMID"
|
||||
else
|
||||
[ -e "$WEBBUILD_STATEDIR/social_log" ] || exit
|
||||
# social box
|
||||
echo -n "<socialbox>"
|
||||
count=0
|
||||
SID=0
|
||||
if [ ! "$FROMID" -o "$FROMID" = "0" -o "$FROMID" = "NaN" ]; then
|
||||
if [ "$USER" ]; then
|
||||
line=`tail -n 500 $WEBBUILD_STATEDIR/social_log | grep -v " SUSER=$USER " 2>/dev/null | tail -n 25 | head -n 1`
|
||||
@ -252,6 +256,7 @@ if [ "$REQUEST" = "refresh" -o ! "$USER" ]; then
|
||||
count=$(($count + 1))
|
||||
done
|
||||
echo -n "</socialbox>"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$USER_ENABLED" != "1" ]; then
|
||||
@ -463,7 +468,7 @@ if [ "$REQUEST" = "repsearch" ]; then
|
||||
# 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"
|
||||
# $SUDO_WRAPPER 0 local "$USER" "" "openmamba-repository search -i ${REPSEARCHTEXT/-/\-}" | \
|
||||
# $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>|;
|
||||
# s|\(.*(${AUTOPORT_ARCH[$ENVIRONMENT]}).*\)|<font color=lightgreen>\1</font>|"
|
||||
@ -1873,7 +1878,7 @@ case $REQUEST in
|
||||
for p in $PACKAGES; do
|
||||
[ "$REPOSITORYSIMULATE" = "true" -o ! "$USER_CANMAINTAIN" ] && SIMULATEADD="-s" || SIMULATEADD=
|
||||
[ "$REPOSITORYFORCE" = "true" ] && FORCEADD="-f"
|
||||
$SUDO_WRAPPER 0 local "$USER" "$PACKAGE" "openmamba-repository import $SENDREPOSITORY $p -d $REPOSITORYIMPORTTO $SIMULATEADD $FORCEADD -y"
|
||||
$SUDO_WRAPPER 0 local "$USER" "$PACKAGE" "autodist-repository import $SENDREPOSITORY $p -d $REPOSITORYIMPORTTO $SIMULATEADD $FORCEADD -y"
|
||||
RET=$?
|
||||
if [ ! "$SIMULATEADD" -a $RET -eq 0 ]; then
|
||||
social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"imported <b>$p</b> from <b>$SENDREPOSITORY</b> to <b>$REPOSITORYIMPORTTO</b>\" STIME=`date +%s`"
|
||||
@ -1890,7 +1895,7 @@ case $REQUEST in
|
||||
for p in $PACKAGES; do
|
||||
[ "$REPOSITORYSIMULATE" = "true" -o ! "$USER_CANMAINTAIN" ] && SIMULATEADD="-s" || SIMULATEADD=
|
||||
[ "$REPOSITORYFORCE" = "true" ] && SIMULATEADD="$SIMULATEADD -f"
|
||||
$SUDO_WRAPPER 0 local "$USER" "$PACKAGE" "openmamba-repository release $SENDREPOSITORY $p -d $REPOSITORYIMPORTTO $SIMULATEADD -y"
|
||||
$SUDO_WRAPPER 0 local "$USER" "$PACKAGE" "autodist-repository release $SENDREPOSITORY $p -d $REPOSITORYIMPORTTO $SIMULATEADD -y"
|
||||
RET=$?
|
||||
if [ ! "$SIMULATEADD" -a $RET -eq 0 ]; then
|
||||
social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"released <b>$p</b> from <b>$SENDREPOSITORY</b> to <b>$REPOSITORYIMPORTTO</b>\" STIME=`date +%s`"
|
||||
@ -1905,7 +1910,7 @@ case $REQUEST in
|
||||
break
|
||||
}
|
||||
for p in $PACKAGES; do
|
||||
$SUDO_WRAPPER 0 local "$USER" "" "openmamba-repository diff $SENDREPOSITORY $p -d $REPOSITORYIMPORTTO"
|
||||
$SUDO_WRAPPER 0 local "$USER" "" "autodist-repository diff $SENDREPOSITORY $p -d $REPOSITORYIMPORTTO"
|
||||
RET=$?
|
||||
[ $RET -eq 0 ] || break
|
||||
done
|
||||
@ -1918,7 +1923,7 @@ case $REQUEST in
|
||||
}
|
||||
for p in $PACKAGES; do
|
||||
[ "$REPOSITORYSIMULATE" = "true" -o ! "$USER_CANMAINTAIN" ] && SIMULATEADD="-s" || SIMULATEADD=
|
||||
$SUDO_WRAPPER 0 local "$USER" "$PACKAGE" "openmamba-repository archive $SENDREPOSITORY $p -y"
|
||||
$SUDO_WRAPPER 0 local "$USER" "$PACKAGE" "autodist-repository archive $SENDREPOSITORY $p -y"
|
||||
RET=$?
|
||||
if [ ! "$SIMULATEADD" -a $RET -eq 0 ]; then
|
||||
social_log "SUSER=$USER SEMAIL=$USER_EMAIL STEXT=\"archived <b>$p</b> from <b>$SENDREPOSITORY</b>\" STIME=`date +%s`"
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# webbuild functions
|
||||
# Copyright (c) 2012 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
# Copyright (c) 2012-2014 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
#
|
||||
. /etc/autodist/config
|
||||
|
||||
@ -36,6 +36,13 @@ function social_log() {
|
||||
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
|
||||
|
||||
if [ "$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
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
@ -205,7 +212,7 @@ function parse_search_output() {
|
||||
echo -n "<a class=searchlink href=\"/distribution/distromatic.html?tag=$REPOSITORY&pkg=$PKG.$ARCH\" target=_new>$2</a><br>"
|
||||
echo -n "</font>"
|
||||
# if [ "$ARCH" ]
|
||||
# $SUDO_WRAPPER 0 local "$USER" "" "openmamba-repository search -i $REPSEARCHTEXT" | \
|
||||
# $SUDO_WRAPPER 0 local "$USER" "" "autodist-repository search -i $REPSEARCHTEXT" | \
|
||||
# sed "s|\(.*(source).*\)|<font color=white><b>\1</b></font>|;
|
||||
# s|\(.*(${AUTOPORT_ARCH[$ENVIRONMENT]}).*\)|<font color=lightgreen>\1</font>|"
|
||||
done
|
||||
|
@ -1,8 +1,13 @@
|
||||
#
|
||||
# webbuild functions-private include file
|
||||
# Copyright (c) 2012-2014 by Silvan Calarco <silvan.calarco@mambasoft.it>
|
||||
#
|
||||
|
||||
repository_list() {
|
||||
if [ "$WEBBUILD_REPOSITORIES" ]; then
|
||||
echo "${WEBBUILD_REPOSITORIES[*]}"
|
||||
else
|
||||
$SUDO_WRAPPER 0 local "$USER" "" "/usr/sbin/openmamba-repository list"
|
||||
$SUDO_WRAPPER 0 local "$USER" "" "/usr/sbin/autodist-repository list"
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user