Skip to content

Instantly share code, notes, and snippets.

@jberry-suse
Last active July 1, 2017 03:25
Show Gist options
  • Save jberry-suse/3002ce897480d65988901f274633e2fb to your computer and use it in GitHub Desktop.
Save jberry-suse/3002ce897480d65988901f274633e2fb to your computer and use it in GitHub Desktop.
diff --git a/repo-checker.pl b/repo-checker.pl
index 0ef6061..ffdc255 100644
--- a/repo-checker.pl
+++ b/repo-checker.pl
@@ -68,14 +68,17 @@ sub write_package($$) {
return $name;
}
-my @rpms = glob("$repodir/*.rpm");
my $tmpdir = tempdir( "repochecker-XXXXXXX", TMPDIR => 1, CLEANUP => 1 );
my $pfile = $tmpdir . "/packages";
open( PACKAGES, ">", $pfile ) || die 'can not open';
print PACKAGES "=Ver: 2.0\n";
-foreach my $package (@rpms) {
- write_package( 1, $package );
+my @rpms;
+if (length($repodir)) {
+ @rpms = glob("$repodir/*.rpm");
+ foreach my $package (@rpms) {
+ write_package(1, $package);
+ }
}
@rpms = glob("$dir/*.rpm");
diff --git a/repo_checker.py b/repo_checker.py
index e782493..97d27ee 100755
--- a/repo_checker.py
+++ b/repo_checker.py
@@ -106,6 +106,7 @@ class RepoChecker(ReviewBot.ReviewBot):
self.group_pass = True
comment = []
+ comment_project = []
for arch in self.target_archs(project):
if arch not in self.target_archs(group):
self.logger.debug('{}/{} not available'.format(group, arch))
@@ -127,6 +128,12 @@ class RepoChecker(ReviewBot.ReviewBot):
# Perform checks on group.
results = {
+ 'cycle': CheckResult(True, None),
+ 'install': self.install_check("", directory_project, arch, []),
+ }
+ self.result_comment(project, project, arch, results, comment_project)
+
+ results = {
'cycle': self.cycle_check(project, group, arch),
'install': self.install_check(directory_project, directory_group, arch, ignore),
}
@@ -141,6 +148,17 @@ class RepoChecker(ReviewBot.ReviewBot):
self.comment_write(state='seen', result='failed', project=group,
message='\n'.join(comment).strip(), identical=True)
+ #api = self.staging_api(project)
+ #args = ['{}:Staging'.format(project), 'dashboard', 'repo_checker']
+ #previous = api.load_file_content(*args)
+ current = '\n'.join(comment_project).strip()
+ #print(current)
+ #if current != previous:
+ #args.append(current)
+ #api.save_file_content(*args)
+ with open("repo_chcker", "w") as text_file:
+ text_file.write(current)
+
return self.group_pass
def target_archs(self, project):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment