Merge pull request #1073 from jberry-suse/check_source-remove-diff
check_source: remove DIFFCOUNT algorithm and instead always add review_team.
This commit is contained in:
commit
55aeefacb4
@ -280,39 +280,6 @@ sub prepare_package($) {
|
||||
print SPEC join('', @lines);
|
||||
close(SPEC);
|
||||
}
|
||||
|
||||
my $dir = getcwd();
|
||||
my $diffcount = 0;
|
||||
|
||||
for my $file (glob "*") {
|
||||
my $oldfile = $files->{$file};
|
||||
if ($oldfile) {
|
||||
|
||||
for my $line (split(/\n/, diff($oldfile, $file))) {
|
||||
next unless $line =~ m/^[-+]/;
|
||||
next if $line =~ m/^\Q---/;
|
||||
next if $line =~ m/^\Q+++/;
|
||||
if ($file =~ m/\.spec$/) {
|
||||
$diffcount++;
|
||||
|
||||
for my $command (qw(chmod chown rm)) {
|
||||
if ($line =~ m/\b$command\b/) {
|
||||
$diffcount += 3000;
|
||||
last;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$diffcount += 7777;
|
||||
last;
|
||||
}
|
||||
}
|
||||
delete $files->{$file};
|
||||
}
|
||||
else {
|
||||
$files->{$file} = "$dir/$file";
|
||||
}
|
||||
}
|
||||
return $diffcount;
|
||||
}
|
||||
|
||||
# move it back so we also diff the service file
|
||||
@ -325,11 +292,5 @@ chdir($old);
|
||||
prepare_package(\%files);
|
||||
chdir($odir);
|
||||
chdir($dir);
|
||||
my $diff = prepare_package(\%files);
|
||||
|
||||
for my $file (keys %files) {
|
||||
$diff += 10000;
|
||||
}
|
||||
|
||||
print "DIFFCOUNT $diff\n";
|
||||
prepare_package(\%files);
|
||||
exit(0);
|
@ -81,8 +81,8 @@ class CheckSource(ReviewBot.ReviewBot):
|
||||
self.review_messages['declined'] = "A package submitted as %s has to build as 'Name: %s' - found Name '%s'" % (target_package, target_package, new_info['name'])
|
||||
return False
|
||||
|
||||
# Run source-checker.pl script and interpret output.
|
||||
source_checker = os.path.join(CheckSource.SCRIPT_PATH, 'source-checker.pl')
|
||||
# Run check_source.pl script and interpret output.
|
||||
source_checker = os.path.join(CheckSource.SCRIPT_PATH, 'check_source.pl')
|
||||
civs = ''
|
||||
new_version = None
|
||||
if old_info['version'] and old_info['version'] != new_info['version']:
|
||||
@ -104,23 +104,12 @@ class CheckSource(ReviewBot.ReviewBot):
|
||||
shutil.rmtree(dir)
|
||||
self.review_messages['accepted'] = 'Check script succeeded'
|
||||
|
||||
# Look for DIFFCOUNT in output.
|
||||
if len(checked) and checked[-1].startswith('DIFFCOUNT'):
|
||||
# This is a major break through in perl<->python communication!
|
||||
diff = int(checked.pop().split(' ')[1])
|
||||
output = ' '.join(checked).translate(None, '\033')
|
||||
if not new_version:
|
||||
diff = 12345
|
||||
else: # e.g. new package
|
||||
diff = 13579
|
||||
|
||||
if len(checked):
|
||||
self.review_messages['accepted'] += "\n\nOutput of check script (non-fatal):\n" + output
|
||||
|
||||
if not self.skip_add_reviews:
|
||||
if diff > 8:
|
||||
if self.review_team is not None:
|
||||
self.add_review(self.request, by_group=self.review_team, msg='Please review sources')
|
||||
if self.review_team is not None:
|
||||
self.add_review(self.request, by_group=self.review_team, msg='Please review sources')
|
||||
|
||||
if self.only_changes():
|
||||
self.logger.debug('only .changes modifications')
|
||||
|
@ -33,7 +33,7 @@ ln -sr ./osc-check_source.py ./osclib ~/.osc-plugins
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
The program will search also some external scripts (like
|
||||
source-checker.pl) inside the cloned directory (following the symlink).
|
||||
check_source.pl) inside the cloned directory (following the symlink).
|
||||
|
||||
|
||||
Command line
|
Loading…
x
Reference in New Issue
Block a user