From 4b5db6e0155e11da6f493de13db975c4eb35b81a Mon Sep 17 00:00:00 2001 From: Dmitry Selyutin Date: Thu, 19 Oct 2017 10:11:05 +0300 Subject: [PATCH] pygnulib.py: instantiate root and local VFS --- pygnulib.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pygnulib.py b/pygnulib.py index c426fbc35f..8ec7934b61 100755 --- a/pygnulib.py +++ b/pygnulib.py @@ -144,8 +144,30 @@ def import_hook(script, gnulib, namespace, verbosity, options, *args, **kwargs): old_files = frozenset(cache.files) new_files = frozenset(files | set(["m4/gnulib-tool.m4"])) + table = { + "build-aux": config.auxdir, + "doc": config.doc_base, + "lib": config.source_base, + "m4": config.m4_base, + "tests": config.tests_base, + "tests=lib": config.tests_base, + "po": config.po_base, + } + table = {k:v for k,v in table.items() if v} + table["top"] = "" + root = BaseVFS(config.root, **table) + local = BaseVFS(config.local, **table) + for prefix in table: + os.makedirs(root[prefix], exist_ok=True) + + + # First the files that are in old-files, but not in new-files: removed_files = {file for file in old_files if file not in new_files} + + # Then the files that are in new-files, but not in old-files: added_files = {file for file in new_files if file not in old_files} + + # Then the files that are in new-files and in old-files: kept_files = (old_files & new_files) return os.EX_OK -- 2.39.5