diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2008-03-08 22:42:40 +0000 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2008-03-08 22:42:40 +0000 |
commit | 9b76c8402e08f45ac0da092469aebbf0f95c8ad7 (patch) | |
tree | f4aff2b43d937fca063e27efd7ccea30c9302e6f /Library | |
parent | c7c6384e1b4b08d546b9f1d7728c218eee42ac0f (diff) |
Just fixed the stupid move.sh script.
Diffstat (limited to 'Library')
-rwxr-xr-x | Library/move.sh | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/Library/move.sh b/Library/move.sh index 31c89e4..f264dcd 100755 --- a/Library/move.sh +++ b/Library/move.sh @@ -12,13 +12,9 @@ function df_() { function mv_() { src=$1 - dst=$2 - if [[ -e ${dst} ]]; then - dst=$(mktemp -d /var/cydia.XXXXXX) - else - mkdir -p "${dst}" - fi + mkdir -p /var/stash + dst=$(mktemp -d /var/stash/$(basename "${dir}").XXXXXX) if [[ -e ${src} ]]; then chmod --reference="${src}" "${dst}" @@ -40,7 +36,6 @@ function mv_() { function shift_() { dir=$1 - dst=$2 if [[ -d ${dir} && ! -h ${dir} ]]; then used=$(du -bs "${dir}") @@ -48,11 +43,11 @@ function shift_() { free=$(df_ /var) if [[ $((used + 524288)) -lt ${free} ]]; then - mv_ "${dir}" "${dst}" + mv_ "${dir}" fi - elif [[ -h ${dir} && ! -e ${dir} ]]; then + elif [[ ! -e ${dir} ]]; then rm -f "${dir}" - mv_ "${dir}" "${dst}" + mv_ "${dir}" fi } |