comparison moefetch.sh @ 221:e891b563b797

wrong rule caused mass headache
author edhoprima@gmail.com <edhoprima@gmail.com>
date Thu, 02 Jul 2009 20:33:48 +0000
parents fe4d74801b28
children e3fb9507cf7f
comparison
equal deleted inserted replaced
220:fe4d74801b28 221:e891b563b797
1 #!/bin/sh -x 1 #!/bin/sh
2 2
3 # Copyright (c) 2009, edogawaconan <me@myconan.net> 3 # Copyright (c) 2009, edogawaconan <me@myconan.net>
4 # 4 #
5 # Permission to use, copy, modify, and/or distribute this software for any 5 # Permission to use, copy, modify, and/or distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above 6 # purpose with or without fee is hereby granted, provided that the above
197 fi 197 fi
198 fi 198 fi
199 for trash in "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}/"* 199 for trash in "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}/"*
200 do 200 do
201 is_trash= 201 is_trash=
202 if test -d "${trash}" || test -n "$(Is_NotMD5 "$(basename "${trash}")")" || test -n "$(grep "$(basename "${trash}")" "${TEMP_PREFIX}-list")"; then 202 if test -d "${trash}" || test -n "$(Is_NotMD5 "$(basename "${trash}")")" || test -z "$(grep "$(basename "${trash}")" "${TEMP_PREFIX}-list")"; then
203 is_trash=1 203 is_trash=1
204 has_trash=1 204 has_trash=1
205 mv -f "${trash}" "${trash_dir}" || Err_Impossible 205 mv -f "${trash}" "${trash_dir}" || Err_Impossible
206 trashes="${trashes} 206 trashes="${trashes}
207 $(basename "${trash}")" 207 $(basename "${trash}")"
208 fi 208 fi
209 Progress_Anim 209 Progress_Anim
210 done 210 done
211 rmdir "${trash_dir}" 2>/dev/null 211 rmdir "${trash_dir}" 2>/dev/null
212 Progress_Done 212 Progress_Done
213 test -z "${has_trash}" && echo "${trashes}" 213 test -n "${has_trash}" && echo "${trashes}"
214 } 214 }
215 215
216 # check files correctness 216 # check files correctness
217 Check_Files() { 217 Check_Files() {
218 if test ! -n "${ISNEW}"; then 218 if test ! -n "${ISNEW}"; then
244 fi 244 fi
245 fi 245 fi
246 fi 246 fi
247 Progress_Anim 247 Progress_Anim
248 done 248 done
249 read
250 Progress_Done 249 Progress_Done
251 if test ! -n "${has_err_md5}" && test ! -n "${has_err_filename}"; then 250 if test ! -n "${has_err_md5}" && test ! -n "${has_err_filename}"; then
252 echo "All files OK" 251 echo "All files OK"
253 else 252 else
254 if test -n "${has_err_md5}"; then 253 if test -n "${has_err_md5}"; then