Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if [ "$PUPMODE" = "2" ]; then # from BK's quirky6.1 # LN# 151-179 of /usr/local/petget/installpkg.sh (tahpup) - http://www.pearltrees.com/s243a/installpkg-sh-usr-local-petget/id20402080/item224091068
- #131220 131229 detect if not enough room in /tmp...
- DIRECTSAVEPATH="/tmp/petget/directsavepath"
- SIZEB=`stat --format=%s "${DLPKG_PATH}"/${DLPKG_BASE}`
- SIZEK=`expr $SIZEB \/ 1024`
- EXPK=`expr $SIZEK \* 5` #estimated worst-case expanded size.
- NEEDK=$EXPK
- TMPK=`df -k /tmp | grep '^tmpfs' | tr -s ' ' | cut -f 4 -d ' '` #free space in /tmp
- if [ $EXPK -ge $TMPK ];then
- DIRECTSAVEPATH="/audit/directsavepath"
- NEEDK=`expr $NEEDK \* 2`
- fi
- if [ "$DIRECTSAVEPATH" ];then
- rm -rf $DIRECTSAVEPATH
- mkdir -p $DIRECTSAVEPATH
- fi
- # check enough space to install pkg...
- #as the pkg gets expanded to an intermediate dir, maybe in main f.s...
- PARTK=`df -k / | grep '/$' | tr -s ' ' | cut -f 4 -d ' '` #free space in partition.
- if [ $NEEDK -gt $PARTK ];then
- LANG=$LANG_USER
- if [ $DISPLAY ];then
- /usr/lib/gtkdialog/box_ok "$(gettext 'Puppy package manager')" error "$(gettext 'Not enough free space in the partition to install this package'):" "<i>${DLPKG_BASE}</i>"
- else
- echo -e "$(gettext 'Not enough free space in the partition to install this package'):\n${DLPKG_BASE}"
- fi
- [ "$DLPKG_PATH" != "" ] && rm -f "${DLPKG_PATH}"/${DLPKG_BASE}
- exit 1
- fi
Advertisement
Add Comment
Please, Sign In to add comment