[yast-commit] r40734 - in /trunk/squid/src: Makefile.am Squid.ycp complex.ycp squid.rnc squid_auto.ycp store_del.ycp
Author: dfiser Date: Mon Sep 3 17:08:05 2007 New Revision: 40734 URL: http://svn.opensuse.org/viewcvs/yast?rev=40734&view=rev Log: Added .rnc schema file (bug #304267) - needs verification by Uwe Gansert. Removed some checks of local system if module is running in autoyast (bug #304264). In autoyast Squid module is filled by default values instead of be empty (bug #304264 too). Added: trunk/squid/src/squid.rnc Modified: trunk/squid/src/Makefile.am trunk/squid/src/Squid.ycp trunk/squid/src/complex.ycp trunk/squid/src/squid_auto.ycp trunk/squid/src/store_del.ycp Modified: trunk/squid/src/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/trunk/squid/src/Makefile.am?rev=40734&r1=40733&r2=40734&view=diff ============================================================================== --- trunk/squid/src/Makefile.am (original) +++ trunk/squid/src/Makefile.am Mon Sep 3 17:08:05 2007 @@ -1,6 +1,7 @@ # Makefile.am for squid/src yncludedir = @yncludedir@/squid +rncdir = $(schemadir)/autoyast/rnc client_DATA = \ squid.ycp \ @@ -26,11 +27,13 @@ SquidACL.ycp \ SquidErrorMessages.ycp +rnc_DATA = squid.rnc + # create a symlink for local build, #145327 squid: ln -sf . $@ ycpchook = squid -EXTRA_DIST = $(client_DATA) $(ynclude_DATA) $(module_DATA) $(desktop_DATA) +EXTRA_DIST = $(client_DATA) $(ynclude_DATA) $(module_DATA) $(desktop_DATA) $(rnc_DATA) include $(top_srcdir)/Makefile.am.common Modified: trunk/squid/src/Squid.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/squid/src/Squid.ycp?rev=40734&r1=40733&r2=40734&view=diff ============================================================================== --- trunk/squid/src/Squid.ycp (original) +++ trunk/squid/src/Squid.ycp Mon Sep 3 17:08:05 2007 @@ -57,7 +57,7 @@ /** * Is service enabled? */ -boolean service_enabled = false; +boolean service_enabled_on_startup = false; /** @@ -337,6 +337,7 @@ "regexp":"." ] ]; settings = parameters; + service_enabled_on_startup = false; } @@ -375,12 +376,12 @@ /******* SERVICE *******/ global boolean IsServiceEnabled() { - return service_enabled; + return service_enabled_on_startup; } global void SetServiceEnabled(boolean enabled) { - service_enabled = enabled; + service_enabled_on_startup = enabled; } /******* SERVICE END **/ @@ -973,7 +974,7 @@ boolean readServiceStatus() { - service_enabled = Service::Enabled("squid"); + service_enabled_on_startup = Service::Enabled("squid"); return true; } @@ -1037,7 +1038,7 @@ y2debug("Squid::Read - acls: %1", acls); y2debug("Squid::Read - refresh_patterns: %1", refresh_patterns); y2debug("Squid::Read - settings: %1", settings); - y2debug("Squid::Read - enabled: %1", service_enabled); + y2debug("Squid::Read - enabled: %1", service_enabled_on_startup); y2milestone("================ Setting END =================="); /* Error message */ @@ -1317,8 +1318,8 @@ } //enabling / disabling service - if (service_enabled == true) EnableService(); - if (service_enabled == false) DisableService(); + if (service_enabled_on_startup == true) EnableService(); + if (service_enabled_on_startup == false) DisableService(); // start Service if(Abort()) return false; @@ -1347,7 +1348,7 @@ * @return boolean True on success */ global boolean Import (map sett) { - if (sett == $[]){ + if (sett == $[] || sett == nil){ SetDefaultValues(); SetModified(); return true; @@ -1356,7 +1357,8 @@ !haskey(sett, "acls") || !haskey(sett, "http_accesses") || !haskey(sett, "refresh_patterns") || - !haskey(sett, "settings")){ + !haskey(sett, "settings") || + !haskey(sett, "service_enabled_on_startup")){ return false; } @@ -1366,6 +1368,7 @@ http_accesses = (list<map<string,any> >)sett["http_accesses"]:[]; refresh_patterns = (list<map<string,any> >)sett["refresh_patterns"]:[]; settings = (map<string,any>)sett["settings"]:$[]; + service_enabled_on_startup = (boolean)sett["service_enabled_on_startup"]:false; SetModified(); return true; @@ -1381,7 +1384,8 @@ "acls" : acls, "http_accesses" : http_accesses, "refresh_patterns" : refresh_patterns, - "settings" : settings ]; + "settings" : settings, + "service_enabled_on_startup" : service_enabled_on_startup ]; } /** Modified: trunk/squid/src/complex.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/squid/src/complex.ycp?rev=40734&r1=40733&r2=40734&view=diff ============================================================================== --- trunk/squid/src/complex.ycp (original) +++ trunk/squid/src/complex.ycp Mon Sep 3 17:08:05 2007 @@ -37,6 +37,7 @@ import "CWMServiceStart"; import "PackageSystem"; import "Squid"; +import "Mode"; include "squid/helps.ycp"; include "squid/dialogs.ycp"; @@ -108,7 +109,7 @@ "start_now_button" : _("&Start Squid Now"), "stop_now_button" : _("S&top Squid Now"), "save_now_action" : SaveAndRestart, - "save_now_button" : _("Sa&ve Settings and Restart Firewall Now"), + "save_now_button" : _("Sa&ve Settings and Restart Squid Now"), //"start_now_action" : uses the default function //"stop_now_action" : uses the default function "help" : sformat (CWMServiceStart::StartStopHelpTemplate (true), @@ -197,7 +198,7 @@ `HSpacing(3), `VBox( "auto_start", - "start_stop" + (Mode::normal() ? "start_stop" : `Empty()) ), `HSpacing(3) ), Added: trunk/squid/src/squid.rnc URL: http://svn.opensuse.org/viewcvs/yast/trunk/squid/src/squid.rnc?rev=40734&view=auto ============================================================================== --- trunk/squid/src/squid.rnc (added) +++ trunk/squid/src/squid.rnc Mon Sep 3 17:08:05 2007 @@ -0,0 +1,113 @@ +squid = element squid{ + element acls{ + LIST, + element listentry{ + element name{ text }? & + element options{ + LIST, + element option{ text }* + }? & + element type{ text }? + }* + }? & + element http_accesses{ + LIST, + element listentry{ + element acl{ + LIST, + element listentry{ text }* + }? & + element allow{ BOOLEAN }? + }* + }? & + element http_ports{ + LIST, + element listentry{ + element host{ text }? & + element port{ text }? & + element transparent{ BOOLEAN }? + }* + }? & + element refresh_patterns{ + LIST, + element listentry{ + element case_sensitive{ BOOLEAN }? & + element max{ text }? & + element min{ text }? & + element percent{ text }? & + element regexp{ text }? + }* + }? & + element settings{ + LIST, + element access_log{ + LIST, + element listentry{ text }* + }? & + element cache_dir{ + LIST, + element listentry{ text }* + }? & + element cache_log{ + LIST, + element listentry{ text }* + }? & + element cache_mem{ + LIST, + element listentry{ text }* + }? & + element cache_mgr{ + LIST, + element listentry{ text }* + }? & + element cache_replacement_policy{ + LIST, + element listentry{ text }* + }? & + element cache_store_log{ + LIST, + element listentry{ text }* + }? & + element cache_swap_high{ + LIST, + element listentry{ text }* + }? & + element cache_swap_low{ + LIST, + element listentry{ text }* + }? & + element clien_lifetime{ + LIST, + element listentry{ text }* + }? & + element connect_timeout{ + LIST, + element listentry{ text }* + }? & + element emulate_httpd_log{ + LIST, + element listentry{ text }* + }? & + element error_directory{ + LIST, + element listentry{ text }* + }? & + element ftp_passive{ + LIST, + element listentry{ text }* + }? & + element maximum_object_size{ + LIST, + element listentry{ text }* + }? & + element memory_replacement_policy{ + LIST, + element listentry{ text }* + }? & + element minimum_object_size{ + LIST, + element listentry{ text }* + }? + }? & + element service_enabled_on_startup{ BOOLEAN }? +} Modified: trunk/squid/src/squid_auto.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/squid/src/squid_auto.ycp?rev=40734&r1=40733&r2=40734&view=diff ============================================================================== --- trunk/squid/src/squid_auto.ycp (original) +++ trunk/squid/src/squid_auto.ycp Mon Sep 3 17:08:05 2007 @@ -62,6 +62,9 @@ y2debug("func=%1", func); y2debug("param=%1", param); +if (!Squid::GetModified()) + Squid::SetDefaultValues(); + /* Create a summary*/ if(func == "Summary") { ret = select(Squid::Summary(), 0, ""); Modified: trunk/squid/src/store_del.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/squid/src/store_del.ycp?rev=40734&r1=40733&r2=40734&view=diff ============================================================================== --- trunk/squid/src/store_del.ycp (original) +++ trunk/squid/src/store_del.ycp Mon Sep 3 17:08:05 2007 @@ -36,6 +36,7 @@ import "FileUtils"; import "Popup"; import "FileUtils"; +import "Mode"; import "Squid"; import "SquidACL"; @@ -163,7 +164,7 @@ if (size(cache_dir) == 0){ ok = false; Report::Error(_("Cache directory must not be empty.")); - }else if (!FileUtils::CheckAndCreatePath(cache_dir)){ + }else if (Mode::normal() && !FileUtils::CheckAndCreatePath(cache_dir)){ ok = false; }else{ integer cache_mem = (integer)UI::QueryWidget(`id("cache_mem"), `Value) * @@ -415,15 +416,15 @@ ok = false; message = message + (size(message)>0 ? "\n" : "") + _("Cache Log must not be empty."); } - if (size(access_log) > 0 && !isCorrectPathnameOfLogFile(access_log)){ + if (size(access_log) > 0 && Mode::normal() && !isCorrectPathnameOfLogFile(access_log)){ ok = false; message = message + (size(message)>0 ? "\n" : "") + _("Incorrect pathname in Access Log field."); } - if (size(cache_log) > 0 && !isCorrectPathnameOfLogFile(cache_log)){ + if (size(cache_log) > 0 && Mode::normal() && !isCorrectPathnameOfLogFile(cache_log)){ ok = false; message = message + (size(message)>0 ? "\n" : "") + _("Incorrect pathname in Cache Log field."); } - if (size(cache_store_log) > 0 && !isCorrectPathnameOfLogFile(cache_store_log)){ + if (size(cache_store_log) > 0 && Mode::normal() && !isCorrectPathnameOfLogFile(cache_store_log)){ ok = false; message = message + (size(message)>0 ? "\n" : "") + _("Incorrect pathname in Cache Store Log field."); } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
dfiser@svn.opensuse.org