umount improved

This commit is contained in:
Filippo Bedendo Bordon 2011-10-28 23:03:09 +02:00
parent fa54583f2c
commit cc2a450c89
2 changed files with 15 additions and 9 deletions

View File

@ -98,12 +98,12 @@ def apri_file():
global path_Boot, path_Iso, ext
if ext == "boot":
fileType = QtCore.QString("cpio *.cpio.gz")
nfileName = QtGui.QFileDialog.getOpenFileName(None, "Scegli il file di boot da usare nell'installazione", "/home/", "File .cpio.gz (*.cpio.gz)", fileType)
nfileName = QtGui.QFileDialog.getOpenFileName(None, "Scegli il file di boot da usare nell'installazione", "~", "File .cpio.gz (*.cpio.gz)", fileType)
path_Boot = nfileName
ui.t_file.setText(QtGui.QApplication.translate("Dialog", nfileName, None, QtGui.QApplication.UnicodeUTF8))
elif ext == "iso":
fileType = QtCore.QString("iso *.iso")
nfileName = QtGui.QFileDialog.getOpenFileName(None, "Scegli l'iso da usare nell'installazione", "/home/", "File .iso (*.iso)", fileType)
nfileName = QtGui.QFileDialog.getOpenFileName(None, "Scegli l'iso da usare nell'installazione", "~", "File .iso (*.iso)", fileType) #26/10 path_Boot -> "~"
path_Iso = nfileName
ui.t_file.setText(QtGui.QApplication.translate("Dialog", nfileName, None, QtGui.QApplication.UnicodeUTF8))

View File

@ -57,9 +57,10 @@ inst_copy_iso()
orig_size=$(stat -c %s $1)
cp "$1" ./ &
dest_size=0
sleep 2
while [ $orig_size -gt $dest_size ] ; do
dest_size=$(stat -c %s "./`basename $1`")
percentuale=$(((45 + 50 * $dest_size ) / $orig_size ))
dest_size=$(stat -c %s ./"`basename $1`")
percentuale=$((45 + ( 50 * $dest_size ) / $orig_size ))
pbar $percentuale
done
ln -fs `basename $1` ./openmamba-live.iso
@ -69,7 +70,15 @@ inst_copy_iso()
#7 Smonta la chiavetta
inst_dir_umount()
{
sudo umount ~/tmpmamba
# So it attend up to umount return without errors
while [ 1 ] ; do
sudo umount ${1}1
if [ $? != 1 ]; then
break
fi
done
echo "Done"
rmdir ~/tmpmamba
}
@ -110,7 +119,7 @@ if [ $1 == "start" ]; then
pbar 98
descrizione "Smonto la chiavetta"
inst_dir_umount
inst_dir_umount $2
pbar 100
@ -118,6 +127,3 @@ else
echo $1 "Parametri non validi"
fi