From: Dmitry Selyutin Date: Thu, 28 Jun 2018 22:45:09 +0000 (+0300) Subject: pygnulib: fix substitutions; backup removed files X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5cf9db34759f11bd4100cc674e43c3365e2f748;p=thirdparty%2Fgnulib.git pygnulib: fix substitutions; backup removed files --- diff --git a/pygnulib.py b/pygnulib.py index e4dbcdf106..471c45f5f1 100755 --- a/pygnulib.py +++ b/pygnulib.py @@ -232,7 +232,8 @@ def import_hook(script, gnulib, namespace, explicit, verbosity, options, *args, fmt = (action + " file {file} (backup in {file}~)") if not dry_run: try: - vfs_unlink(project, file, backup=True) + vfs_backup(project, file) + vfs_unlink(project, file) except FileNotFoundError: pass print(fmt.format(file=file), file=sys.stdout) @@ -274,7 +275,7 @@ def import_hook(script, gnulib, namespace, explicit, verbosity, options, *args, # First the files that are in old_files, but not in new_files. # Then the files that are in new_files, but not in old_files. # Then the files that are in new_files and in old_files. - origin = lambda file: ("lib/" + file[len("tests=lib/"):]) if file.startswith("tests=lib/") else file + origin = lambda file: project[file] removed_files = set(map(origin, old_files)).difference(map(origin, new_files)) added_files = new_files.difference(old_files) kept_files = (old_files & new_files)