forked from CentOS-PaaS-SIG/ci-pipeline
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Johnny Bieren <[email protected]>
- Loading branch information
1 parent
6fc055e
commit dadcbde
Showing
2 changed files
with
18 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
#!/bin/env python | ||
# !/bin/env python | ||
import json | ||
import sys | ||
import os.path | ||
|
||
# Exit 2 if upstream package list doesnt exist | ||
# Exit 1 if file exists, but package isnt in the list | ||
# Exit 2 if upstream package list doesn't exist | ||
# Exit 1 if file exists, but package isn't in the list | ||
# Exit 0 if file exists, and package is in the list | ||
|
||
jsonpath = 'fedora-atomic/fedora-atomic-host-base.json' | ||
|
||
# Make sure json file exists | ||
if not os.path.isfile(jsonpath): | ||
try: | ||
with open(jsonpath, 'r') as f: | ||
atomicjson = json.load(f) | ||
mypackage = sys.argv[1] | ||
|
||
# Check if package exists in the json file | ||
# Check both all packages and x86_64 specific packages | ||
if mypackage in atomicjson["packages"] or mypackage in atomicjson["packages-x86_64"]: | ||
print ("Package of interest!") | ||
sys.exit(0) | ||
# Fail if not | ||
sys.exit(1) | ||
except IOError as e: | ||
print("Could not find upstream package json file") | ||
sys.exit(2) | ||
|
||
jsonfile = open(jsonpath, 'r').read() | ||
atomicjson = json.loads(jsonfile) | ||
mypackage = sys.argv[1] | ||
|
||
# Check if package exists in the json file | ||
# Check both all packages and x86_64 specific packages | ||
if mypackage in atomicjson["packages"] or mypackage in atomicjson["packages-x86_64"]: | ||
print ("Package of interest!") | ||
sys.exit(0) | ||
|
||
# Fail if not | ||
sys.exit(1) |