Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] BZR Change 16 to stage-root sorcery by root <root@dmlb2004>

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: bzr AT mail.sourcemage.org
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] BZR Change 16 to stage-root sorcery by root <root@dmlb2004>
  • Date: Wed, 12 Apr 2006 16:25:06 -0500

------------------------------------------------------------
revno: 16
committer: root <root@dmlb2004>
branch nick: stage-root
timestamp: Wed 2006-04-12 12:49:12 -0700
message:
more messing around with confmeld instead of pipe I'm going to have to use
a for loop and hopefully that will fix last_spell not being set

=== modified file 'usr/sbin/confmeld'
--- usr/sbin/confmeld
+++ usr/sbin/confmeld
@@ -61,6 +61,27 @@
}

#--------------------------------------------------------------------
+## parses the path to get specific information about the config file
+##
+## @param config file path
+## @param upvar for spell name
+## @param upvar for spell success time
+## @param upvar for actual path to file
+#--------------------------------------------------------------------
+function parse_stage_config_path()
+{
+ local file=$1
+ local __tmp __spell __sdate __path
+ __tmp=${file/$CONFIG_STAGE_DIRECTORY\//}
+ __spell=$(echo $__tmp | cut -d/ -f1)
+ __sdate=$(echo $__tmp | cut -d/ -f2)
+ __path=$(echo $__tmp | cut -d/ -f3-)
+ eval "$2=\"$__spell\""
+ eval "$3=\"$__sdate\""
+ eval "$4=\"$__path\""
+}
+
+#--------------------------------------------------------------------
## Main
##
## No real arguments get all the config files and start installing
@@ -68,20 +89,45 @@
#--------------------------------------------------------------------
function main()
{
- local target
+ local target spell sdate
+ local last_spell=""
+ local last_sdate=""
+
all_config_files |
while read file
do
- target=$(echo $file | sed
"s#^$CONFIG_STAGE_DIRECTORY/[[:alpha:]]*/[[:alnum:]]*##g")
+ echo $last_spell
+ parse_stage_config_path $file spell sdate target &&
if [[ -f $file && $target ]]
then
- install_config_file $file $target
+ message "${MESSAGE_COLOR}$spell cast on $sdate has
config${DEFAULT_COLOR}"
+ message "${MESSAGE_COLOR}$file to be merged with
/$target${DEFAULT_COLOR}"
+ tablet_set_spell $spell &&
+ # and we can't do this because it's reading stdin from the pipe so I
have
+ # to think of something else
+ install_config_file $file /$target
+ if [[ $last_sdate && $last_sdate != $sdate ]]
+ then
+ rm -vrf $CONFIG_STAGE_DIRECTORY/$last_spell/$last_sdate
+ fi
+ if [[ $last_spell && $last_spell != $spell ]]
+ then
+ rm -vrf $CONFIG_STAGE_DIRECTORY/$last_spell
+ fi
+ last_sdate="$sdate"
+ last_spell="$spell"
fi
done
+ # this isn't being set for some reason
+ if [[ $last_spell ]]
+ then
+ rm -vrf $CONFIG_STAGE_DIRECTORY/$last_spell
+ fi
}


. /etc/sorcery/config
+STAGED_INSTALL="off"
main "$@"

#---------------------------------------------------------------------




  • [SM-Commit] BZR Change 16 to stage-root sorcery by root <root@dmlb2004>, bzr, 04/12/2006

Archive powered by MHonArc 2.6.24.

Top of Page