comparison bin/moefetch @ 300:4879900244f7

Awesomely incorrect logic.
author Edho Arief <edho@myconan.net>
date Thu, 09 Feb 2012 08:59:30 +0700
parents d5ac851f3225
children 36bc27bb32ff
comparison
equal deleted inserted replaced
299:d5ac851f3225 300:4879900244f7
164 for dircontent in "${*}/"* "${*}/".*; do 164 for dircontent in "${*}/"* "${*}/".*; do
165 if [ -e "${dircontent}" ] && [ x"${dircontent}" != x"${*}/." ] && [ x"${dircontent}" != x"${*}/.." ]; then 165 if [ -e "${dircontent}" ] && [ x"${dircontent}" != x"${*}/." ] && [ x"${dircontent}" != x"${*}/.." ]; then
166 numfiles=$((numfiles + 1)) 166 numfiles=$((numfiles + 1))
167 fi 167 fi
168 done 168 done
169 echo $((numfiles - 2)) 169 echo $((numfiles))
170 } 170 }
171 171
172 # check tools availability 172 # check tools availability
173 Check_Tools() { 173 Check_Tools() {
174 # verify all programs required do indeed exist 174 # verify all programs required do indeed exist
213 chmod -R u=rwX,g=rwX,o=rwX "${BASE_DIR}/${directory}" || Err_Impossible 213 chmod -R u=rwX,g=rwX,o=rwX "${BASE_DIR}/${directory}" || Err_Impossible
214 fi 214 fi
215 fi 215 fi
216 for trash in "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}/"* 216 for trash in "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}/"*
217 do 217 do
218 is_trash= 218 if [ -e "${trash}" ]; then
219 if [ -d "${trash}" ] || [ -n "$(is_not_md5 "${trash}")" ] || [ -z "$(grep "$(get_basename "${trash}")" "${TEMP_PREFIX}-list")" ]; then 219 is_trash=
220 is_trash=1 220 if [ -d "${trash}" ] || [ -n "$(is_not_md5 "${trash}")" ] || [ -z "$(grep "$(get_basename "${trash}")" "${TEMP_PREFIX}-list")" ]; then
221 has_trash=1 221 is_trash=1
222 mv -f -- "${trash}" "${trash_dir}" || Err_Impossible 222 has_trash=1
223 trashes="${trashes} 223 mv -f -- "${trash}" "${trash_dir}" || Err_Impossible
224 trashes="${trashes}
224 $(get_basename "${trash}")" 225 $(get_basename "${trash}")"
226 fi
225 fi 227 fi
226 progress_anim 228 progress_anim
227 done 229 done
228 rmdir "${trash_dir}" 2>/dev/null 230 rmdir "${trash_dir}" 2>/dev/null
229 progress_done 231 progress_done