Author: ug
Date: Wed Aug 27 13:29:31 2008
New Revision: 50406
URL: http://svn.opensuse.org/viewcvs/yast?rev=50406&view=rev
Log:
patch for ayast_setup applied. Thanx Bubli! :)
Modified:
trunk/autoinstallation/package/autoyast2.changes
trunk/autoinstallation/src/clients/ayast_setup.ycp
trunk/autoinstallation/src/modules/AutoinstConfig.ycp
trunk/autoinstallation/src/modules/Profile.ycp
Modified: trunk/autoinstallation/package/autoyast2.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/package/autoyast2.changes?rev=50406&r1=50405&r2=50406&view=diff
==============================================================================
--- trunk/autoinstallation/package/autoyast2.changes (original)
+++ trunk/autoinstallation/package/autoyast2.changes Wed Aug 27 13:29:31 2008
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Wed Aug 27 13:27:09 CEST 2008 - ug@suse.de
+
+- patch for ayast_setup applied. Thanx Bubli! :)
+
+-------------------------------------------------------------------
Tue Aug 26 15:50:36 CEST 2008 - ug@suse.de
- package automagic removed
Modified: trunk/autoinstallation/src/clients/ayast_setup.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/clients/ayast_setup.ycp?rev=50406&r1=50405&r2=50406&view=diff
==============================================================================
--- trunk/autoinstallation/src/clients/ayast_setup.ycp (original)
+++ trunk/autoinstallation/src/clients/ayast_setup.ycp Wed Aug 27 13:29:31 2008
@@ -24,6 +24,10 @@
{
textdomain "autoinst";
+
+ y2milestone("----------------------------------------");
+ y2milestone("ayast_setup started");
+
import "Profile";
import "Popup";
import "Wizard";
@@ -33,78 +37,78 @@
import "AutoInstall";
import "AutoinstSoftware";
- void openFile( map options ) {
+ symbol GUI() {
+ Mode::SetUI("commandline");
+ CommandLine::Error(_("Empty parameter list"));
+ return `dummy;
+ }
+
+ void Setup() {
+
+ AutoInstall::Save();
+ Wizard::CreateDialog();
+ Mode::SetMode("autoinstallation");
+ Stage::Set ("continue");
+ WFM::CallFunction("inst_autopost", []);
+ AutoinstSoftware::addPostPackages(Profile::current["software","post-packages"]:[]);
+
+ // the following is needed since 10.3
+ // otherwise the already configured network gets removed
+ if( !haskey(Profile::current, "networking") ) {
+ Profile::current = add( Profile::current, "networking", $[ "keep_install_network":true ] );
+ }
+
+ Pkg::TargetInit ("/", false);
+ WFM::CallFunction("inst_rpmcopy", []);
+ WFM::CallFunction("inst_autoconfigure", []);
+
+ }
+
+ boolean openFile( map options ) {
+ if ( options["filename"]:nil == nil ) {
+ CommandLine::Error(_("Path to autoyast profile must be set"));
+ return false;
+ }
+
if( !Profile::ReadXML( options["filename"]:"" ) ) {
- Popup::Error(_("Error while parsing the control file.
+ Mode::SetUI("commandline");
+ CommandLine::Print(_("Error while parsing the control file.
Check the log files for more details or fix the
control file and try again.
"));
+ return false;
}
+
+ Setup();
+ return true;
}
map cmdline = $[
- "id" : "ay-client",
- // translators: command line help text for Samba client module
- "help" : _("autoyast"),
+ "id" : "ayast_setup",
+ "help" : _("Client for autoyast configuration on the running system"),
+ "guihandler": GUI,
"actions" : $[
- "setup" : $[ "handler":openFile, "help":"jo" ]
+ "setup" : $[
+ "handler" : openFile,
+ "help" : _("Configure the system using given autoyast profile"),
+ "example" : "setup filename=/path/to/profile" ]
],
"options" : $[
"filename": $[
- "type":"string",
- "help":"no help"
+ "type" : "string",
+ "help" : _("Path to autoyast profile")
]
],
"mappings" : $[
- "setup" : ["filename"]
- ]
- ];
- if(!CommandLine::Init(cmdline, WFM::Args()))
- {
- y2error("Commandline init failed");
- return false;
- }
- // command line options
- /* Init variables */
- string command = "";
- list flags = [];
- map options = $[];
- string exit = "";
- list l = [];
-
- while(!CommandLine::Done())
- {
- map m = CommandLine::Command();
- command = m["command"]:"exit";
- options = m["options"]:$[];
-
- if( command == "setup" ) {
- openFile(options);
- } else {
- /* maybe we got "exit" or "quit" */
- if( !CommandLine::Done() ) {
- CommandLine::Print("Unknown command (should not happen)");
- continue;
- }
- }
- }
-
- AutoInstall::Save();
- Wizard::CreateDialog();
- Mode::SetMode("autoinstallation");
- Stage::Set ("continue");
- WFM::CallFunction("inst_autopost", []);
- AutoinstSoftware::addPostPackages(Profile::current["software","post-packages"]:[]);
-
- // the following is needed since 10.3
- // otherwise the already configured network gets removed
- if( !haskey(Profile::current, "networking") ) {
- Profile::current = add( Profile::current, "networking", $[ "keep_install_network":true ] );
- }
-
- Pkg::TargetInit ("/", false);
- WFM::CallFunction("inst_rpmcopy", []);
- WFM::CallFunction("inst_autoconfigure", []);
+ "setup" : ["filename"]
+ ]
+ ];
+
+ any ret = CommandLine::Run( cmdline );
+
+ y2debug("ret = %1", ret);
+ y2milestone("----------------------------------------");
+ y2milestone("ayast_setup finished");
}
Modified: trunk/autoinstallation/src/modules/AutoinstConfig.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/modules/AutoinstConfig.ycp?rev=50406&r1=50405&r2=50406&view=diff
==============================================================================
--- trunk/autoinstallation/src/modules/AutoinstConfig.ycp (original)
+++ trunk/autoinstallation/src/modules/AutoinstConfig.ycp Wed Aug 27 13:29:31 2008
@@ -353,10 +353,12 @@
Repository = "/var/lib/autoinstall/repository";
}
}
- else if (Mode::test () && Mode::normal ())
+ //This probably gets never executed and it only breaks the commandline iface
+ //by Mode::test() call which instantiates UI
+ /*else if (Mode::test () && Mode::normal ())
{
local_rules_file = (string)WFM::Args(1);
- }
+ }*/
return;
}
Modified: trunk/autoinstallation/src/modules/Profile.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/modules/Profile.ycp?rev=50406&r1=50405&r2=50406&view=diff
==============================================================================
--- trunk/autoinstallation/src/modules/Profile.ycp (original)
+++ trunk/autoinstallation/src/modules/Profile.ycp Wed Aug 27 13:29:31 2008
@@ -18,6 +18,7 @@
import "Popup";
import "ProductControl";
import "Directory";
+ import "FileUtils";
import "PackageSystem";
include "autoinstall/xml.ycp";
@@ -654,6 +655,9 @@
* @return boolean
*/
global define boolean ReadXML (string file) {
+ if ( !FileUtils::Exists( file ) )
+ return false;
+
string tmp = (string)SCR::Read (.target.string, file);
list<string> l = splitstring (tmp, "\n");
if( tmp != nil && l[0]:"" == "-----BEGIN PGP MESSAGE-----" ) {
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org