File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
161162done
You can’t perform that action at this time.
0 commit comments