This is how far I have gotten, but now I need some help:
Code: Select all
DLG1="
while [ 1 ];do
#MU suggested add the 'tail -n 1'...
ALIENFILE="`Xdialog --title "$MSG9" --stdout --no-buttons --fselect "/root/*" 0 0 | tail -n 1`"
if [ ! $? -eq 0 ];then
exit
fi
if [ -f $ALIENFILE ];then
break
fi
done
sync
cp -af $ALIENFILE /root/.packages/ #copy, leave original.
sync
cd /root/.packages
APKGNAME="`basename $ALIENFILE`"
#v2.13 test if enough space to expand tarball...
#EXPFREEK=`df -k | grep ' /$' | tr -s ' ' | cut -f 4 -d ' '`
EXPFREEB=`stat --filesystem --format=%f /` #no. free blocks.
EXPFILEB=`stat --format=%b $APKGNAME` #no. blocks.
EXPNEEDB=`expr $EXPFILEB \* 5` #bz2 can expand up to x3, need twice temp space.
if [ $EXPNEEDB -gt $EXPFREEB ];then
if [ ! "$DISABLEDX" = "yes" ];then
gxmessage -center -name "pet" -bg "#ff8080" -title "PETget: ERROR" "The $APKGNAME package has been downloaded to /root/.packages,
however there is not enough room to uncompress and install it.
The free space is $EXPFREEB blocks but it is estimated you will
need $EXPNEEDB blocks temporarily for the expansion and install.
Todd