|
|
@@ -212,6 +212,8 @@ function respond { |
|
|
|
continue |
|
|
|
fi |
|
|
|
|
|
|
|
log 'Starting upload batch' |
|
|
|
|
|
|
|
# Record SHA-256 hashes for new files |
|
|
|
sha256sum "${filenames[@]}" > >(log_loop 'sha256sum: ') |
|
|
|
|
|
|
@@ -226,6 +228,7 @@ function respond { |
|
|
|
fi |
|
|
|
uploadsfine=y |
|
|
|
for f in "${filenames[@]}"; do |
|
|
|
log "Uploading $(printf '%q' "${f}") to ${identifier}" |
|
|
|
ia-upload-stream --no-derive "${identifier}" "${f}" \ |
|
|
|
"collection:${collection}" \ |
|
|
|
'mediatype:software' \ |
|
|
@@ -242,6 +245,7 @@ function respond { |
|
|
|
done |
|
|
|
|
|
|
|
if [[ -z "${uploadsfine}" ]]; then |
|
|
|
log 'At least one upload in the batch failed, not removing anything' |
|
|
|
continue |
|
|
|
fi |
|
|
|
|
|
|
@@ -264,7 +268,7 @@ function respond { |
|
|
|
touch '.uploaded' |
|
|
|
for f in "${filenames[@]}"; do |
|
|
|
if [[ "${f}" != *_codearchiver_metadata.txt ]]; then |
|
|
|
log "Replacing ${f} with symlink to .uploaded" |
|
|
|
log "Replacing $(printf '%q' "${f}") with symlink to .uploaded" |
|
|
|
{ rm --verbose -- "${f}" && ln --symbolic --verbose '.uploaded' "${f}"; } |& log_loop 'rm/ln: ' |
|
|
|
fi |
|
|
|
done |
|
|
|