File tree 2 files changed +48
-7
lines changed 2 files changed +48
-7
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ node('master') {
83
83
fi
84
84
85
85
86
- # Save the bramch in job.properties
86
+ # Save the branch in job.properties
87
87
echo "branch=${branch}" >> ${WORKSPACE}/job.properties
88
88
89
89
# Verify this is a branch in our list of targets defined above in the parameters
@@ -93,12 +93,28 @@ node('master') {
93
93
else
94
94
# Verify this is a package we are interested in
95
95
valid=0
96
- for package in $(cat ${PROJECT_REPO}/config/package_list); do
97
- if [ "${package}" = "${fed_repo}" ]; then
98
- valid=1
99
- break
100
- fi
101
- done
96
+
97
+ # Get the upstream package list
98
+ rm -rf fedora-atomic
99
+ git clone http://pagure.io/fedora-atomic
100
+ pushd fedora-atomic
101
+ git checkout ${fed_branch}
102
+ popd
103
+
104
+ python ${PROJECT_REPO}/utils/package_checker.py ${fed_repo}
105
+ CHKR_RC=$?
106
+ # If $? -eq 0, we care about package
107
+ if [ $CHKR_RC -eq 0 ]; then
108
+ valid=1
109
+ # If $? -eq 2, upstream package list didn't exist so use legacy method to check
110
+ elif [ $CHKR_RC -eq 2 ]; then
111
+ for package in $(cat ${PROJECT_REPO}/config/package_list); do
112
+ if [ "${package}" = "${fed_repo}" ]; then
113
+ valid=1
114
+ break
115
+ fi
116
+ done
117
+ fi
102
118
103
119
if [ $valid -eq 0 ]; then
104
120
echo "Not a package we are interested in"
Original file line number Diff line number Diff line change
1
+ # !/bin/env python
2
+ import json
3
+ import sys
4
+
5
+ # Exit 2 if upstream package list doesn't exist
6
+ # Exit 1 if file exists, but package isn't in the list
7
+ # Exit 0 if file exists, and package is in the list
8
+
9
+ jsonpath = 'fedora-atomic/fedora-atomic-host-base.json'
10
+
11
+ try :
12
+ with open (jsonpath , 'r' ) as f :
13
+ atomicjson = json .load (f )
14
+ mypackage = sys .argv [1 ]
15
+
16
+ # Check if package exists in the json file
17
+ # Check both all packages and x86_64 specific packages
18
+ if mypackage in atomicjson ["packages" ] or mypackage in atomicjson ["packages-x86_64" ]:
19
+ print ("Package of interest!" )
20
+ sys .exit (0 )
21
+ # Fail if not
22
+ sys .exit (1 )
23
+ except IOError as e :
24
+ print ("Could not find upstream package json file" )
25
+ sys .exit (2 )
You can’t perform that action at this time.
0 commit comments