Author: ug
Date: Tue Sep 2 14:25:24 2008
New Revision: 50568
URL: http://svn.opensuse.org/viewcvs/yast?rev=50568&view=rev
Log:
remote_file implemented
Modified:
trunk/autoinstallation/doc/CreateProfileDetails.xml
trunk/autoinstallation/package/autoyast2.changes
trunk/autoinstallation/src/config/files.desktop
trunk/autoinstallation/src/modules/AutoinstFile.ycp
Modified: trunk/autoinstallation/doc/CreateProfileDetails.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/doc/CreateProfileDetails.xml?rev=50568&r1=50567&r2=50568&view=diff
==============================================================================
--- trunk/autoinstallation/doc/CreateProfileDetails.xml (original)
+++ trunk/autoinstallation/doc/CreateProfileDetails.xml Tue Sep 2 14:25:24 2008
@@ -2404,9 +2404,14 @@
<para>
This feature requires the autoyast2 package to be installed. If the package is
missing, AutoYaST will silently ignore the <emphasis>files</emphasis> section.
- Since openSUSE 11.0 and SLES11 AutoYaST will install the package on it's own if
+ Since openSUSE 11.1 and SLES11 AutoYaST will install the package on it's own if
it's missing.
</para>
+ <para>
+ Since openSUSE 11.1 and SLES11 you can specify a <emphasis>file_location</emphasis>
+ where the file should be retrieved from, like an HTTP server for example. That would
+ look like this <emphasis><file_location>http://my.server.site/issue</file_location></emphasis>
+ </para>
&example.files;
<para>
Modified: trunk/autoinstallation/package/autoyast2.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/package/autoyast2.changes?rev=50568&r1=50567&r2=50568&view=diff
==============================================================================
--- trunk/autoinstallation/package/autoyast2.changes (original)
+++ trunk/autoinstallation/package/autoyast2.changes Tue Sep 2 14:25:24 2008
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Tue Sep 2 14:23:45 CEST 2008 - ug@suse.de
+
+- to files section
+
+-------------------------------------------------------------------
Thu Aug 28 10:21:45 CEST 2008 - ug@suse.de
- arvin's multipath patch added
Modified: trunk/autoinstallation/src/config/files.desktop
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/config/files.desktop?rev=50568&r1=50567&r2=50568&view=diff
==============================================================================
--- trunk/autoinstallation/src/config/files.desktop (original)
+++ trunk/autoinstallation/src/config/files.desktop Tue Sep 2 14:25:24 2008
@@ -16,7 +16,7 @@
X-SuSE-YaST-SortKey=
X-SuSE-YaST-AutoInstDataType=list
X-SuSE-YaST-AutoInstSchema=files.rnc
-X-SuSE-YaST-AutoInstRequires=users
+X-SuSE-YaST-AutoInstRequires=users,lan
Icon=yast-files
Exec=
Modified: trunk/autoinstallation/src/modules/AutoinstFile.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/modules/AutoinstFile.ycp?rev=50568&r1=50567&r2=50568&view=diff
==============================================================================
--- trunk/autoinstallation/src/modules/AutoinstFile.ycp (original)
+++ trunk/autoinstallation/src/modules/AutoinstFile.ycp Tue Sep 2 14:25:24 2008
@@ -13,6 +13,7 @@
import "AutoinstConfig";
import "Summary";
+ include "autoinstall/io.ycp";
/* default value of settings modified */
global boolean modified = false;
@@ -93,10 +94,10 @@
foreach(map file, Files,
``{
+ string alternate_location = sformat("%1/%2", AutoinstConfig::files_dir, counter);
+ string alter_file = sformat("file_%1", counter);
if (file["file_contents"]:"" != "")
{
- string alternate_location = sformat("%1/%2", AutoinstConfig::files_dir, counter);
- string alter_file = sformat("file_%1", counter);
y2milestone("AutoInstall: Copying file %1", file["file_path"]:alternate_location );
list t = splitstring( file["file_path"]:alternate_location, "/");
integer pos = size(t) - 1;
@@ -104,56 +105,60 @@
// SCR::Write (.target.string, AutoInstall::var_dir + "/files" + t[pos]:alter_file, file["file_contents"]:"");
SCR::Write (.target.string, file["file_path"]:alternate_location , file["file_contents"]:"");
- if (file["file_permissions"]:"" != "")
+ } else if( file["file_location"]:"" != "" ) {
+ y2milestone("trying to get file from %1 storing in %2", file["file_location"]:"", file["file_path"]:alternate_location);
+ if (!GetURL(file["file_location"]:"", file["file_path"]:alternate_location ) ) {
+ y2error("file could not be retrieved");
+ } else {
+ y2milestone("file was retrieved");
+ }
+ }
+ if (file["file_permissions"]:"" != "") {
+ SCR::Execute (.target.bash, sformat("chmod %1 %2", file["file_permissions"]:"", file["file_path"]:alternate_location ));
+ }
+ if (file["file_owner"]:"" != "") {
+ SCR::Execute (.target.bash, sformat("chown %1 %2", file["file_owner"]:"", file["file_path"]:alternate_location ));
+ }
+ map script = file["file_script"]:$[];
+ if (script != $[])
+ {
+ string current_logdir = AutoinstConfig::logs_dir;
+ list name_tok = splitstring(file["file_path"]:alternate_location, "/");
+ string scriptName = "";
+ if (size(name_tok)>0)
{
- SCR::Execute (.target.bash, sformat("chmod %1 %2", file["file_permissions"]:"", file["file_path"]:alternate_location ));
+ string name = name_tok[size(name_tok) - 1 ]:"";
+ scriptName = "script_" + name;
}
- if (file["file_owner"]:"" != "")
+ string scriptPath = sformat("%1/%2", AutoinstConfig::scripts_dir, scriptName);
+ y2milestone("Writing (file) script into %1", scriptPath);
+ SCR::Write(.target.string, scriptPath, script["source"]:"echo Empty script!");
+ // string message = sformat(_("Executing user supplied script: %1"), scriptName);
+
+ string scriptInterpreter = script["interpreter"]:"shell";
+ string executionString = "";
+ if (scriptInterpreter == "shell")
{
- SCR::Execute (.target.bash, sformat("chown %1 %2", file["file_owner"]:"", file["file_path"]:alternate_location ));
+ executionString = sformat("/bin/sh -x %1 2&> %2/%3.log", scriptPath, current_logdir, scriptName);
+ SCR::Execute (.target.bash, executionString);
}
-
- map script = file["file_script"]:$[];
- if (script != $[])
+ else if (scriptInterpreter == "perl")
+ {
+ executionString = sformat("/usr/bin/perl %1 2&> %2/%3.log", scriptPath, current_logdir, scriptName);
+ SCR::Execute (.target.bash,executionString);
+ }
+ else if (scriptInterpreter == "python")
+ {
+ executionString = sformat("/usr/bin/python %1 2&> %2/%3.log", scriptPath, current_logdir, scriptName);
+ SCR::Execute (.target.bash,executionString);
+ }
+ else
{
- string current_logdir = AutoinstConfig::logs_dir;
- list name_tok = splitstring(file["file_path"]:alternate_location, "/");
- string scriptName = "";
- if (size(name_tok)>0)
- {
- string name = name_tok[size(name_tok) - 1 ]:"";
- scriptName = "script_" + name;
- }
- string scriptPath = sformat("%1/%2", AutoinstConfig::scripts_dir, scriptName);
- y2milestone("Writing (file) script into %1", scriptPath);
- SCR::Write(.target.string, scriptPath, script["source"]:"echo Empty script!");
- // string message = sformat(_("Executing user supplied script: %1"), scriptName);
-
- string scriptInterpreter = script["interpreter"]:"shell";
- string executionString = "";
- if (scriptInterpreter == "shell")
- {
- executionString = sformat("/bin/sh -x %1 2&> %2/%3.log", scriptPath, current_logdir, scriptName);
- SCR::Execute (.target.bash, executionString);
- }
- else if (scriptInterpreter == "perl")
- {
- executionString = sformat("/usr/bin/perl %1 2&> %2/%3.log", scriptPath, current_logdir, scriptName);
- SCR::Execute (.target.bash,executionString);
- }
- else if (scriptInterpreter == "python")
- {
- executionString = sformat("/usr/bin/python %1 2&> %2/%3.log", scriptPath, current_logdir, scriptName);
- SCR::Execute (.target.bash,executionString);
- }
- else
- {
- y2error("Unknown interpreter: %1", scriptInterpreter);
- }
- y2milestone("Script Execution command: %1", executionString );
+ y2error("Unknown interpreter: %1", scriptInterpreter);
}
- success = ( SCR::Execute (.target.bash, sformat("cp %1 %2", file["file_path"]:alternate_location, AutoinstConfig::files_dir)) == 0 );
+ y2milestone("Script Execution command: %1", executionString );
}
+ success = ( SCR::Execute (.target.bash, sformat("cp %1 %2", file["file_path"]:alternate_location, AutoinstConfig::files_dir)) == 0 );
counter = counter + 1;
});
return success;;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org