Mercurial > ec-dotfiles
diff 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 |
line wrap: on
line diff
--- a/moefetch.sh Thu Jul 02 20:30:34 2009 +0000 +++ b/moefetch.sh Thu Jul 02 20:33:48 2009 +0000 @@ -1,4 +1,4 @@ -#!/bin/sh -x +#!/bin/sh # Copyright (c) 2009, edogawaconan <me@myconan.net> # @@ -199,7 +199,7 @@ for trash in "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}/"* do is_trash= - if test -d "${trash}" || test -n "$(Is_NotMD5 "$(basename "${trash}")")" || test -n "$(grep "$(basename "${trash}")" "${TEMP_PREFIX}-list")"; then + if test -d "${trash}" || test -n "$(Is_NotMD5 "$(basename "${trash}")")" || test -z "$(grep "$(basename "${trash}")" "${TEMP_PREFIX}-list")"; then is_trash=1 has_trash=1 mv -f "${trash}" "${trash_dir}" || Err_Impossible @@ -210,7 +210,7 @@ done rmdir "${trash_dir}" 2>/dev/null Progress_Done - test -z "${has_trash}" && echo "${trashes}" + test -n "${has_trash}" && echo "${trashes}" } # check files correctness @@ -246,7 +246,6 @@ fi Progress_Anim done - read Progress_Done if test ! -n "${has_err_md5}" && test ! -n "${has_err_filename}"; then echo "All files OK"