Skip to content

Commit 6f74add

Browse files
authored
fix: skip invalid entries in packagesite.yaml processing (#145)
1 parent 1aed296 commit 6f74add

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

freebsd-pkg/scan_and_clean_mismatched_files.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ def main(args):
3535
with open("/tmp/packagesite.yaml", "r") as f:
3636
for line in f:
3737
line = json.loads(line)
38+
# Skip lines without repopath or sum
39+
if "repopath" not in line or "sum" not in line:
40+
continue
3841
hash_value = line["sum"]
3942
repopath: str = line["repopath"] # like All/xxx.pkg
4043
repopath_full = (packagesite_file.parent / repopath).absolute()

freebsd-pkg/sync.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ channel_sync() {
6161
return 1
6262
fi
6363
fi
64-
jq -r '"\(.sum) \(.repopath)"' $tmpdir/packagesite.yaml | sort -k2 > $meta
64+
jq -r 'select(.repopath != null and .sum != null) | "\(.sum) \(.repopath)"' $tmpdir/packagesite.yaml | sort -k2 > $meta
6565
rm -f $tmpdir/packagesite.yaml
6666
export local_dir=$basedir
6767
if [[ $FBSD_PKG_INDEX_ONLY == false ]]; then

0 commit comments

Comments
 (0)