Skip to content

Commit 7ebf00a

Browse files
committed
Improve handling of traced symlinks
In particular, don't make them input files.
1 parent 0f9fd1d commit 7ebf00a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

reprozip/reprozip/tracer/trace.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,12 @@ def get_files(conn):
160160
# Adds symbolic links as read files
161161
for filename in find_all_links(r_name.parent if r_mode & FILE_LINK
162162
else r_name, False):
163-
if filename not in files:
163+
try:
164+
f = files[filename]
165+
except KeyError:
164166
f = TracedFile(filename)
165-
f.read(run)
166167
files[f.path] = f
168+
f.read(run)
167169
# Go to final target
168170
if not r_mode & FILE_LINK:
169171
r_name = r_name.resolve()
@@ -185,7 +187,11 @@ def get_files(conn):
185187
files[fp.path] = fp
186188

187189
# Identifies input files
188-
if r_name.is_file() and r_name not in executed:
190+
if (
191+
not r_mode & FILE_LINK
192+
and r_name.is_file()
193+
and r_name not in executed
194+
):
189195
access_files[-1].add(f)
190196
cur.close()
191197

0 commit comments

Comments
 (0)