Mercurial > ec-dotfiles
comparison moefetch.sh @ 216:a869987c4646
did I say 'mess up'?
Bugfix
author | edhoprima@gmail.com <edhoprima@gmail.com> |
---|---|
date | Thu, 02 Jul 2009 20:06:43 +0000 |
parents | 710082ce6788 |
children | 77cd21d714f6 |
comparison
equal
deleted
inserted
replaced
215:710082ce6788 | 216:a869987c4646 |
---|---|
165 # verify required folders exist and writeable | 165 # verify required folders exist and writeable |
166 Check_Folders(){ | 166 Check_Folders(){ |
167 test -O "${BASE_DIR}" || Err_Fatal "You don't own ${BASE_DIR}. Please fix ${BASE_DIR} or run this script in your own directory." | 167 test -O "${BASE_DIR}" || Err_Fatal "You don't own ${BASE_DIR}. Please fix ${BASE_DIR} or run this script in your own directory." |
168 for directory in temp trash deleted "${SITE_DIR}/${TARGET_DIR}"; do | 168 for directory in temp trash deleted "${SITE_DIR}/${TARGET_DIR}"; do |
169 if [ ! -d "${BASE_DIR}/${directory}" ]; then | 169 if [ ! -d "${BASE_DIR}/${directory}" ]; then |
170 mkdir "${BASE_DIR}/${directory}" || Err_Impossible | 170 mkdir -p "${BASE_DIR}/${directory}" || Err_Impossible |
171 fi | 171 fi |
172 if [ ! -O "${BASE_DIR}/${directory}" ]; then | 172 if [ ! -O "${BASE_DIR}/${directory}" ]; then |
173 echo "You don't own the ${BASE_DIR}/${directory}, applying globally writeable permission on it" | 173 echo "You don't own the ${BASE_DIR}/${directory}, applying globally writeable permission on it" |
174 chmod -R u=rwX,g=rwX,o=rwX "${BASE_DIR}/${directory}" || Err_Impossible | 174 chmod -R u=rwX,g=rwX,o=rwX "${BASE_DIR}/${directory}" || Err_Impossible |
175 fi | 175 fi |
188 Progress_Init | 188 Progress_Init |
189 trash_dir="${BASE_DIR}/trash/${trash_dir}/$(date -u "+${SITE_DIR}-${TARGET_DIR}-%Y%m%d-%H.%M")" | 189 trash_dir="${BASE_DIR}/trash/${trash_dir}/$(date -u "+${SITE_DIR}-${TARGET_DIR}-%Y%m%d-%H.%M")" |
190 trashes="These files have been moved to ${trash_dir}:" | 190 trashes="These files have been moved to ${trash_dir}:" |
191 has_trash= | 191 has_trash= |
192 if test ! -d "${trash_dir}"; then | 192 if test ! -d "${trash_dir}"; then |
193 mkdir -p "${BASE_DIR}/trash/${trash_dir}" || Err_Impossible | 193 mkdir -p "${trash_dir}" || Err_Impossible |
194 else | 194 else |
195 if test ! -o "${trash_dir}"; then | 195 if test ! -o "${trash_dir}"; then |
196 chmod -R u=rwX,g=rwX,o=rwX "${BASE_DIR}/${directory}" || Err_Impossible | 196 chmod -R u=rwX,g=rwX,o=rwX "${BASE_DIR}/${directory}" || Err_Impossible |
197 fi | 197 fi |
198 fi | 198 fi |
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 -z "${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 |