Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (4bb75273851edfabe6ac5a09ccf72a71425d56e5)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jaka Kranjc <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (4bb75273851edfabe6ac5a09ccf72a71425d56e5)
  • Date: Mon, 4 Feb 2008 12:13:00 -0600

GIT changes to master sorcery by Jaka Kranjc <lynxlynxlynx AT sourcemage.org>:

ChangeLog | 3 +++
etc/sorcery/config | 2 ++
usr/sbin/confmeld | 29 +++++++++++++++++++++++++++++
var/lib/sorcery/modules/libresurrect | 2 +-
4 files changed, 35 insertions(+), 1 deletion(-)

New commits:
commit 4bb75273851edfabe6ac5a09ccf72a71425d56e5
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

config, libressurect: added a variable to hold the default answer for
the config merge query
* confmeld: added support for forcing merges, last part of #13618

diff --git a/ChangeLog b/ChangeLog
index 09a4a3f..8476964 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,9 @@
support passing spells or configs as arguments and only working on
them
* delve, libtablet: added 3 missing ;; - patch from Arvid Norlander
* *: comment fixes for bashdoc - modified patch from Arvid Norlander
+ * config, libressurect: added a variable to hold the default answer
for
+ the config merge query
+ * confmeld: added support for forcing merges, last part of #13618

2008-02-03 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libunpack: return 1 when no algorithm is allowed
diff --git a/etc/sorcery/config b/etc/sorcery/config
index 2fba48a..536136b 100755
--- a/etc/sorcery/config
+++ b/etc/sorcery/config
@@ -140,6 +140,8 @@ GRIMOIRE_MANIFEST_ALGORITHM=sha1

SOURCE_CACHE=${SOURCE_CACHE:=/var/spool/sorcery}

+DEFAULT_CHANGED_CONFIG_ACTION=${DEFAULT_CHANGED_CONFIG_ACTION:-2}
+
# SECURITY NOTE: any script running as root must pick a
# more secure location for temp files that is not accessable
# by other users and override this variable.
diff --git a/usr/sbin/confmeld b/usr/sbin/confmeld
index 9283294..da80256 100755
--- a/usr/sbin/confmeld
+++ b/usr/sbin/confmeld
@@ -24,6 +24,13 @@ Optional Parameters:
-c, --list-configs will just list all the staged configs
-s, --list-spells will just list all the spells with staged configs
-q, --no-column don't column the output
+-f, --force <action> always use do <action> when merging
+
+where <action> can be one of:
+discard-new do nothing
+discard-old trash the old config and install over it
+use-old leave the old config in its place and backup the new
one
+use-new backup the old config and install the new one in its
place

Optional arguments:
You can invoke confmeld with a spell name or a staged config as an argument.
@@ -152,6 +159,26 @@ function parse_stage_config_path()
}

#--------------------------------------------------------------------
+## Override the merging menu and always use a preset action
+##
+## @param action
+#--------------------------------------------------------------------
+function override_changed_config_menu()
+{
+
+ case $1 in
+ discard-new) DEFAULT_CHANGED_CONFIG_ACTION=3 ;;
+ discard-old) DEFAULT_CHANGED_CONFIG_ACTION=0 ;;
+ use-old) DEFAULT_CHANGED_CONFIG_ACTION=2 ;;
+ use-new) DEFAULT_CHANGED_CONFIG_ACTION=1 ;;
+ *) error_message "${PROBLEM_COLOR}Bad default merge
action!$DEFAULT_COLOR"
+ help ;;
+ esac
+ PROMPT_DELAY=0
+
+}
+
+#--------------------------------------------------------------------
## merge only the passed file
##
## @param config
@@ -270,6 +297,8 @@ function process_parameters()
--list-configs|-c) subroutine=list_staged_configs ;;
--list-spells|-s) subroutine=list_spells_with_staged_configs ;;
--list|-l) subroutine=list_all ;;
+ --force|-f) subroutine="override_changed_config_menu $2"
+ shift ;;
*) help ;;
esac
else
diff --git a/var/lib/sorcery/modules/libresurrect
b/var/lib/sorcery/modules/libresurrect
index 823d434..c854820 100755
--- a/var/lib/sorcery/modules/libresurrect
+++ b/var/lib/sorcery/modules/libresurrect
@@ -506,7 +506,7 @@ function real_handle_changed_config() {
local to=$2
local savetime=$3
local number
- local default=2 # TODO: this should come from a variable someday
+ local default=$DEFAULT_CHANGED_CONFIG_ACTION

local continue=yes
message "${MESSAGE_COLOR}Installing to $to, please choose an option:"



  • [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (4bb75273851edfabe6ac5a09ccf72a71425d56e5), Jaka Kranjc, 02/04/2008

Archive powered by MHonArc 2.6.24.

Top of Page