teknoraver / rpms / rpm

Forked from rpms/rpm 4 months ago
Clone

Blame rpm-4.13.x-pythondistdeps.py-skip-.egg-link-files.patch

Igor Gnatenko 7cf326
From 83e4d44b802d39dfbd407488c0d9f629799b809c Mon Sep 17 00:00:00 2001
Igor Gnatenko 7cf326
From: Igor Gnatenko <ignatenko@redhat.com>
Igor Gnatenko 7cf326
Date: Mon, 22 Aug 2016 12:56:05 +0200
Igor Gnatenko 7cf326
Subject: [PATCH 3/3] pythondistdeps.py: skip .egg-link files
Igor Gnatenko 7cf326
Igor Gnatenko 7cf326
From setuptools's documentation:
Igor Gnatenko 7cf326
These files are not eggs, strictly speaking. They simply provide a way
Igor Gnatenko 7cf326
to reference an egg that is not physically installed in the desired
Igor Gnatenko 7cf326
location. They exist primarily as a cross-platform alternative to
Igor Gnatenko 7cf326
symbolic links, to support "installing" code that is being developed in
Igor Gnatenko 7cf326
a different location than the desired installation location.
Igor Gnatenko 7cf326
Igor Gnatenko 7cf326
If we read .egg-link using pkg_resources.Distribution it will
Igor Gnatenko 7cf326
never have version as it is just list of directories which should be
Igor Gnatenko 7cf326
taken into account.
Igor Gnatenko 7cf326
Igor Gnatenko 7cf326
We could change into that directories and add eggs from those locations
Igor Gnatenko 7cf326
for parsing, but RPM's dependency generator already passing all files
Igor Gnatenko 7cf326
from built RPM so it just does not make any sense to traverse those
Igor Gnatenko 7cf326
directories.
Igor Gnatenko 7cf326
Igor Gnatenko 7cf326
After all written above, let's just ignore .egg-link files.
Igor Gnatenko 7cf326
Igor Gnatenko 7cf326
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
Igor Gnatenko 7cf326
---
Igor Gnatenko 7cf326
 scripts/pythondistdeps.py | 2 --
Igor Gnatenko 7cf326
 1 file changed, 2 deletions(-)
Igor Gnatenko 7cf326
Igor Gnatenko 7cf326
diff --git a/scripts/pythondistdeps.py b/scripts/pythondistdeps.py
Igor Gnatenko 7cf326
index d7226e0..76017f3 100755
Igor Gnatenko 7cf326
--- a/scripts/pythondistdeps.py
Igor Gnatenko 7cf326
+++ b/scripts/pythondistdeps.py
Igor Gnatenko 7cf326
@@ -89,14 +89,12 @@ for f in files:
Igor Gnatenko 7cf326
     lower_dir = dirname(lower)
Igor Gnatenko 7cf326
     if lower_dir.endswith('.egg') or \
Igor Gnatenko 7cf326
             lower_dir.endswith('.egg-info') or \
Igor Gnatenko 7cf326
-            lower_dir.endswith('.egg-link') or \
Igor Gnatenko 7cf326
             lower_dir.endswith('.dist-info'):
Igor Gnatenko 7cf326
         lower = lower_dir
Igor Gnatenko 7cf326
         f = dirname(f)
Igor Gnatenko 7cf326
     # Determine provide, requires, conflicts & recommends based on egg/dist metadata
Igor Gnatenko 7cf326
     if lower.endswith('.egg') or \
Igor Gnatenko 7cf326
             lower.endswith('.egg-info') or \
Igor Gnatenko 7cf326
-            lower.endswith('.egg-link') or \
Igor Gnatenko 7cf326
             lower.endswith('.dist-info'):
Igor Gnatenko 7cf326
         # This import is very slow, so only do it if needed
Igor Gnatenko 7cf326
         from pkg_resources import Distribution, FileMetadata, PathMetadata
Igor Gnatenko 7cf326
-- 
Igor Gnatenko 7cf326
2.9.3
Igor Gnatenko 7cf326