From 5e5217c6317c2d7548e844c3060ddcbaa6e75263 Mon Sep 17 00:00:00 2001 From: Alessandro Comodi Date: Thu, 10 Mar 2022 13:00:53 +0100 Subject: [PATCH 1/2] utils: add file locking Signed-off-by: Alessandro Comodi --- utils/dbfixup.py | 2 ++ utils/sort_db.py | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/utils/dbfixup.py b/utils/dbfixup.py index a08bf5ae..0e3310dd 100755 --- a/utils/dbfixup.py +++ b/utils/dbfixup.py @@ -536,8 +536,10 @@ def update_seg_fns( changes += new_changes with open(fn_out, "w") as f: + util.lock_file(f, 10) for line in sorted(lines): print(line, file=f) + util.unlock_file(f) if changes is not None: seg_files += 1 diff --git a/utils/sort_db.py b/utils/sort_db.py index 7256b452..2d09a866 100755 --- a/utils/sort_db.py +++ b/utils/sort_db.py @@ -65,6 +65,7 @@ import sys import json import utils.xjson as xjson import utils.cmp as cmp +from prjxray.util import lock_file, unlock_file def split_all(s, chars): @@ -344,9 +345,11 @@ def sort_db(pathname): # copy[i], tosort[i]) with open(pathname, 'w') as f: + lock_file(f, 10) for _, l in tosort: f.write(l) f.write('\n') + unlock_file(f) return True @@ -405,8 +408,10 @@ def sort_db_text(n): rows.sort(key=lambda i: i[0]) with open(n, 'w') as f: + lock_file(f, 10) for l in rows: f.write(l[-1]) + unlock_file(f) return True From 18e7e2613d0baf8a8ef2d71f6258e7c0b7b49db1 Mon Sep 17 00:00:00 2001 From: Alessandro Comodi Date: Thu, 10 Mar 2022 13:02:34 +0100 Subject: [PATCH 2/2] gh: ci: rename workflows Signed-off-by: Alessandro Comodi --- .github/workflows/database.yml | 2 +- .github/workflows/tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/database.yml b/.github/workflows/database.yml index 924cc6e8..1bf94038 100644 --- a/.github/workflows/database.yml +++ b/.github/workflows/database.yml @@ -4,7 +4,7 @@ on: schedule: - cron: '0 0 * * *' -name: CI Build +name: Database jobs: BuildDatabase: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7c5f3f1d..2364ad66 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,7 +4,7 @@ on: schedule: - cron: '0 0 * * *' -name: CI Build +name: Tests jobs: