[PC-BSD Commits] r7450 - pcbsd/current/SysInstaller
svn at pcbsd.org
svn at pcbsd.org
Thu Aug 26 14:12:40 PDT 2010
Author: kris
Date: 2010-08-26 14:12:40 -0700 (Thu, 26 Aug 2010)
New Revision: 7450
Modified:
pcbsd/current/SysInstaller/sys-pkgmgmt.cpp
pcbsd/current/SysInstaller/sysinstaller.cpp
pcbsd/current/SysInstaller/sysinstaller.h
Log:
Added final logic to package selection, now generates a working config for pc-sysinstall
and a summary for the user to confirm
Modified: pcbsd/current/SysInstaller/sys-pkgmgmt.cpp
===================================================================
--- pcbsd/current/SysInstaller/sys-pkgmgmt.cpp 2010-08-26 20:30:44 UTC (rev 7449)
+++ pcbsd/current/SysInstaller/sys-pkgmgmt.cpp 2010-08-26 21:12:40 UTC (rev 7450)
@@ -59,13 +59,6 @@
disconnect(treeWidgetDesktopPackages, SIGNAL(itemChanged(QTreeWidgetItem *, int)), 0, 0);
- /*
- if (aItem->checkState(0) == Qt::Checked)
- aItem->setCheckState(0, Qt::Unchecked);
- else
- aItem->setCheckState(0, Qt::Checked);
- */
-
if (aItem->childCount() == 0) {
if (aItem->checkState(0) == Qt::Checked && aItem->parent() )
if ( allChildrenPkgsChecked(aItem->parent()->text(0)))
@@ -143,3 +136,44 @@
++it;
}
}
+
+// Return the configuration for desktop packages
+QStringList SysInstaller::getDeskPkgCfg(QStringList &summaryList)
+{
+ QStringList cfgList;
+ QString cfgLine;
+
+ summaryList << "";
+ summaryList << "<b>" + tr("The following packages will be installed:") + "</b>";
+ summaryList << "base-system";
+
+ cfgLine="runExtCommand=sh /root/insMetaPkgs.sh base-system";
+
+ // For neatness sake, get the parents first
+ QTreeWidgetItemIterator it(treeWidgetDesktopPackages);
+ while (*it) {
+ if ( !(*it)->parent() && ( (*it)->checkState(0) == Qt::Checked || (*it)->checkState(0) == Qt::PartiallyChecked ) ) {
+ cfgLine+="," + (*it)->text(0);
+ summaryList << (*it)->text(0);
+ }
+ ++it;
+ }
+
+ // Now get the children
+ QTreeWidgetItemIterator itC(treeWidgetDesktopPackages);
+ while (*itC) {
+ if ((*itC)->parent() && ( (*itC)->checkState(0) == Qt::Checked || (*itC)->checkState(0) == Qt::PartiallyChecked ) ) {
+ cfgLine+="," + (*itC)->text(0);
+ summaryList << (*itC)->text(0);
+ }
+ ++itC;
+ }
+
+ if ( radioNetworkInstall->isChecked() )
+ cfgLine += " " + netURL;
+ else
+ cfgLine += " CD";
+
+ cfgList << cfgLine;
+ return cfgList;
+}
Modified: pcbsd/current/SysInstaller/sysinstaller.cpp
===================================================================
--- pcbsd/current/SysInstaller/sysinstaller.cpp 2010-08-26 20:30:44 UTC (rev 7449)
+++ pcbsd/current/SysInstaller/sysinstaller.cpp 2010-08-26 21:12:40 UTC (rev 7450)
@@ -558,7 +558,13 @@
// Set if we are doing an upgrade of PC-BSD or FreeBSD
if ( radioInstallPCBSD->isChecked() ) {
tmpList << "installType=PCBSD";
- tmpList << "packageType=uzip";
+
+ // If installing from a package disk, use tar if from live disk then uzip
+ if (availPackageData)
+ tmpList << "packageType=tar";
+ else
+ tmpList << "packageType=uzip";
+
tmpList << "runCommand=cp /usr/local/share/xorg-gui/conf/ttys.xsetup /etc/ttys";
tmpList << "runExtCommand=cp /etc/X11/xorg.conf ${FSMNT}/usr/local/share/xorg-gui/conf/xorg.conf.basic";
summaryList << tr("Performing a system upgrade of PC-BSD on:") + " /dev/" + upDrive;
@@ -572,7 +578,13 @@
tmpList << "installMode=fresh";
if ( radioInstallPCBSD->isChecked() ) {
tmpList << "installType=PCBSD";
- tmpList << "packageType=uzip";
+
+ // If installing from a package disk, use tar if from live disk then uzip
+ if (availPackageData)
+ tmpList << "packageType=tar";
+ else
+ tmpList << "packageType=uzip";
+
tmpList << "";
tmpList << "# Doing PC-BSD Install make sure to start xorg-gui at first boot";
tmpList << "runCommand=cp /usr/local/share/xorg-gui/conf/ttys.xsetup /etc/ttys";
@@ -699,6 +711,10 @@
if ( ! radioUpgrade->isChecked() && ! radioRestore->isChecked() )
cfgList+=getUsersCfgSettings(summaryList);
+ // If doing install from package disk
+ if ( availPackageData )
+ cfgList+=getDeskPkgCfg(summaryList);
+
textEditSummary->clear();
// Now write out the cfgList to file
Modified: pcbsd/current/SysInstaller/sysinstaller.h
===================================================================
--- pcbsd/current/SysInstaller/sysinstaller.h 2010-08-26 20:30:44 UTC (rev 7449)
+++ pcbsd/current/SysInstaller/sysinstaller.h 2010-08-26 21:12:40 UTC (rev 7450)
@@ -152,6 +152,7 @@
QStringList getDiskCfgSettings(QStringList &summaryList);
QStringList getComponentCfgSettings(QStringList &summaryList);
QStringList getUsersCfgSettings(QStringList &summaryList);
+ QStringList getDeskPkgCfg(QStringList &summaryList);
void startConfigGen(); // Function which takes pieces of cfg, and assembles
More information about the Commits
mailing list