Skip to content

Commit 916a9b3

Browse files
Copilotvgoehler
andauthored
fix: use safe_name as manifest key so manifest and cache lookups are consistent with on-disk filenames
Agent-Logs-Url: https://github.com/TUBAF-IfI-LiaScript/TUBAF-IfI-LiaScript.github.io/sessions/39b24e98-2fc1-4b1c-b177-c81333f80198 Co-authored-by: vgoehler <1705385+vgoehler@users.noreply.github.com>
1 parent 65c1521 commit 916a9b3

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

scripts/download_upstream_pdfs.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,10 @@ for i in "${!NAMES[@]}"; do
129129
fi
130130
target="${PDF_DIR}/${safe_name}"
131131

132-
printf '%s\t%s\n' "${name}" "${url}" >> "${MANIFEST}.tmp"
132+
# Use safe_name as the manifest key so the manifest reflects what is on disk.
133+
printf '%s\t%s\n' "${safe_name}" "${url}" >> "${MANIFEST}.tmp"
133134

134-
if [ -f "$target" ] && [ "${CACHED_URL[$name]+x}" ] && [ "${CACHED_URL[$name]}" = "$url" ]; then
135+
if [ -f "$target" ] && [ "${CACHED_URL[$safe_name]+x}" ] && [ "${CACHED_URL[$safe_name]}" = "$url" ]; then
135136
# File exists and URL hasn't changed → already up-to-date
136137
already_present=$((already_present + 1))
137138
else
@@ -155,7 +156,7 @@ for i in "${!NAMES[@]}"; do
155156
# Remove from manifest so the next run retries.
156157
# Split on the tab separator and compare the first field exactly so that
157158
# filenames that are substrings of each other don't cause false removals.
158-
awk -F'\t' -v prefix="${name}" '$1 != prefix' "${MANIFEST}.tmp" > "${MANIFEST}.tmp2" && mv "${MANIFEST}.tmp2" "${MANIFEST}.tmp" || true
159+
awk -F'\t' -v prefix="${safe_name}" '$1 != prefix' "${MANIFEST}.tmp" > "${MANIFEST}.tmp2" && mv "${MANIFEST}.tmp2" "${MANIFEST}.tmp" || true
159160
fi
160161
fi
161162
done

0 commit comments

Comments
 (0)