Align dop20 filelist handling with archive source
This commit is contained in:
@@ -4,20 +4,27 @@ set -euo pipefail
|
||||
|
||||
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd)"
|
||||
DOP_ROOT="$ROOT/raw/dop20"
|
||||
LIST="${LIST:-$DOP_ROOT/filelist.txt}"
|
||||
OUT="$DOP_ROOT/jp2"
|
||||
LIST="${LIST:-$ROOT/archive/dop20/filelist.txt}"
|
||||
OUT_JP2="$DOP_ROOT/jp2"
|
||||
OUT_J2W="$DOP_ROOT/j2w"
|
||||
OUT_META="$DOP_ROOT/meta"
|
||||
|
||||
if [[ ! -f "$LIST" ]]; then
|
||||
echo "Missing filelist: $LIST" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$OUT"
|
||||
mkdir -p "$OUT_JP2" "$OUT_J2W" "$OUT_META"
|
||||
|
||||
while IFS= read -r url; do
|
||||
[[ -z "$url" || "$url" =~ ^# ]] && continue
|
||||
fname="${url##*/}"
|
||||
dest="$OUT/$fname"
|
||||
case "$fname" in
|
||||
*.jp2) dest="$OUT_JP2/$fname" ;;
|
||||
*.j2w) dest="$OUT_J2W/$fname" ;;
|
||||
*_meta.xml) dest="$OUT_META/$fname" ;;
|
||||
*) echo "Skipping unknown asset type: $fname" >&2; continue ;;
|
||||
esac
|
||||
if [[ -f "$dest" ]]; then
|
||||
echo "Exists: $fname"
|
||||
continue
|
||||
@@ -26,4 +33,4 @@ while IFS= read -r url; do
|
||||
curl -fL "$url" -o "$dest"
|
||||
done < "$LIST"
|
||||
|
||||
echo "Done. Files in $OUT"
|
||||
echo "Done. Files in $OUT_JP2, $OUT_J2W, $OUT_META"
|
||||
|
||||
Reference in New Issue
Block a user