Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to devel-stage-root sorcery by David Brown (498a2ca1b7cd0c78663dfde81cf9ecab23fc0e8b)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: David Brown <scm AT mail.sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to devel-stage-root sorcery by David Brown (498a2ca1b7cd0c78663dfde81cf9ecab23fc0e8b)
  • Date: Sat, 10 Jun 2006 22:50:40 -0500

GIT changes to devel-stage-root sorcery by David Brown <dmlb2000 AT gmail.com>:

TODO | 19 ++---------
usr/sbin/confmeld | 5 ++
usr/sbin/delve | 36 +++++++--------------
var/lib/sorcery/modules/build_api/api1 | 2 -
var/lib/sorcery/modules/build_api/api2 | 56
+++++++++++++++++++++++++--------
var/lib/sorcery/modules/libstage | 8 ++--
6 files changed, 72 insertions(+), 54 deletions(-)

New commits:
commit 498a2ca1b7cd0c78663dfde81cf9ecab23fc0e8b
Author: David Brown <dmlb2000 AT gmail.com>
Commit: David Brown <dmlb2000 AT gmail.com>

updated TODO to reflect what's left

commit eb75b4f7676c24de5a13445b790aab8fdcfce057
Author: David Brown <dmlb2000 AT gmail.com>
Commit: David Brown <dmlb2000 AT gmail.com>

updated todo list

commit cd35f4ad4879b4239f0e80a1552303a6bbc42561
Author: David Brown <dmlb2000 AT gmail.com>
Commit: David Brown <dmlb2000 AT gmail.com>

removed tabs

commit 0bbe91ae1cc3082590b6ab595a8eef28c81d130e
Author: David Brown <dmlb2000 AT gmail.com>
Commit: David Brown <dmlb2000 AT gmail.com>

made api1 spells with stage install off explicitly

commit eea1c31a1995b368d2f301b4b6fcd03a30e90fa7
Author: David Brown <dmlb2000 AT gmail.com>
Commit: David Brown <dmlb2000 AT gmail.com>

moved pwd issues between states to the state itself and removed them from
other locations

commit 67f80e55ec886b53be7000138f6e351bc1de09db
Author: David Brown <dmlb2000 AT gmail.com>
Commit: David Brown <dmlb2000 AT gmail.com>

updated confmeld with chuid code

diff --git a/TODO b/TODO
index 43a787c..77c2e27 100644
--- a/TODO
+++ b/TODO
@@ -1,14 +1,5 @@
-1) make sure install and track root work
-2) look into using find as the install log
-3) dir permissions
-4) install_staged_config_file use install_config_file (might need to modify
so
- that it just moves to the stage root since we'll be doing the staging to
the
- system)
-5) investigate config file deletion/installation for stream-lining it
-6) rc-update script
-7) rip out the filter stagedinstall function replace with POST_INSTALL file
- the environment should be at the root of the translation dir and without
- installwatch running after the POST_INSTALL file is run everything left
in
- the translation dir will be moved to the system
-
-NOTES: 4 & 5 are very similar and may be the same todo item
+3) backwards compatability for installwatch 6
+ I) stage-root sorcery with installwatch 6/7
+ II) both with api1/2, api2 spells with staged install on/off
+6) restore post_install hack (questionable)
+8) check delve in all states
diff --git a/usr/sbin/confmeld b/usr/sbin/confmeld
index 6fec5e2..e2ed330 100755
--- a/usr/sbin/confmeld
+++ b/usr/sbin/confmeld
@@ -141,6 +141,11 @@ function main()


. /etc/sorcery/config
+if [ "$UID" -gt 0 ]; then
+ echo "Enter the root password, please."
+ su -c "$0 $@" root
+fi
+
STAGED_INSTALL="off"
main "$@"

diff --git a/usr/sbin/delve b/usr/sbin/delve
index 15dd927..8b3112c 100755
--- a/usr/sbin/delve
+++ b/usr/sbin/delve
@@ -134,10 +134,6 @@ function delve_config_loc() {
function delve_build() {
debug "delve" "Running $FUNCNAME"
delve_is_valid_step BUILD 1 2 || return 1
- [ -d $SOURCE_DIRECTORY ] || {
- message "Ack! there is no $SOURCE_DIRECTORY"
- return 1
- }
delve_log_helper
(
run_build
@@ -160,16 +156,6 @@ function delve_install() {

delve_is_valid_step BUILD 2 || return 1
delve_log_helper
- [ -d $SOURCE_DIRECTORY ] || {
- message "Ack! there is no $SOURCE_DIRECTORY"
- return 1
- }
- if [[ -f $S_PWD ]]
- then
- cd "`cat $S_PWD`"
- else
- cd $SOURCE_DIRECTORY
- fi &&
invoke_installwatch &&
if [[ "$STAGED_INSTALL" != "off" ]]
then
@@ -201,24 +187,26 @@ function delve_post_install() {
debug "delve" "Running $FUNCNAME"
delve_is_valid_step BUILD 1 2 || return 1
delve_log_helper
- [ -d $SOURCE_DIRECTORY ] || {
- message "Ack! there is no $SOURCE_DIRECTORY"
- return 1
- }
(
run_post_install
) 2> >(tee -a $C_LOG 1>&2 > $VOYEUR_STDERR) \
> >(tee -a $C_LOG > $VOYEUR_STDOUT)
}

+function delve_stage_install() {
+ debug "delve" "Running $FUNCNAME"
+ delve_is_valid_step BUILD 1 2 || return 1
+ delve_log_helper
+ (
+ run_stage_install
+ ) 2> >(tee -a $C_LOG 1>&2 > $VOYEUR_STDERR) \
+ > >(tee -a $C_LOG > $VOYEUR_STDOUT)
+}
+
function delve_final() {
debug "delve" "Running $FUNCNAME"
delve_is_valid_step BUILD 2 || return 1
delve_log_helper
- [ -d $SOURCE_DIRECTORY ] || {
- message "Ack! there is no $SOURCE_DIRECTORY"
- return 1
- }
(
run_final
) 2> >(tee -a $C_LOG 1>&2 > $VOYEUR_STDERR) \
@@ -257,7 +245,7 @@ function delve_make_continuation() {
local begin=$1
local end=$2
local API1="start PRE_BUILD config_loc BUILD POST_BUILD POST_INSTALL
TRIGGERS end"
- local API2="start PRE_BUILD config_loc BUILD PRE_INSTALL INSTALL
POST_INSTALL FINAL TRIGGERS end"
+ local API2="start PRE_BUILD config_loc BUILD PRE_INSTALL INSTALL
POST_INSTALL stage_install FINAL TRIGGERS end"
local THIS_API
case $BUILD_API in
1) THIS_API=$API1 ;;
@@ -310,6 +298,7 @@ function process_parameters() {
INSTALL) STATES="$STATES $param" ;;
POST_BUILD) STATES="$STATES $param" ;;
POST_INSTALL) STATES="$STATES $param" ;;
+ stage_install) STAGES="$STAGES $param" ;;
FINAL) STATES="$STATES $param" ;;
TRIGGERS) STATES="$STATES $param" ;;
success) STATES="$STATES $param" ;;
@@ -355,6 +344,7 @@ function main() {
INSTALL) delve_install ;;
POST_BUILD) delve_post_build ;;
POST_INSTALL) delve_post_install ;;
+ stage_install) delve_stage_install ;;
FINAL) delve_final ;;
TRIGGERS) delve_triggers ;;
success) delve_spell_success ;;
diff --git a/var/lib/sorcery/modules/build_api/api1
b/var/lib/sorcery/modules/build_api/api1
index 86c19a0..cd7e5e3 100755
--- a/var/lib/sorcery/modules/build_api/api1
+++ b/var/lib/sorcery/modules/build_api/api1
@@ -26,7 +26,7 @@ function run_build_spell() {
debug "build_api/api1" "run_build_spell"
C_LOG=$TMP_DIR/$SPELL.compile.log
C_FIFO=/dev/stdout
-
+ STAGED_INSTALL=off
rm -f $C_LOG
touch $C_LOG
if [[ $SCREEN_NAME ]] ; then
diff --git a/var/lib/sorcery/modules/build_api/api2
b/var/lib/sorcery/modules/build_api/api2
index f33a524..a56948a 100755
--- a/var/lib/sorcery/modules/build_api/api2
+++ b/var/lib/sorcery/modules/build_api/api2
@@ -56,7 +56,6 @@ function run_build_spell() {
run_config_loc || return 2
(
run_build &&
- pwd > $S_PWD &&
run_pre_install &&
# you have to make this directory every time even if you don't use it because
# it's a bug with installwatch that it needs to exist at all times
@@ -68,11 +67,7 @@ # it's a bug with installwatch that it n
fi &&
delve $SPELL INSTALL &&
delve $SPELL POST_INSTALL || return 2
- if [[ "$STAGED_INSTALL" != "off" ]]
- then
- devoke_stage_root &&
- install_staged_spell
- fi &&
+ run_stage_install &&
devoke_installwatch &&
destroy_stage_root &&
STAGED_INSTALL=off &&
@@ -138,8 +133,11 @@ function run_build() {
echo "Compile log for $SPELL $VERSION Built on `date -u`" > $C_LOG
echo "Using gcc version: `gcc -dumpversion`" >> $C_LOG

- [ -d "$SOURCE_DIRECTORY" ] &&
- cd $SOURCE_DIRECTORY
+ if [ -d "$SOURCE_DIRECTORY" ] ; then
+ cd $SOURCE_DIRECTORY
+ else
+ cd $BUILD_DIRECTORY
+ fi &&

invoke_build_dir
invoke_gcc2
@@ -165,6 +163,7 @@ function run_build() {
"${DEFAULT_COLOR}"
return 1
fi
+ pwd > $S_PWD
}


@@ -175,6 +174,14 @@ #---------------------------------------
function run_pre_install() {
debug "build_api/api2" "Starting run_pre_install()"

+ if [ -f $S_PWD ] ; then
+ cd "`cat $S_PWD`"
+ elif [ -d $SOURCE_DIRECTORY ] ; then
+ cd $SOURCE_DIRECTORY
+ else
+ cd $BUILD_DIRECTORY
+ fi
+
persistent_load &&
if [ -x $SCRIPT_DIRECTORY/PRE_INSTALL ]; then
. $SCRIPT_DIRECTORY/PRE_INSTALL
@@ -185,6 +192,7 @@ function run_pre_install() {
fi &&
persistent_save &&
echo "Compile log for $SPELL $VERSION Completed Build on `date -u`" >>
$C_LOG
+ pwd > $S_PWD
}


@@ -197,7 +205,15 @@ ## stage root properly
#---------------------------------------------------------------------
function run_install() {
debug "build_api/api2" "Starting run_install()"
-
+
+ if [ -f $S_PWD ] ; then
+ cd "`cat $S_PWD`"
+ elif [ -d $SOURCE_DIRECTORY ] ; then
+ cd $SOURCE_DIRECTORY
+ else
+ cd $BUILD_DIRECTORY
+ fi
+
persistent_load &&
if [ -x $SCRIPT_DIRECTORY/INSTALL ]; then
. $SCRIPT_DIRECTORY/INSTALL
@@ -229,11 +245,15 @@ #---------------------------------------
function run_post_install() {
debug "build_api/api2" "Starting run_post_install()"
persistent_load &&
+ if [[ $STAGED_INSTALL != off ]]
+ then
+ cd $STAGE_DIRECTORY/TRANSL
+ else
+ cd $INSTALL_ROOT
+ fi &&
if [ -x $SCRIPT_DIRECTORY/POST_INSTALL ]; then
- cd $STAGE_DIRECTORY/TRANSL &&
. $SCRIPT_DIRECTORY/POST_INSTALL
elif [[ "$POST_INSTALL_CMD" ]] ; then
- cd $STAGE_DIRECTORY/TRANSL &&
$POST_INSTALL_CMD
else
default_post_install
@@ -241,7 +261,18 @@ function run_post_install() {
persistent_save &&
unlock_resources "libgrimoire" "install"
}
-
+#--------------------------------------------------------------------
+### Checks against STAGED_INSTALL and installs the staged spell
+### accordingly
+##--------------------------------------------------------------------
+function run_stage_install() {
+ if [[ "$STAGED_INSTALL" != "off" ]]
+ then
+ devoke_stage_root &&
+ install_staged_spell
+ fi
+}
+
#---------------------------------------------------------------------
## Checks for a FINAL file in SCRIPT_DIRECTORY, and if it is
## executable, runs it. This file is used for extra files that need
@@ -251,6 +282,7 @@ function run_final() {

debug "build_api/api2" "Starting run_final()"
persistent_load &&
+ cd $INSTALL_ROOT
if [ -x $SCRIPT_DIRECTORY/FINAL ]
then
. $SCRIPT_DIRECTORY/FINAL
diff --git a/var/lib/sorcery/modules/libstage
b/var/lib/sorcery/modules/libstage
index a4ad1ed..4a2f313 100755
--- a/var/lib/sorcery/modules/libstage
+++ b/var/lib/sorcery/modules/libstage
@@ -99,10 +99,10 @@ function stage_install_file()
message "${MESSAGE_COLOR}Staging config to
$CONFIG_STAGE_DIRECTORY${DEFAULT_COLOR}"
mkdir -p $(dirname $SAVE) &&
cp -dp $STAGE_DIRECTORY/TRANSL/$FILE ${INSTALL_ROOT}/$SAVE &&
- rm $STAGE_DIRECTORY/TRANSL/$FILE
+ rm $STAGE_DIRECTORY/TRANSL/$FILE
else
cp -dp $STAGE_DIRECTORY/TRANSL/$FILE ${INSTALL_ROOT}/$FILE &&
- rm $STAGE_DIRECTORY/TRANSL/$FILE
+ rm $STAGE_DIRECTORY/TRANSL/$FILE
fi
;;
*)
@@ -124,10 +124,10 @@ function stage_install_symlink()
touch ${INSTALL_ROOT}/$FILE &&
mkdir -p $(dirname $SAVE) &&
cp -dp $STAGE_DIRECTORY/TRANSL/$FILE ${INSTALL_ROOT}/$SAVE &&
- rm $STAGE_DIRECTORY/TRANSL/$FILE
+ rm $STAGE_DIRECTORY/TRANSL/$FILE
else
cp -dp $STAGE_DIRECTORY/TRANSL/$FILE ${INSTALL_ROOT}/$FILE &&
- rm $STAGE_DIRECTORY/TRANSL/$FILE
+ rm $STAGE_DIRECTORY/TRANSL/$FILE
fi
;;
*)



  • [SM-Commit] GIT changes to devel-stage-root sorcery by David Brown (498a2ca1b7cd0c78663dfde81cf9ecab23fc0e8b), David Brown, 06/10/2006

Archive powered by MHonArc 2.6.24.

Top of Page