|
From: <cod...@go...> - 2008-07-31 17:50:18
|
Author: M0...@gm...
Date: Thu Jul 24 11:11:50 2008
New Revision: 70
Added:
branches/iVL/Order
Modified:
branches/iVL/FrmInstallSys.class
branches/iVL/MdlInstallSys.module
Log:
Implement function to install bulk packages perdefinition in SETUP.CONF
Modified: branches/iVL/FrmInstallSys.class
==============================================================================
--- branches/iVL/FrmInstallSys.class (original)
+++ branches/iVL/FrmInstallSys.class Thu Jul 24 11:11:50 2008
@@ -35,23 +35,28 @@
' ' ' ' ' ' ' ' ' IF sRes AND sRes <> 0 THEN
' ' ' ' ' ' ' ' ' RETURN ' exit... there was an error mounting
' ' ' ' ' ' ' ' ' END IF
- sRes = 0
- sRes = MdlInstallSys.WRITE_NEW_FSTAB()
- IF sRes AND sRes <> 0 THEN
- Message("Error writing fstab")
- RETURN
- END IF
- sRes = 0
- sRes = MdlInstallSys.INSTALL_BULK_PACKAGES()
+ 'sRes = 0
+ 'sRes = MdlInstallSys.WRITE_NEW_FSTAB()
+ ' IF sRes AND sRes <> 0 THEN
+ ' Message("Error writing fstab")
+ ' RETURN
+ ' END IF
+ 'sRes = 0
+ WAIT 3
+ IF ClsPkgSel.bCustom = TRUE THEN
+ ' DO THE CUSTOM INSTALL
+ ELSE
+ sRes = MdlInstallSys.PERFORM_FULL_INSTALL()
+ END IF
IF sRes AND sRes <> 0 THEN
Message("Error installing bulk packages")
RETURN
END IF
- sRes = 0
- sRes = MdlInstallSys.INSTALL_PACKAGES()
- IF sRes AND sRes <> 0 THEN
- RETURN
- END IF
+ ' sRes = 0
+ ' sRes = MdlInstallSys.INSTALL_PACKAGES()
+ ' IF sRes AND sRes <> 0 THEN
+ ' RETURN
+ ' END IF
' DONE WITH INSTALLATION. REBOOT THE SYSTEM.
Modified: branches/iVL/MdlInstallSys.module
==============================================================================
--- branches/iVL/MdlInstallSys.module (original)
+++ branches/iVL/MdlInstallSys.module Thu Jul 24 11:11:50 2008
@@ -181,11 +181,11 @@
IF Exist(ClsGlobal.sTargetMnt &/ "etc") = FALSE THEN
MKDIR ClsGlobal.sTargetMnt &/ "etc"
END IF
- TRY File.Save(ClsGlobal.sTargetMnt &/ "etc" &/ "fstab", SConv(sFstab))
- CATCH
- PRINT ERROR
+ File.Save(ClsGlobal.sTargetMnt &/ "etc" &/ "fstab", SConv(sFstab))
+ 'CATCH
+ 'PRINT ERROR
'.RETURN 1
-
+ RETURN 0
END
PUBLIC FUNCTION fS_oPTIONS(sType AS String) AS String
@@ -210,89 +210,101 @@
END
-PUBLIC FUNCTION INSTALL_BULK_PACKAGES() AS Integer
+
+PUBLIC SUB PERFORM_FULL_INSTALL() AS Integer
+
+ 'Will need to read SETUP.CONF to determine what to do here
+
+ DIM sFile AS String[]
+ DIM sEntry AS String[]
+ DIM sPak AS String
+ DIM sPakPath AS String
+ DIM sPakSize AS Variant
+ DIM sTargetSize AS Variant
+ DIM iTotalSize AS Integer
+ DIM iCurrSize AS Variant
+ DIM sPakDesc AS String
DIM i AS Integer
+ DIM ii AS Integer
+ DIM sLine AS String
+ DIM sBulkPath AS String
+ DIM sConfPath AS String
+ DIM sOptPkgPath AS String
+ DIM iVal AS Float
+ DIM sBasePath AS String = ClsGlobal.sSourceMnt &/ "veclinux"
+ ClsGlobal.sTargetMnt = "/home/moises/mnt/target"
+ sFile = Split(File.Load(Temp$("SETUP.CONF")), "\n")
+ FOR i = 0 TO sFile.count - 1
+ sLine = Trim(sFile[i])
+ IF Left(sLine, Len("BULK") + 1) LIKE "BULK" & "*[0-9]*" THEN
+ 'sLine = Right(sLine, Len(sLine) - InStr(sLine, "\'"))
+ 'sLine = Left(sLine, Len(sLine) - 1)
+ sPak = Right(sLine, Len(sLine) - InStr(sLine, "\'"))
+ sPak = Left(sPak, Len(sPak) - 1)
+ sEntry = Split(sPak, ":")
+ sPakPath = sEntry[0]
+ sPakSize = sEntry[1]
+ sPakDesc = sEntry[2]
+ 'PRINT sBasePath &/ sPakPath & " = " & sPakDesc & "
size= " & CStr(sPakSize)
+ ' figure out the sizing and the progrss meter
+ SHELL "export gsize=$(df| grep /dev/hda3) &&
echo $gsize | cut -f3 -d \' \'" TO sTargetSize
+ 'Message(CStr(sTargetSize))
+ iTotalSize = CInt(sTargetSize) + CInt(sPakSize)
+
+ 'RETURN
+ PRINT "Installing " & sPakPath & " Total size (KB) = "
& CStr(sPakSize)
+ hproc = SHELL "lzmadec <" & sBasePath &/ sPakPath & " |
tar -xp -C " & ClsGlobal.sTargetMnt
+ WAIT 1
+ IF hproc.State = Process.Running THEN
+ REPEAT
+ WAIT
+ ' get the actual size at each snap
+ SHELL "export tsize=$(df | grep /dev/hda3)
&& echo $tsize | cut -f3 -d \' \'" TO iCurrSize
+ iCurrSize = Trim(CStr(iCurrSize))
+ iVal = CInt(iTotalSize) / CInt(iCurrSize)
+ 'FrmInstallSys.pbInstallProg.Value =
(CInt(iCurrSize) / CInt(iTotalSize)) * 0.100
+ 'PRINT CStr(iCurrSize) & "/" &
CStr(iTotalSize) & " = " & iVal & "%"
+ PRINT CStr(iTotalSize) & "/" &
CStr(iCurrSize) & " = " & iVal & "%"
+
+ UNTIL
+ hproc.State = Process.Stopped
+ END IF
+ PRINT sPak & " is installed... "
+ 'PRINT "Needs to install " & sPak
+ END IF
+ NEXT
+
+
+END
+
+
+
+
+
+
+PUBLIC FUNCTION INSTALL_BULK_PACKAGES() AS Integer
+ DIM sPkg AS String
DIM sShell AS String
- DIM sPKG AS String
- DIM sDump AS String
- DIM sBulkList AS String
- DIM sType AS String
- DIM sList AS String[]
- DIM sBulk AS String
- DIM sBulkPath AS String = ClsGlobal.sSourceMnt &/ "veclinux" &/ "required"
-
- SHELL "ls -m " & sBulkPath TO sBulkList
- sList = Split(sBulkList, ",")
- FOR i = 0 TO sList.Count - 1
- sBulk = Trim(sList[i])
- sType = File.Ext(sBulkPath &/ sBulk)
- ' SELECT CASE sType
- ' CASE "tlz", "lzm", "lzma"
- sShell = "lzmadec " & sBulkPath &/ sBulk & " | tar
-xp -C " & ClsGlobal.sTargetMnt
- 'Message(sBulkPath &/ sBulk & " | tar -xp -C " & ClsGlobal.sTargetMnt)
-' END SELECT
- 'Message(sShell)
- 'Message(ClsGlobal.sSourceMnt &/ "veclinux" &/ "required"
&/ sBulk)
+ DIM hBulkInst AS Process
+ DIM sExt AS String
+ DIM sCMD AS String
+
+ ClsGlobal.sTargetMnt = "/home/moises/mnt/target"
+
+ PRINT "Installing bulk packages ... "
+ FOR EACH sPkg IN RDir(ClsGlobal.sSourceMnt &/ "veclinux" &/ "required")
+ sExt = Trim(File.Ext(ClsGlobal.sSourceMnt &/ "veclinux"
&/ "required" &/ sPkg))
+ SELECT CASE sExt
+ CASE "tlz", "lzm", "lzma"
+ sCMD = "lzmadec <" & ClsGlobal.sSourceMnt &/ "veclinux"
&/ "required" &/ sPkg & " | tar -xp -C " & ClsGlobal.sTargetMnt
+ END SELECT
+ PRINT "Installing " & sPkg
+ hBulkInst = SHELL sCMD WAIT
- 'Message("type = " & sType & " command = " & sShell)
- hproc = SHELL sShell FOR READ
- WAIT
- IF hproc.State = Process.Running THEN
- REPEAT
- WAIT
- PRINT "Installing " & sBulk
- UNTIL
- hproc.State = Process.Stopped
- END IF
- NEXT
-
-
- ' ' '
- ' ' '
- ' ' ' IF ClsPkgSel.bCustom = TRUE THEN
- ' ' ' ' need to get the list of packages selected by user
- ' ' ' ELSE
- ' ' ' ' do the optional bulks first
- ' ' '
- ' ' ' 'FOR EACH sPKG IN RDir(ClsGlobal.sSourceMnt
&/ "veclinux" &/ "optional")
- ' ' ' SELECT CASE File.Ext(sPkg)
- ' ' ' CASE "tlz", "lzm", "lzma"
- ' ' ' sShell = "lzmadec < " & ClsGlobal.sSourceMnt
&/ "veclinux" &/ "optional" &/ sPkg & " | tar -xp -C " & ClsGlobal.sTargetMnt
- ' ' '
- ' ' ' CASE "bz2", "tbz2", "tbz"
- ' ' ' sShell = "tar -xpjf " & ClsGlobal.sSourceMnt
&/ "veclinux" &/ "optional" &/ sPkg & " -C " & ClsGlobal.sTargetMnt
- ' ' ' END SELECT
- ' ' '
- ' ' ' 'FrmInstallSys.tlCurrPkg.Text = "Installing " & sPkg
- ' ' '
- ' ' ' 'hproc = SHELL sShell
- ' ' ' Message(sShell)
- ' ' ' RETURN 1
- ' ' ' ME.INSTALL_TO_HOST(sShell)
- ' ' '
- ' ' ' ' ' WAIT
- ' ' ' ' ' IF hproc.State = Process.Running THEN
- ' ' ' ' ' REPEAT
- ' ' ' ' ' ' IF hproc.State = Process.Running THEN
- ' ' ' ' ' FrmInstallSys.pbInstallProg.Value =
FrmInstallSys.pbInstallProg.Value + 0.00001
- ' ' ' ' ' WAIT
- ' ' ' ' ' ' END IF
- ' ' ' ' ' UNTIL hproc.State = Process.Stopped
- ' ' ' ' ' 'END IF
- ' ' ' ' '
- ' ' ' ' ' sDump = Trim(sDump)
- ' ' ' ' ' sErr = Trim(sErr)
- ' ' ' ' ' IF serr <> "" THEN
- ' ' ' ' ' Message("There has been an error
installing " & sPkg & gb.NewLine & "<b>Error:</b>" & gb.NewLine & serr)
- ' ' ' ' ' RETURN 1
- ' ' ' ' ' END IF
- ' ' ' ' ' 'Message(sPkg & " is installed")
- ' ' ' ' ' END IF
- ' ' ' NEXT
- ' ' ' 'RETURN
- ' ' '
- ' ' ' END IF
- ' ' '
+ NEXT
+
+
+
END
@@ -324,4 +336,4 @@
sErr = sErr & gb.NewLine & sErr
PRINT MSG
-END
\ No newline at end of file
+END
Added: branches/iVL/Order
==============================================================================
--- (empty file)
+++ branches/iVL/Order Thu Jul 24 11:11:50 2008
@@ -0,0 +1,7 @@
+(09:55:32 AM) uelsk8s: 1 ... $MNTPNT/veclinux/required veclinux.tlz,
then vlconfig.tlz
+(09:55:32 AM) uelsk8s: 2 $MNTPNT/veclinux/optional
+(09:55:32 AM) uelsk8s: 3 $mntpnt/packages/* (except required)
+(09:55:32 AM) uelsk8s: 4 $mntpint/packages/required
+(09:55:32 AM) uelsk8s: 5 $MNTPNT/veclinux/required/vlconfig2.tlz
+(09:55:57 AM) uelsk8s: because they are not listed in packages.txt for
the user to select from
+(09:56:13 AM) uelsk8s: they have to be installed or the install will break
\ No newline at end of file
|