summaryrefslogtreecommitdiff
path: root/over/usr/libexec
diff options
context:
space:
mode:
authorJay Freeman <saurik@saurik.com>2008-04-06 10:28:29 +0000
committerJay Freeman <saurik@saurik.com>2008-04-06 10:28:29 +0000
commitd699a01fabaa04a1aad60f6ca5777f82ee24839a (patch)
tree1eb62bad23b14a0877c5b9171f2a5f9358c8d592 /over/usr/libexec
parent8a49e427447f40fdd43fc4b5f513b166dd639e2a (diff)
Drastic, sweeping modifications to support iPhone 1.2.0/2.0.
git-svn-id: http://svn.telesphoreo.org/trunk@199 514c082c-b64e-11dc-b46d-3d985efe055d
Diffstat (limited to 'over/usr/libexec')
-rwxr-xr-xover/usr/libexec/cydia_/space.sh53
1 files changed, 3 insertions, 50 deletions
diff --git a/over/usr/libexec/cydia_/space.sh b/over/usr/libexec/cydia_/space.sh
index 6f3b29ade..a8148fd52 100755
--- a/over/usr/libexec/cydia_/space.sh
+++ b/over/usr/libexec/cydia_/space.sh
@@ -1,61 +1,14 @@
#!/usr/libexec/cydia_/bash
export PATH=/usr/libexec/cydia_
-shopt -s extglob nullglob
-
-function df_() {
- free=$(df -B1 "$1")
- free=${free% *%*}
- free=${free%%*( )}
- free=${free##* }
- echo "${free}"
-}
-
-function mv_() {
- src=$1
- dst=/var/$(basename "${src}")
-
- if [[ -e ${dst} ]]; then
- dst=$(mktemp -d /var/cydia.XXXXXX)
- else
- mkdir -p "${dst}"
- fi
-
- if [[ -e ${src} ]]; then
- chmod --reference="${src}" "${dst}"
- chown --reference="${src}" "${dst}"
-
- cp -aT "${src}" "${dst}" || {
- rm -rf "${dst}"
- exit 1
- }
-
- rm -rf "${src}"
- else
- chmod 775 "${dst}"
- chown root.admin "${dst}"
- fi
-
- ln -s "${dst}" "${src}"
-}
-
for dir in \
/Applications \
/Library/Ringtones \
/Library/Wallpaper \
/System/Library/Fonts \
/usr/share
-do if [[ -d ${dir} && ! -h ${dir} ]]; then
- used=$(du -bs "${dir}")
- used=${used%%$'\t'*}
- free=$(df_ /var)
-
- if [[ $((used + 524288)) -lt ${free} ]]; then
- mv_ "${dir}"
- fi
-elif [[ -h ${dir} && ! -e ${dir} ]]; then
- rm -f "${dir}"
- mv_ "${dir}"
-fi; done
+do
+ . /usr/libexec/cydia/move.sh "${dir}" /var/"$(basename "${src}")"
+done
[[ $(df_ /) -gt 35651584 && $(df_ /var) -gt 35651584 ]]