|
From: <cod...@go...> - 2008-10-02 18:01:37
|
Author: M0...@gm...
Date: Thu Oct 2 11:00:49 2008
New Revision: 207
Modified:
branches/iVL/.project
branches/iVL/MdlInstallCustom.module
branches/iVL/MdlInstallSys.module
branches/iVL/installer.gambas
Log:
Attemp to deal with the out of memmory error
Modified: branches/iVL/.project
==============================================================================
--- branches/iVL/.project (original)
+++ branches/iVL/.project Thu Oct 2 11:00:49 2008
@@ -2,7 +2,7 @@
# Compiled with Gambas 2.9.0
Title=VectorLinux Installer
Startup=MdlCore
-Version=0.0.100
+Version=0.0.101
Library=gb.gtk
Library=gb.form
Library=gb.debug
Modified: branches/iVL/MdlInstallCustom.module
==============================================================================
--- branches/iVL/MdlInstallCustom.module (original)
+++ branches/iVL/MdlInstallCustom.module Thu Oct 2 11:00:49 2008
@@ -136,14 +136,18 @@
sKernelPath = ClsGlobal.sSourceMnt &/ "isolinux" &/ "kernel" &/ sLabel
IF Exist(sKernelPath) THEN
sDump = ""
+ SHELL "echo \"\" > /tmp/installdump" WAIT
sErr = ""
- hproc = SHELL "cp " & sKernelPath & Space(1) & ClsGlobal.sTargetMnt
&/ "boot" &/ "vmlinuz-" & sKernName FOR READ
+ hproc = SHELL "cp " & sKernelPath & Space(1) & ClsGlobal.sTargetMnt
&/ "boot" &/ "vmlinuz-" & sKernName & " 2> /tmp/installdump" 'FOR READ
WAIT 3
- IF InStr(sDump, "FAILED") > 0 THEN
- RETURN 1
- ELSE
- RETURN 0
- END IF
+ IF hproc.State = Process.Stopped THEN
+ sDump = File.Load("/tmp/installdump")
+ IF InStr(sDump, "FAILED") > 0 THEN
+ RETURN 1
+ ELSE
+ RETURN 0
+ END IF
+ END IF
END IF
'SHELL "cp " & ClsGlobal.sSourceMnt &/ "isolinux" &/ "kernel" &/
NEXT
@@ -370,24 +374,27 @@
SHELL "cat " & ClsGlobal.sSourceMnt &/ "veclinux" &/ "SETUP.CONF |
grep " & File.Name(sBulkPath) & " | cut -f 2 -d :" TO vSize
SHELL "cat " & ClsGlobal.sSourceMnt &/ "veclinux" &/ "SETUP.CONF |
grep " & File.Name(sBulkPath) & " | cut -f 3 -d :" TO sDesc
- IF Right(sDesc) = "\'" THEN
- sDesc = Left(sDesc, RInStr(sDesc, "\'") - 1)
- END IF
+ ' IF Right(sDesc) = "\'" THEN
+ ' sDesc = Left(sDesc, RInStr(sDesc, "\'") - 1)
+ ' END IF
+ sDesc = Replace(sDesc, "\'", "")
vSize = Trim(CStr(vSize))
sDump = ""
+ SHELL "echo \"\" > /tmp/installdump" WAIT
sErr = ""
IF vSize <> "" THEN
- SHELL "export gsize=$(df| grep " & ClsPartSel.sRoot & " ) && echo
$gsize | cut -f3 -d \' \'" TO vTargetSize
+ SHELL "export gsize=$(df| grep " & ClsGlobal.sTargetMnt & " ) && echo
$gsize | cut -f3 -d \' \'" TO vTargetSize
END IF
FrmInstallSys.pbInstallProg.Value = 0
INC iPkgNum
PRINT " Installing " & sBulkPath
- MdlSetup.SHOW_PROGRESS_CONTROLS()
+ MdlSetup.SHOW_PROGRESS_CONTROLS()
FrmInstallSys.tlCurrPkg.Text = "Installing " & File.Name(sBulkPath)
- hproc = SHELL "lzmadec <" & sBulkPath & " | tar -xp -C " &
ClsGlobal.sTargetMnt & " || echo \'FAILED\'" FOR READ
+ hproc = SHELL "lzmadec <" & sBulkPath & " | tar -xp -C " &
ClsGlobal.sTargetMnt & " || echo \'FAILED\' 2> /tmp/installdump" 'FOR READ
WAIT 1
IF hproc.State = Process.Running THEN
WAIT 1
+ 'sDump = File.Load("/tmp/installdump")
REPEAT
WAIT 1
' do the progress updating here
@@ -397,6 +404,7 @@
END IF
UNTIL
hproc.State = Process.Stopped
+ sDump = File.Load("/tmp/installdump")
IF InStr(sDump, "FAILED") > 0 THEN
RETURN 1
ELSE
@@ -411,7 +419,9 @@
DIM vSize AS Variant
DIM vTargetSize AS Variant
+
sDump = ""
+ SHELL "echo \"\" > /tmp/installdump" WAIT
sErr = ""
SHELL "cat " & ClsGlobal.sSourceMnt &/ "veclinux" &/ "SETUP.CONF |
grep " & File.Name(sPackagePath) & " | cut -f 2 -d :" TO vSize
@@ -425,7 +435,7 @@
FrmInstallSys.tlCurrPkg.Text = "Processing " & File.Name(sPackagePath)
'hproc = SHELL "install-pkg " & sPackagePath & Space(1) &
ClsGlobal.sTargetMnt & " || echo \'FAILED\'" FOR READ
IF Right(sPackagePath, 3) LIKE "t?z" THEN
- hproc = SHELL "installpkg " & sPackagePath & " -R " &
ClsGlobal.sTargetMnt & " || echo \'FAILED\'" FOR READ
+ hproc = SHELL "installpkg " & sPackagePath & " -R " &
ClsGlobal.sTargetMnt & " || echo \'FAILED\' 2> /tmp/installdump" 'FOR READ
ENDIF
WAIT 1
IF hproc.State = Process.Running THEN
@@ -438,6 +448,8 @@
UNTIL
hproc.state = Process.Stopped
' now do the error checking here and return a value
+ sDump = File.Load("/tmp/installdump")
+
IF InStr(sDump, "FAILED") > 0 THEN
'ERROR HAS OCCURRED
RETURN 1
@@ -451,13 +463,20 @@
END
-PUBLIC SUB Process_read()
-
- DIM sLine AS String
- READ #LAST, sLine, -256
- sDump = sDump & gb.NewLine & sLine
- PRINT sLine
-END
+' PUBLIC SUB Process_read()
+'
+' DIM sLine AS String
+' READ #LAST, sLine, -256
+' sDump = sDump & gb.NewLine & sLine
+' PRINT sLine
+' END
+' PUBLIC SUB Process_kill()
+'
+' DIM sDump AS String = File.Load("/tmp/installdump")
+' IF InStr(sDump, "FAILED") > 0 THEN
+' Message.Error("The install process has returned an error.")
+'
+' END
PUBLIC SUB process_error(msg AS String)
Modified: branches/iVL/MdlInstallSys.module
==============================================================================
--- branches/iVL/MdlInstallSys.module (original)
+++ branches/iVL/MdlInstallSys.module Thu Oct 2 11:00:49 2008
@@ -406,6 +406,7 @@
WAIT
FrmInstallSys.pbInstallProg2.Value =
MdlSetup.UPDATE_OVERALL_PROGRESS(iPkgCnt, iPkgNum)
NEXT
+ INC iPkgNum
'error check
IF InStr(sDump, "FAILED") > 0 THEN
PRINT sPkgName & " failed to install "
@@ -454,7 +455,7 @@
PRINT "installing " & sBulkPath
FrmInstallSys.tlCurrPkg.Text = ("Installing") & Space(1) &
sBulkDesc & " ..."
'ME.BULK_INSTALL(ClsGlobal.sSourceMnt &/ "veclinux" &/
sBulkPath)
- hproc = SHELL "lzmadec <" & ClsGlobal.sSourceMnt
&/ "veclinux" &/ sBulkPath & " | tar -xp -C " & ClsGlobal.sTargetMnt & " ||
echo \'FAILED\'" FOR READ
+ hproc = SHELL "lzmadec <" & ClsGlobal.sSourceMnt
&/ "veclinux" &/ sBulkPath & " | tar -xp -C " & ClsGlobal.sTargetMnt & " ||
echo \'FAILED\' 2> /tmp/installdump" 'FOR READ
PRINT sBulkPath
WAIT 1
IF hproc.State = Process.Running THEN
@@ -486,17 +487,31 @@
sDump = ""
sErr = ""
- hproc = SHELL "lzmadec <" & sPath_to_bulk & " | tar -xp -C " &
ClsGlobal.sTargetMnt & " || echo \'FAILED\'" FOR READ
+ hproc = SHELL "lzmadec <" & sPath_to_bulk & " | tar -xp -C " &
ClsGlobal.sTargetMnt & " || echo \'FAILED\' 2> /tmp/installdump" WAIT 'FOR
READ
+ WAIT
+ sDump = File.Load("/tmp/installdump")
+ IF InStr(sDump, "FAILED") > 0 THEN
+ Message.Error(("Error occurred while installing") & Space(1) &
sPath_to_bulk)
+ RETURN
+ END IF
+
END
PUBLIC SUB PACKAGE_INSTALL(sPath_To_Package AS String)
sDump = ""
+ SHELL "echo \"\" > /tmp/installdump" WAIT
sErr = ""
+ INC iPkgNum
'hproc = SHELL "install-pkg " & sPath_To_Package & Space(1) &
ClsGlobal.sTargetMnt & " || echo \'FAILED\'" FOR READ
IF Right(sPath_To_Package, 3) LIKE "t?z" THEN
- hproc = SHELL "installpkg " & sPath_To_Package & " -R " &
ClsGlobal.sTargetMnt & " || echo \'FAILED\'" FOR READ
+ hproc = SHELL "installpkg " & sPath_To_Package & " -R " &
ClsGlobal.sTargetMnt & " || echo \'FAILED\' 2> /tmp/installdump" WAIT 'FOR
READ
+ WAIT
+ sDump = File.Load("/tmp/installdump")
+ IF InStr(sDump, "FAILED") > 0 THEN
+ Message.Error(("Unable to install") & Space(1) &
sPath_To_Package)
+ END IF
ENDIF
END
@@ -569,7 +584,7 @@
sErr = ""
MdlCore.LOCK_GUI()
'inc iPkgNum
- hproc = SHELL "lzmadec <" & sBasePath &/ sPakPath & " | tar
-xp -C " & ClsGlobal.sTargetMnt & " || echo \'FAILED\'" FOR READ
+ hproc = SHELL "lzmadec <" & sBasePath &/ sPakPath & " | tar
-xp -C " & ClsGlobal.sTargetMnt & " || echo \'FAILED\' 2>
/tmp/installdump" 'FOR READ
WAIT 2
IF hproc.State = Process.Running THEN
@@ -579,6 +594,7 @@
UNTIL
hproc.State = Process.Stopped
' error check
+ sDump = File.Load("/tmp/installdump")
IF InStr(sDump, "FAILED") > 0 THEN
Message.Error(("There has been an error
extracting") & Space(1) & sPakDesc & gb.NewLine &
"<b>ERROR</b>" & gb.NewLine &
@@ -631,7 +647,7 @@
IF iVal > FrmInstallSys.pbInstallProg.Value THEN
FrmInstallSys.pbInstallProg.Value = iVal
END IF
- PRINT CStr(iCurrSize) & "/" & CStr(sTargetSize + sPakSize) & " = " &
iVal & "%"
+ 'PRINT CStr(iCurrSize) & "/" & CStr(sTargetSize + sPakSize) & " = " &
iVal & "%"
END
@@ -667,20 +683,23 @@
' install each package
SHELL "export gsize=$(df| grep " & ClsPartSel.sRoot & " )
&& echo $gsize | cut -f3 -d \' \'" TO sTargetSize
sTargetSize = Trim(CStr(sTargetSize))
-
+ SHELL "echo \"\" > /tmp/installdump" WAIT
sDump = ""
sErr = ""
'hproc = SHELL "install-pkg " & sTlzBasePath &/ sTlzPath &/
sTlzName & Space(1) & ClsGlobal.sTargetMnt & " || echo \'FAILED\'" FOR READ
- hproc = SHELL "installpkg " & sTlzBasePath &/ sTlzPath &/
sTlzName & " -R " & ClsGlobal.sTargetMnt & " || echo \'FAILED\'" FOR READ
+ hproc = SHELL "installpkg " & sTlzBasePath &/ sTlzPath &/
sTlzName & " -R " & ClsGlobal.sTargetMnt & " || echo \'FAILED\' 2>
/tmp/installdump" WAIT 'FOR READ
WAIT 1
IF hproc.State = Process.Running THEN
REPEAT
WAIT 1
UPDATE_STEP_PROGRESS(sTargetSize, iTlzSize)
+
' figure out the progress again
UNTIL
hproc.State = Process.Stopped
+ sDump = File.Load("/tmp/installdump")
+
IF InStr(sDump, "FAILED") > 0 THEN
ERROR
RETURN 1
@@ -717,13 +736,14 @@
DIM iTlzTotal AS Integer = 0
DIM iCurrTlz AS Integer '= 0
MdlCore.LOCK_GUI()
+ SHELL "echo \"\" > /tmp/installdump" WAIT
'sRawFile = DConv(File.Load(ClsGlobal.sSourceMnt &/ "packages"
&/ "PACKAGES.TXT"))
SHELL "ls " & ClsGlobal.sSourceMnt &/ "packages/required/*.t?z" TO
sRawFile
sFile = Split(sRawFile, "\n")
iTlzTotal = sFile.Count
FOR i = 0 TO sFile.count - 1
sLine = Trim(sFile[i])
- INC iPkgNum
+ 'INC iPkgNum
sTlzPath = Trim(sLine)
' now install the package with the information we already have
PRINT sTlzName & sTlzPath
@@ -736,7 +756,7 @@
'figure out the progress again
' for this one we will need to count the
packages, and base our progress on the number of packages
' installed vs the total number of packags
- iCurrTlz = i
+ 'iCurrTlz = i
'hproc = SHELL "install-pkg " & sTlzPath & Space(1) &
ClsGlobal.sTargetMnt & " || echo \'FAILED\'" FOR READ
ME.PACKAGE_INSTALL(sTlzPath)
@@ -754,7 +774,7 @@
NEXT
FrmInstallSys.pbInstallProg.Value = 1
WAIT 1
-
+ sDump = File.Load("/tmp/installdump")
IF InStr(sDump, "FAILED") > 0 THEN
PRINT "Error installing packages/required"
RETURN 1
@@ -772,7 +792,7 @@
DIM sCOnfLine AS String
DIM sPkgPath AS String
DIM i AS Integer
-
+ SHELL "echo \"\" > /tmp/installdump" WAIT
PRINT "Installing final system configuration"
SHELL "cat " & ClsGlobal.sSourceMnt &/ "veclinux" &/ "SETUP.CONF" & "
| grep ^CONF" TO sRawList
'Message.Info(sRawList)
@@ -796,6 +816,7 @@
hproc.State = Process.Stopped
END IF
' END IF
+ sDump = File.Load("/tmp/installdump")
IF InStr(sDump, "FAILED") > 0 THEN
RETURN 1
ELSE
@@ -804,13 +825,13 @@
END
-PUBLIC SUB Process_read()
-
- DIM sLine AS String
- READ #LAST, sLine, -256
- sDump = sDump & gb.NewLine & sLine
- PRINT sLine
-END
+' ' PUBLIC SUB Process_read()
+' '
+' ' DIM sLine AS String
+' ' READ #LAST, sLine, -256
+' ' sDump = sDump & gb.NewLine & sLine
+' ' PRINT sLine
+' ' END
PUBLIC SUB process_error(msg AS String)
Modified: branches/iVL/installer.gambas
==============================================================================
Binary files. No diff available.
|