- if [ "$type" = "mmotm" ]; then
- cd ../mmotm || {
- echo "Cannot chdir to ../mmotm" 1>&2
- continue
- }
- rsync -avHPz --exclude .git --exclude broken-out.tar.gz --delete ozlabs.org::akpm/mmotm/. .
- # we only use the fist lines of {origin,linux-next}.patch
- [ -f broken-out/origin.patch ] &&
- sed -i 1q broken-out/origin.patch
- [ -f broken-out/linux-next.patch ] &&
- sed -i 1q broken-out/linux-next.patch
+fetch_mmotm()
+{
+ (
+ if ! cd ../mmotm; then
+ printf 'Cannot chdir to ../mmotm\n' 1>&2
+ return
+ fi
+ if ! rsync -az --partial --exclude '.git*' \
+ --exclude broken-out.tar.gz --delete \
+ ozlabs.org::akpm/mmotm/. .; then
+ git reset --hard
+ printf 'Fetcing mmotm failed\n' 1>&2
+ return
+ fi