-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
frontend, backend, rpmbuild: skip excluded chroots
Fix #2137
- Loading branch information
Showing
9 changed files
with
77 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
""" | ||
Create `results.json` file for SRPM builds | ||
""" | ||
|
||
import os | ||
import simplejson | ||
from copr_rpmbuild.automation.base import AutomationTool | ||
from copr_rpmbuild.helpers import locate_srpm, get_rpm_header | ||
|
||
|
||
class SRPMResults(AutomationTool): | ||
""" | ||
Create `results.json` for SRPM builds | ||
""" | ||
|
||
@property | ||
def enabled(self): | ||
""" | ||
Do this for every RPM build | ||
""" | ||
return not self.chroot | ||
|
||
def run(self): | ||
""" | ||
Create `results.json` | ||
""" | ||
data = self.get_package_info() | ||
path = os.path.join(self.resultdir, "results.json") | ||
with open(path, "w", encoding="utf-8") as dst: | ||
simplejson.dump(data, dst, indent=4) | ||
|
||
def get_package_info(self): | ||
""" | ||
Return ``dict`` with interesting package metadata | ||
""" | ||
srpm = locate_srpm(self.resultdir) | ||
hdr = get_rpm_header(srpm) | ||
keys = ["name", "exclusivearch", "excludearch"] | ||
return {key: hdr[key] for key in keys} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters