From efdfb4727f6220cccd92367af7b866cf4ddb1f02 Mon Sep 17 00:00:00 2001 From: Lumir Balhar Date: Wed, 23 Sep 2020 10:52:45 +0200 Subject: [PATCH] Automatically remove dist-info/REQUESTED files together with RECORD --- macros.pyproject | 1 + pyproject_save_files.py | 4 ++-- pyproject_save_files_test_data.yaml | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/macros.pyproject b/macros.pyproject index ad2b385..294d677 100644 --- a/macros.pyproject +++ b/macros.pyproject @@ -49,6 +49,7 @@ for site_dir in ${site_dirs[@]}; do %{__python3} -B %{_rpmconfigdir}/redhat/pyproject_preprocess_record.py \\ --buildroot %{buildroot} --record ${distinfo}/RECORD --output %{pyproject_record} rm ${distinfo}/RECORD + rm ${distinfo}/REQUESTED || : done done lines=$(wc -l %{pyproject_ghost_distinfo} | cut -f1 -d" ") diff --git a/pyproject_save_files.py b/pyproject_save_files.py index ad2911c..a1d8bd9 100644 --- a/pyproject_save_files.py +++ b/pyproject_save_files.py @@ -145,8 +145,8 @@ def classify_paths( continue if path.parent == distinfo: - if path.name == "RECORD": - # RECORD files are removed manually in %pyproject_install + if path.name in ("RECORD", "REQUESTED"): + # RECORD and REQUESTED files are removed in %pyproject_install # See PEP 627 continue # TODO is this a license/documentation? diff --git a/pyproject_save_files_test_data.yaml b/pyproject_save_files_test_data.yaml index 0237e84..111f7f6 100644 --- a/pyproject_save_files_test_data.yaml +++ b/pyproject_save_files_test_data.yaml @@ -1410,7 +1410,6 @@ classified: - /usr/lib/python3.7/site-packages/Printrun-2.0.0rc6.dist-info/INSTALLER - /usr/lib/python3.7/site-packages/Printrun-2.0.0rc6.dist-info/METADATA - /usr/lib/python3.7/site-packages/Printrun-2.0.0rc6.dist-info/top_level.txt - - /usr/lib/python3.7/site-packages/Printrun-2.0.0rc6.dist-info/REQUESTED - /usr/lib/python3.7/site-packages/Printrun-2.0.0rc6.dist-info/WHEEL - /usr/lib/python3.7/site-packages/Printrun-2.0.0rc6.dist-info/direct_url.json licenses: [] @@ -2711,7 +2710,6 @@ dumped: - /usr/lib/python3.7/site-packages/Printrun-2.0.0rc6.dist-info/COPYING - /usr/lib/python3.7/site-packages/Printrun-2.0.0rc6.dist-info/INSTALLER - /usr/lib/python3.7/site-packages/Printrun-2.0.0rc6.dist-info/METADATA - - /usr/lib/python3.7/site-packages/Printrun-2.0.0rc6.dist-info/REQUESTED - /usr/lib/python3.7/site-packages/Printrun-2.0.0rc6.dist-info/WHEEL - /usr/lib/python3.7/site-packages/Printrun-2.0.0rc6.dist-info/direct_url.json - /usr/lib/python3.7/site-packages/Printrun-2.0.0rc6.dist-info/top_level.txt