New commits:
commit 279988997c0ab5fd0a96f7b437f00296ec6f2110
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Revert "moved over from the previous repo: changelog printing
customization"
1.15 material
This reverts commit a664cba6560bf60e17c8ab98e4186913d9aadeb9.
commit 5dc027f3dbe39be5ff8da03539afa48a0ffbfdf6
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
changelog entry for the last few commits
(cherry picked from commit 3b90ae0e7a048a764971fa94b494cf71f47d5aac)
commit 1534097a5ebd3096c2ea82223477908f4aa0ce99
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
libressurect: fix a now bad locking call
(cherry picked from commit c8bac682174aefe315eb32f81e8c28e11a716383)
commit 2c6b3949dfe68c7ef8c7cfaaa6d28a7668f90fce
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
common: removed two "new" wrong locks
(cherry picked from commit ff1944760ad070d4186f5f7d87d2fbe5303b567b)
commit 1811339c403d32d65f2927071af43d44665f1d31
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
common: remove EOL whitespace
(cherry picked from commit 1ba309e90a88b28a26d1432fee7cc5712d34b80c)
commit 020f45f576e256c81cbba72089334396d4562f31
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
use locking in the rest of libstate (=everywhere)
(cherry picked from commit a14b4e055dbf59ff5af4b2efdc787e24a56b5861)
commit a664cba6560bf60e17c8ab98e4186913d9aadeb9
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
moved over from the previous repo: changelog printing customization
(cherry picked from commit 387ac9304221e65b443f5ce5d75de2aca49bdec4)
(cherry picked from commit bc8ecce21bd90ddfcb06d39a1b445fda28a0bd8a)
diff --git a/ChangeLog b/ChangeLog
index 4133aee..323ea22 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-01-15 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libstate: added use of locks (when reading files) and transactions
(when
+ modifying them) to the remaining functions. Part of #7917 that
+ hopefully fixes the annoying #13345
+ * build_api/common: accompanying changes to avoid double locking
+ * libressurect: accompanying changes to avoid double locking
+
2007-12-31 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* liblock: avoid two possible tiny race conditions
diff --git a/var/lib/sorcery/modules/build_api/common
b/var/lib/sorcery/modules/build_api/common
index 5086c03..4e1f7e8 100755
--- a/var/lib/sorcery/modules/build_api/common
+++ b/var/lib/sorcery/modules/build_api/common
@@ -111,7 +111,7 @@ function run_config_loc () {
## If the spell is not installed (or held) the spell is not dispelled.
##
#---------------------------------------------------------------------
-function real_prepare_install() { (
+function real_prepare_install() { (
debug "libgrimoire" "Running prepare_install() on $SPELL"
@@ -135,9 +135,9 @@ save_bin_lib_paths
}
#--------------------------------------------------------------------
-##
+##
## append old libraries and binaries to the appropriate environmental
-## variables so that they can be found by sorcery if they get
+## variables so that they can be found by sorcery if they get
## dispelled
##
#--------------------------------------------------------------------
@@ -246,10 +246,10 @@ function run_spell_success() {
# update depends info
debug "build_api/common" "Merging depends info"
- local t_DEPENDS_STATUS=$(lock_start_transaction $DEPENDS_STATUS)
# none of the old values are valid, only the new, uncommitted values are
- remove_depends_status $t_DEPENDS_STATUS $SPELL
+ remove_depends_status $DEPENDS_STATUS $SPELL
local spell_depends spell_sub_depends spell_rsub_depends
+ local t_DEPENDS_STATUS=$(lock_start_transaction $DEPENDS_STATUS)
get_uncommitted_depends_file $SPELL spell_depends
if [ -e "$spell_depends" ] ; then
cat $spell_depends >> $t_DEPENDS_STATUS
@@ -261,10 +261,10 @@ function run_spell_success() {
test -e "$ABANDONED_DEPENDS/$SPELL" &&
rm -f $ABANDONED_DEPENDS/$SPELL &>/dev/null
- local t_SUB_DEPENDS_STATUS=$(lock_start_transaction $SUB_DEPENDS_STATUS)
# none of the old values are valid, only the new, uncommitted values are
- remove_sub_depends $t_SUB_DEPENDS_STATUS "" "$SPELL"
+ remove_sub_depends $SUB_DEPENDS_STATUS "" "$SPELL"
local spell_sub_depends
+ local t_SUB_DEPENDS_STATUS=$(lock_start_transaction $SUB_DEPENDS_STATUS)
get_uncommitted_sub_depends_file $SPELL spell_sub_depends
if [ -e "$spell_sub_depends" ] ; then
cat $spell_sub_depends >> $t_SUB_DEPENDS_STATUS
@@ -371,9 +371,9 @@ function run_spell_failure() {
get_uncommitted_rsub_depends_file $SPELL spell_rsub_depends
rm -f "$spell_sub_depends" "$spell_rsub_depends"
- if [[ $CLEAN_SOURCE == on ]]
+ if [[ $CLEAN_SOURCE == on ]]
then
- rm_source_dir
+ rm_source_dir
if [[ $STAGED_INSTALL != off ]]
then
destroy_stage_root
diff --git a/var/lib/sorcery/modules/libresurrect
b/var/lib/sorcery/modules/libresurrect
index c93c4a9..54fdeeb 100755
--- a/var/lib/sorcery/modules/libresurrect
+++ b/var/lib/sorcery/modules/libresurrect
@@ -572,10 +572,10 @@ function resurrect_success() {
# 15) commit state data:
if [[ $OLD_TABLET_DIR ]] ; then
# depends info if it exists
- local t_DEPENDS_STATUS=$(lock_start_transaction "$DEPENDS_STATUS")
# none of the old values are valid, only the new, uncommitted values are
- remove_depends_status $t_DEPENDS_STATUS $SPELL
+ remove_depends_status $DEPENDS_STATUS $SPELL
local spell_depends=$OLD_TABLET_DIR/depends
+ local t_DEPENDS_STATUS=$(lock_start_transaction "$DEPENDS_STATUS")
if [ -e $spell_depends ] ; then
cat $spell_depends >> $t_DEPENDS_STATUS
fi
diff --git a/var/lib/sorcery/modules/libstate
b/var/lib/sorcery/modules/libstate
index 97f1e6c..5e7d7ef 100755
--- a/var/lib/sorcery/modules/libstate
+++ b/var/lib/sorcery/modules/libstate
@@ -45,7 +45,9 @@ function add_depends()
return 1
fi
#---------------------------------------------------------------------
@@ -580,8 +619,13 @@ function query_spell_status()
local version
version=`esc_str ${2:-".*"}`
@@ -740,7 +784,6 @@ function all_spell_status()
#---------------------------------------------------------------------
function set_held () {
local t_status=$(lock_start_transaction $SPELL_STATUS)
- cp $SPELL_STATUS $t_status
for to_hold in $@; do
sedit 's/\(^'$(esc_str $to_hold)':[^:]*:\)installed/\1held/'
$t_status
done
@@ -815,7 +858,6 @@ function set_unexiled () {
#---------------------------------------------------------------------
function set_unheld () {
local t_status=$(lock_start_transaction $SPELL_STATUS)
- cp $SPELL_STATUS $t_status
for to_hold in $@; do
sedit 's/\(^'$(esc_str $to_hold)':[^:]*:\)held/\1installed/'
$t_status
done
[SM-Commit] GIT changes to master sorcery by Jaka Kranjc (279988997c0ab5fd0a96f7b437f00296ec6f2110),
Jaka Kranjc, 01/15/2008