Author: mzugec Date: Fri Aug 22 14:39:45 2008 New Revision: 50334 URL: http://svn.opensuse.org/viewcvs/yast?rev=50334&view=rev Log: fixed spec file module works with patched /sbin/supportconfig Modified: branches/tmp/mzugec/supportconfig/VERSION branches/tmp/mzugec/supportconfig/package/yast2-supportconfig.changes branches/tmp/mzugec/supportconfig/src/Supportconfig.ycp branches/tmp/mzugec/supportconfig/src/dialogs.ycp Modified: branches/tmp/mzugec/supportconfig/VERSION URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/VERSION?rev=50334&r1=50333&r2=50334&view=diff ============================================================================== --- branches/tmp/mzugec/supportconfig/VERSION (original) +++ branches/tmp/mzugec/supportconfig/VERSION Fri Aug 22 14:39:45 2008 @@ -1 +1 @@ -2.15.0 +2.17.0 Modified: branches/tmp/mzugec/supportconfig/package/yast2-supportconfig.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/package/yast2-supportconfig.changes?rev=50334&r1=50333&r2=50334&view=diff ============================================================================== --- branches/tmp/mzugec/supportconfig/package/yast2-supportconfig.changes (original) +++ branches/tmp/mzugec/supportconfig/package/yast2-supportconfig.changes Fri Aug 22 14:39:45 2008 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Fri Aug 22 14:37:34 CEST 2008 - mzugec@suse.cz + +- fixed spec file +- works with patched /sbin/supportconfig +- 2.17.0 + +------------------------------------------------------------------- Tue Aug 12 19:56:47 2008 - mzugec@novell.com - initial version Modified: branches/tmp/mzugec/supportconfig/src/Supportconfig.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/src/Supportconfig.ycp?rev=50334&r1=50333&r2=50334&view=diff ============================================================================== --- branches/tmp/mzugec/supportconfig/src/Supportconfig.ycp (original) +++ branches/tmp/mzugec/supportconfig/src/Supportconfig.ycp Fri Aug 22 14:39:45 2008 @@ -140,6 +140,22 @@ global string novell_number=""; global string proposed_log_path="/tmp/onstar"; +global string created_directory=""; + +global string GetParameterList(){ + string parameters=""; + if(use_defaults) parameters=sformat("%1 %2", parameters, "-D"); + if(full_listening) parameters=sformat("%1 %2", parameters, "-L"); + if(exclude_disk_scan) parameters=sformat("%1 %2", parameters, "-d"); + if(search_for_edir) parameters=sformat("%1 %2", parameters, "-e"); + if(full_logging) parameters=sformat("%1 %2", parameters, "-A"); + if(minimal_logs) parameters=sformat("%1 %2", parameters, "-m"); + if(include_slp) parameters=sformat("%1 %2", parameters, "-s"); + if(rpm_check) parameters=sformat("%1 %2", parameters, "-v"); + if( size(novell_number)>0 ) parameters=sformat("%1 %2 %3", parameters, "-r", novell_number); + y2milestone("Create parameter list : %1", parameters); + return parameters; +} // Settings: Define all variables needed for configuration of supportconfig // TODO FIXME: Define all the variables necessary to hold Modified: branches/tmp/mzugec/supportconfig/src/dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mzugec/supportconfig/src/dialogs.ycp?rev=50334&r1=50333&r2=50334&view=diff ============================================================================== --- branches/tmp/mzugec/supportconfig/src/dialogs.ycp (original) +++ branches/tmp/mzugec/supportconfig/src/dialogs.ycp Fri Aug 22 14:39:45 2008 @@ -261,12 +261,26 @@ return ret; } +/** + * + */ any FilesDialog(){ string caption = _("OnStar Included Files Configuration (3/3)"); - term contents = `VBox(`PushButton(`id(`start_supportconfig), _("Trigger to collect logs"))); + term contents = `VBox( + `HBox( + `PushButton(`id(`start_supportconfig), _("Trigger to collect logs")), + `InputField(`id(`directory_path), `opt(`disabled), _("Path to log directory")) + ), + `SelectionBox(`id(`file_list), `opt(`disabled), _("Log Files"), []), + `HBox( + `PushButton(`id(`delete_file), `opt(`disabled), _("Delete Selected File")), + `PushButton(`id(`show_file), `opt(`disabled), _("Show Selected File")) + )); + Wizard::SetContentsButtons(caption, contents, HELPS["c2"]:"", Label::BackButton(), Label::NextButton()); any ret = nil; + string full_log_path=""; while(true) { ret = UI::UserInput(); @@ -277,22 +291,16 @@ else continue; } else if(ret == `next || ret == `back) { + y2milestone("Creating output tarball"); + string command = sformat("supportconfig %1 -i %2", Supportconfig::GetParameterList(), Supportconfig::proposed_log_path); + break; } else if(ret==`start_supportconfig){ y2internal("button pressed"); - string parameters=""; - if(Supportconfig::use_defaults) parameters=sformat("%1 %2", parameters, "-D"); - if(Supportconfig::full_listening) parameters=sformat("%1 %2", parameters, "-L"); - if(Supportconfig::exclude_disk_scan) parameters=sformat("%1 %2", parameters, "-d"); - if(Supportconfig::search_for_edir) parameters=sformat("%1 %2", parameters, "-e"); - if(Supportconfig::full_logging) parameters=sformat("%1 %2", parameters, "-A"); - if(Supportconfig::minimal_logs) parameters=sformat("%1 %2", parameters, "-m"); - if(Supportconfig::include_slp) parameters=sformat("%1 %2", parameters, "-s"); - if(Supportconfig::rpm_check) parameters=sformat("%1 %2", parameters, "-v"); - if(size(Supportconfig::novell_number)>0) parameters=sformat("%1 %2 %3", parameters, "-r", Supportconfig::novell_number); - string command = sformat("supportconfig %1 -o %2", parameters, Supportconfig::proposed_log_path); + string command = sformat("supportconfig %1 -o %2", Supportconfig::GetParameterList(), Supportconfig::proposed_log_path); +/* y2internal("command %1", command); map output=(map)SCR::Execute(.target.bash_output, command); y2internal("output %1", output); @@ -302,23 +310,64 @@ break; } y2internal("output %1", output); - output = (map)SCR::Execute(.target.bash_output, sformat("ls -t %1|head -n1", Supportconfig::proposed_log_path)); +*/ + +map output=$[]; +Supportconfig::proposed_log_path="/tmp/onstar/"; + + output = (map)SCR::Execute(.target.bash_output, sformat("ls -t %1|head -n1|tr -d '\n'", Supportconfig::proposed_log_path)); y2internal("output %1", output); if (output["exit"]:-1!=0){ Popup::Error(output["stderr"]:""); ret=`back; break; } + Supportconfig::created_directory=output["stdout"]:""; + full_log_path=sformat("%1/%2", Supportconfig::proposed_log_path, Supportconfig::created_directory); + output = (map)SCR::Execute(.target.bash_output, sformat("ls %1", full_log_path)); + if (output["exit"]:-1!=0){ + Popup::Error(output["stderr"]:""); + ret=`back; + break; + } + UI::ChangeWidget(`file_list, `Items, filter(string s, splitstring(output["stdout"]:"", "\n"), {return (size(s)>0);})); + UI::ChangeWidget(`directory_path, `Value, full_log_path); + UI::ChangeWidget(`file_list, `Enabled, true); + UI::ChangeWidget(`show_file, `Enabled, true); + UI::ChangeWidget(`delete_file, `Enabled, true); continue; } + else if (ret==`show_file){ + string selected_item = (string)UI::QueryWidget(`file_list, `CurrentItem); + + UI::OpenDialog( `opt(`defaultsize), + `VBox( + `RichText( `id(`rt), ""), + `HBox(`PushButton(`id(`close), Label::CloseButton())) + ) + ); + string command=sformat("cat %1/%2", full_log_path, selected_item); + y2internal("command %1", command); + map output=(map)SCR::Execute(.target.bash_output, command); + UI::ChangeWidget(`rt, `Value, output["stdout"]:""); + UI::UserInput(); + UI::CloseDialog(); + } + else if (ret==`delete_file){ + string selected_item = (string)UI::QueryWidget(`file_list, `CurrentItem); + if (Popup::ContinueCancel(sformat(_("Really delete %1 file?"), selected_item))){ + if((integer)SCR::Execute(.target.bash, sformat("rm %1/%2", full_log_path, selected_item))==0){ + map output = (map)SCR::Execute(.target.bash_output, sformat("ls %1", full_log_path)); + UI::ChangeWidget(`file_list, `Items, filter(string s, splitstring(output["stdout"]:"", "\n"), {return (size(s)>0);})); + } + } + } else { y2error("unexpected retcode: %1", ret); continue; } } - return ret; - } /* EOF */ -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org