[Libreoffice-commits] dev-tools.git: 2 commits - ciabot/run-libreoffice-ciabot.pl esc-reporting/esc-collect.py
Guilhem Moulin (via logerrit)
logerrit at kemper.freedesktop.org
Sat Feb 29 03:07:51 UTC 2020
ciabot/run-libreoffice-ciabot.pl | 24 ++++++++++++++----------
esc-reporting/esc-collect.py | 4 ++--
2 files changed, 16 insertions(+), 12 deletions(-)
New commits:
commit ad46e751df6c18f157cdbfadf506ad801abeee65
Author: Guilhem Moulin <guilhem at libreoffice.org>
AuthorDate: Sat Feb 22 00:13:24 2020 +0100
Commit: Guilhem Moulin <guilhem at libreoffice.org>
CommitDate: Sat Feb 29 02:29:14 2020 +0100
esc-collect: Try harder to silence `git pull --all --rebase`
For some reason --quiet doesn't affect the checkout phase: progress info
“Checking out files: X% (N/M)” leaks to the error output, which is
treated like if it were a TTY.
This is a regression from 1520268a8c5511ad9c21980f1de5d3d8711fb1fe.
diff --git a/esc-reporting/esc-collect.py b/esc-reporting/esc-collect.py
index d89f1f4..306d2a6 100755
--- a/esc-reporting/esc-collect.py
+++ b/esc-reporting/esc-collect.py
@@ -38,7 +38,7 @@ import datetime
import json
import xmltodict
import requests
-from subprocess import check_call, Popen, PIPE, CalledProcessError
+from subprocess import check_call, Popen, DEVNULL, PIPE, CalledProcessError
from requests.auth import HTTPDigestAuth
@@ -668,7 +668,7 @@ def get_git(cfg):
'"committer": "%cn", "committer-email": "%ce" }'
basedir = cfg['homedir'] + '../libreoffice/'
if repo['git'] and cfg['platform'] == 'linux':
- check_call(["git", "-C", basedir + repo['dir'], "pull", "--quiet", "--rebase", "--all"])
+ check_call(["git", "-C", basedir + repo['dir'], "pull", "--quiet", "--all", "--rebase"], stderr=DEVNULL)
p = Popen([ "git", "-C", basedir + repo['dir'], "log", "--pretty=format:" + useFormat ], stdout=PIPE)
for x in io.TextIOWrapper(p.stdout, encoding="utf-8"):
# Json fails if there's a backslash somewhere in the git log
commit 106130a15006126a2b8b8a05955600568131840c
Author: Guilhem Moulin <guilhem at libreoffice.org>
AuthorDate: Sat Feb 22 05:18:07 2020 +0100
Commit: Guilhem Moulin <guilhem at libreoffice.org>
CommitDate: Sat Feb 22 21:53:39 2020 +0100
ciabot: daemon: use strict; and switch taint mode on
diff --git a/ciabot/run-libreoffice-ciabot.pl b/ciabot/run-libreoffice-ciabot.pl
index 4fd1d7a..3c34e37 100755
--- a/ciabot/run-libreoffice-ciabot.pl
+++ b/ciabot/run-libreoffice-ciabot.pl
@@ -1,13 +1,19 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl -T
+
+use strict;
+use warnings;
+
+$ENV{PATH} = join ':', qw{/usr/bin /bin};
use POSIX;
use File::Basename;
open STDOUT, '>>', "/var/log/ciabot/ciabot.out";
open STDERR, '>>', "/var/log/ciabot/ciabot.err";
+my $test = 0;
my $suffix = "";
-my $cwd = dirname($0);
+my $cwd = dirname($0) =~ /\A([[:alnum:]\/%\.\+\-_]+)\z/ ? $1 : die;
my $repodir = "$cwd/../repositories";
if ( ! -d "$repodir/core" && ! -d "$repodir/core.git" ) {
@@ -34,7 +40,7 @@ sub get_branches() {
if ( open REFS, "git show-ref |" ) {
while ( <REFS> ) {
chomp;
- if ( /^([^ ]*) refs\/remotes\/origin\/(.*)/ ) {
+ if ( /^([[:xdigit:]]{40,}) refs\/remotes\/origin\/([[:alnum:]\/%\.\+\-_]+)$/ ) {
if ( $2 ne 'HEAD' ) {
$branches{$2} = $1;
}
@@ -110,7 +116,7 @@ sub report($$$) {
}
if ( open COMMITS, "git rev-list -n $limit $new_head ^$old_head | tac |" ) {
while ( <COMMITS> ) {
- chomp;
+ $_ = /^([[:xdigit:]]{40,})$/ ? $1 : next; # untaint
print timestamp() . " Sending report about $_ in $key\n";
if (!$test) {
if ($repo eq "si-gui")
@@ -153,7 +159,7 @@ sub report($$$) {
# Report the newest commit which is not in master
if ( open COMMITS, "git rev-list -n 1 $new_head ^refs/remotes/origin/master |" ) {
while ( <COMMITS> ) {
- chomp;
+ $_ = /^([[:xdigit:]]{40,})$/ ? $1 : next; # untaint
print timestamp() . " Sending report about $_ in $key (newly created branch)\n";
if (!$test) {
qx($ciabot $repo $_ $branch_name $ciaproxy);
@@ -173,7 +179,7 @@ sub report($$$) {
print timestamp() . " Checking for changes in the libreoffice repo & sending reports to CIA.vc.\n";
- at all_repos = (
+my @all_repos = (
"core",
"dictionaries",
"help",
@@ -182,15 +188,13 @@ print timestamp() . " Checking for changes in the libreoffice repo & sending rep
"contrib/dev-tools",
);
-$test = 0;
-
if ($test) {
@all_repos = ("test");
}
my %old_ref;
-foreach $repo (@all_repos) {
+foreach my $repo (@all_repos) {
chdir "$repodir/$repo$suffix";
# skip any commits received before we started
qx(git fetch origin);
@@ -199,7 +203,7 @@ foreach $repo (@all_repos) {
}
while ( 1 ) {
- foreach $repo (@all_repos) {
+ foreach my $repo (@all_repos) {
chdir "$repodir/$repo$suffix";
# update
More information about the Libreoffice-commits
mailing list