enter()
{
- $2 cd "$1"
+ $2 cd "$1" || exit 1
check_mergeconflict "$1"
}
verbose git config remote.origin.url "$url"
verbose git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
+ verbose git config remote.origin.autocrlf input
+
r=`git symbolic-ref HEAD`
r=${r#refs/heads/}
if git config branch.$r.remote >/dev/null 2>&1; then
git push origin :"${ref#refs/remotes/origin/}"
reportecho4 "--> branch deleted"
fi
- elif [ -n "$note" ]; then
+ elif [ -z "$branch" ] && [ -n "$note" ]; then
reportdo4 echo "$note"
reportecho4 "--> not merging, already had this one rejected before"
elif yesno "Branch \"$ref\" may want to get merged. Do it?" '{ echo "$logdata"; echo "$diffdata"; } | less -r'; then
git checkout "$realbase"
org=`git rev-parse HEAD`
- if ! git merge "$ref" 2>&1 | tee "$t" && ! { git ls-files -u | grep ' 1 ' >/dev/null; }; then
+ if ! git merge --no-ff "$ref" 2>&1 | tee "$t" && ! { git ls-files -u | grep ' 1 ' >/dev/null; }; then
git reset --hard "$org"
GIT_NOTES_REF=refs/notes/admin-merge git notes edit -m "Merge failed:$LF`cat "$t"`" "$ref"
reportdo4 cat "$t"
--- /dev/null
+#!/bin/sh
+
+case "$0" in
+ /*)
+ me=$0
+ ;;
+ *)
+ me="$PWD/$0"
+ ;;
+esac
+export me
+
+case "$1" in
+ inner)
+ git config core.autocrlf input
+ git reset --hard
+ git for-each-ref 'refs/remotes/origin' | while read -r HASH TYPE REFNAME; do
+ case "$REFNAME" in
+ refs/remotes/origin/HEAD)
+ continue
+ ;;
+ esac
+ git checkout -t "${REFNAME#refs/remotes/}" || git checkout "${REFNAME#refs/remotes/origin/}"
+ git reset --hard "$REFNAME"
+ echo "$attr" > ".gitattributes"
+ find . -type f -exec touch {} \+
+ git update-index --refresh
+ git add .gitattributes
+ git commit -a -m"CRLF fixes, .gitattributes file updated"
+ done
+ git checkout master
+ true
+ ;;
+ *)
+ attr=`cat .gitattributes`
+ export attr
+ ./all each "$me" inner
+ ./all checkout
+ ;;
+esac
our $VISFLAGS = '';
# Default flags for the -light stage
- our $LIGHTFLAGS = '-deluxe -patchshadows -samples 3 -lightmapsize 512';
+ our $LIGHTFLAGS = '-deluxe -patchshadows -samples 3 -lightmapsize 512 -fast -fastbounce -dirty';
# Default flags for the -minimap stage
our $MINIMAPFLAGS = '';
scale => [], # can't have defaults atm
order => [split /\s*,\s*/, $ORDER],
maps => [],
- scale => 1
+ scale => 1,
+ bsp_timeout => 0,
+ vis_timeout => 0,
+ light_timeout => 0,
+ minimap_timeout => 0,
+ scale_timeout => 0
};
my $curmode = 'maps';
{
$options->{noshaderlist} = 1;
}
+ elsif($_ eq '-bsp_timeout')
+ {
+ $options->{bsp_timeout} = shift @ARGV;
+ }
+ elsif($_ eq '-vis_timeout')
+ {
+ $options->{vis_timeout} = shift @ARGV;
+ }
+ elsif($_ eq '-light_timeout')
+ {
+ $options->{light_timeout} = shift @ARGV;
+ }
+ elsif($_ eq '-minimap_timeout')
+ {
+ $options->{minimap_timeout} = shift @ARGV;
+ }
+ elsif($_ eq '-scale_timeout')
+ {
+ $options->{minimap_timeout} = shift @ARGV;
+ }
elsif($_ eq '-order')
{
$options->{order} = [split /\s*,\s*/, shift @ARGV];
}
+ elsif($_ =~ /^--no(-.*)/)
+ {
+ if($curmode eq 'maps')
+ {
+ $curmode = 'bsp';
+ }
+ my $flag = $1;
+ @{$options->{$curmode}} = grep { (($_ eq $flag) ... /^-/) !~ /^[0-9]+$/ } @{$options->{$curmode}};
+ # so, e.g. --no-samplesize removes "-samplesize" and a following "3"
+ }
elsif($_ =~ /^-(-.*)/)
{
if($curmode eq 'maps')
sub q3map2(@)
{
+ my $mode = $_[0];
+ my $timeout = undef;
+ $timeout = $options->{bsp_timeout} if $mode eq '-bsp';
+ $timeout = $options->{vis_timeout} if $mode eq '-vis';
+ $timeout = $options->{light_timeout} if $mode eq '-light';
+ $timeout = $options->{minimap_timeout} if $mode eq '-minimap';
+ $timeout = $options->{scale_timeout} if $mode eq '-scale';
+ die "Invalid call: not a standard q3map2 stage" if not defined $timeout;
my @args = ($Q3MAP2, split(/\s+/, $Q3MAP2FLAGS), '-game', 'xonotic', '-fs_basepath', $XONOTICDIR, '-fs_basepath', $linkdir, '-v', @_);
print "\$ @args\n";
- return !system @args;
+ defined(my $pid = fork())
+ or die "fork: $!";
+ if($pid) # parent
+ {
+ local $SIG{ALRM} = sub { warn "SIGALRM caught\n"; kill TERM => $pid; };
+ alarm $timeout
+ if $timeout;
+ if(waitpid($pid, 0) != $pid)
+ {
+ die "waitpid: did not return our child process $pid: $!";
+ }
+ alarm 0;
+ return ($? == 0);
+ }
+ else # child
+ {
+ exec @args
+ or die "exec: $!";
+ }
}
(my $mapdir = getcwd()) =~ s!/[^/]*(?:$)!!;
bspdir="$PWD/data"
url=http://141.2.16.23/~xonotic/bsp-autobuilds/
+override="-bsp_timeout 900 -vis_timeout 3600 -light_timeout 14400 -minimap_timeout 900 -scale_timeout 900"
bspoutdir="$HOME/public_html/bsp-autobuilds/"
url=$2
branch=$3
hash=$4
+ status=$5
+ time=$6
+
+ hash=`echo "$hash" | cut -c 1-7`
branch=${branch##refs/heads/}
branch=${branch##refs/remotes/}
branch=${branch##origin/}
- s_time=
s_samplesize=
s_failshaders=
s_leaked=
s_error=
+ if [ "$status" -ne 0 ]; then
+ s_error="exited with status $status"
+ fi
while IFS= read -r L; do
case "$L" in
- *\ seconds\ elapsed)
- s_time=$(($s_time + ${L%% seconds elapsed}))
- ;;
WARNING:\ surface\ at\ *\ too\ large\ for\ desired\ samplesize*)
s=${L##* }
if [ -z "$s_samplesize" ] || [ "$s" -gt "$s_samplesize" ]; then
if [ -n "$s_error" ]; then
echo -n "[$branch $hash] \ 34failed"
else
- echo -n "[$branch] finished"
+ echo -n "[$branch $hash] finished"
fi
- echo -n " map compile of $map ($url): $s_time sec"
+ echo -n " map compile of $map ($url): $time sec"
if [ -n "$s_samplesize" ]; then
echo -n ", FIX samplesize >= $s_samplesize"
fi
if [ -n "$IRCSPAM" ]; then
pre2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$HASH" | $IRCSPAM
fi
+ t0=`date +%s`
(
cd maps
- ../../../misc/tools/xonotic-map-compiler "$M" `grep ^- "$M.map.options" | cut -d '#' -f 1` 2>&1 | tee "$M.log"
+ ../../../misc/tools/xonotic-map-compiler "$M" `grep ^- "$M.map.options" | cut -d '#' -f 1` $override > "$M.log"
)
- zip -9r "$bspdir/$M-$blobhash.pk3" "maps/$M.bsp" "maps/$M.log" "maps/$M/" "maps/$M.lin" "gfx/${M}_mini.tga"
+ t1=`date +%s`
+ dt=$(($t1 - $t0))
+ status=$?
+ if [ -n "$IRCSPAM" ]; then
+ cat "maps/$M.log" | log2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$HASH" "$status" "$dt" > "maps/$M.irc"
+ fi
+ zip -9r "$bspdir/$M-$blobhash.pk3" "maps/$M.bsp" "maps/$M.log" "maps/$M.irc" "maps/$M/" "maps/$M.lin" "gfx/${M}_mini.tga"
ln -snf "../$M-$blobhash.pk3" "$bspdir/latest/$M.pk3" # from ALL branches, so beware!
if [ -n "$IRCSPAM" ]; then
- cat "maps/$M.log" | log2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$HASH" | $IRCSPAM
+ $IRCSPAM < "maps/$M.irc"
fi
}
if ! wget -O "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
rm -f "$bspdir/$M-$blobhash.pk3"
echo "WARNING: could not download $url$M-$blobhash.pk3, maybe not ready yet"
- return 1
+ return 0
fi
if ! unzip -l "$bspdir/$M-$blobhash.pk3"; then
rm -f "$bspdir/$M-$blobhash.pk3"
echo "WARNING: could not download $url$M-$blobhash.pk3, invalid zip file"
- return 1
+ return 0
fi
}
wget -r -l1 -A "*.pk3" -N --no-parent --no-directories "$url""latest"
;;
log2spam-test)
- log2spam "mapname" "http://mapurl" "branch" "commit"
+ log2spam "mapname" "http://mapurl" "branch" "commit" "0"
;;
esac