+#! /bin/sh -e
+
+## Unpack all of the zip files.
+wos=$MIRRORS/worldofspectrum
+from=$wos/games to=$wos/games.unpack
+(cd "$from" && find . -name \*.zip -print) |
+while read i; do
+ case $i in ../* | */../*) continue ;; esac
+ path=${i%.zip}; dir=${path%/*} base=${path##*/}
+ if [ -e "$to/$path/.stamp" ] &&
+ [ ! "$from/$i" -nt "$to/$path/.stamp" ]; then
+ continue
+ fi
+ rm -rf "$to/%tmp" "$to/$path"
+ mkdir -p "$to/%tmp/$base"
+ (cd "$to/%tmp/$base" && unzip "$from/$i")
+ touch -r"$from/$i" "$to/%tmp/$base/.stamp"
+ mv "$to/%tmp/$base" "$to/$dir/"
+ rmdir "$to/%tmp"
+done