[yast-commit] r50390 - /branches/tmp/jsrain/config-history/src/ConfigHistory.ycp
Author: jsrain Date: Wed Aug 27 08:29:08 2008 New Revision: 50390 URL: http://svn.opensuse.org/viewcvs/yast?rev=50390&view=rev Log: enable/disable via sysconfig, several fixes Modified: branches/tmp/jsrain/config-history/src/ConfigHistory.ycp Modified: branches/tmp/jsrain/config-history/src/ConfigHistory.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jsrain/config-history/src/ConfigHistory.ycp?rev=50390&r1=50389&r2=50390&view=diff ============================================================================== --- branches/tmp/jsrain/config-history/src/ConfigHistory.ycp (original) +++ branches/tmp/jsrain/config-history/src/ConfigHistory.ycp Wed Aug 27 08:29:08 2008 @@ -58,7 +58,7 @@ /** * Always have whole subtree in SVN, not only files changed by YaST */ -boolean store_whole_subtree = false; +boolean store_whole_subtree = nil; /** * Count of nested transactions (module calling another module) @@ -76,13 +76,20 @@ */ boolean UseSvn() { if (use_svn == nil) { - // FIXME read from sysconfig - use_svn = true; + use_svn = (string)SCR::Read (.sysconfig.yast2.STORE_CONFIG_IN_SUBVERSION) == "yes"; y2milestone ("Using SVN for configuration files: %1", use_svn); } return use_svn; } +boolean Recursive() { + if (store_whole_subtree == nil) { + store_whole_subtree = (string)SCR::Read (.sysconfig.yast2.SUBVERSION_ADD_DIRS_RECURSIVE) == "yes"; + y2milestone ("Automatically store whole subtree: %1", store_whole_subtree); + } + return store_whole_subtree; +} + /** * Initialize a SVN repository for config files in /var/lib/YaST2 * @return boolean true on success, false otherwise @@ -95,6 +102,12 @@ y2error ("Failed to initialize SVN repository: %1", out["stderr"]:""); return false; } + out = (map)SCR::Execute (.target.bash_output, + sformat ("chown -R root:root %1; chmod -R g= %1; chmod -R o= %1", history_location)); + if (out["exit"]:-1 != 0) { + y2error ("Failed to set svn repo permissions: %1", out["stderr"]:""); + return false; + } y2milestone ("Repo initialized"); return true; } @@ -359,16 +372,16 @@ return false; } if (! CheckRepoLinked()) { - if (! InitDirectories(store_whole_subtree)) + if (! InitDirectories(Recursive())) return false; } - if (! UpdateCheckout()) { - return false; - } - if (store_whole_subtree) { + if (Recursive()) { CheckAllFilesOutOfVersionControl(); } RemoveDeletedFiles(); + if (! UpdateCheckout()) { + return false; + } if (! CheckUncommitedChanges()) return false; if (! CreateTimeStamp()) @@ -393,14 +406,14 @@ return true; } boolean success = true; - if (! UpdateCheckout()) { - success = false; - } - if (store_whole_subtree) + if (Recursive()) success = CheckAllFilesOutOfVersionControl(); else success = CheckChangedFilesOutOfVersionControl(); success = RemoveDeletedFiles() && success; + if (! UpdateCheckout()) { + success = false; + } success = DoCommit(module_name) && success; return true; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
jsrain@svn.opensuse.org