New commits:
commit 65e5df81052237ed6050d9fceefb6bcc0e6e9d38
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
libtablet: append to the link_log, don't overwrite it each time
commit 18a01137dcb6436756085ba2946651d2fcbaa106
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
libtablet: sped up tablet_coalesce_files to take a third of the time
commit 663cdae4105a4dddc121a7a381931bdb72e3109d
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
sorcery_config.5: clarify what the internal_version is for
commit b11e8eb7ec4f8c90df1ee4eeca8076821ab49e11
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libstate: change modify_config to store values into variables in a
manner
that is overridable from the environment (var=${var:-value}) #14454
* sorcery: store COLOR in LOCAL_MEDIA_CONFIG, so there are no
problems with
ordering when sourcing our libraries
* config: source LOCAL_CONFIG before everything else; added a
temporary
color() override to make the switch for the user
* compile_config, media, roots, url: accompanying change
to benefit you must convert your local configs to the new system
(ex.):
sed -i 's,^\(\s*\)\([^=]*\)=\(.*\),\1\2=${\2:-\3},'
/etc/sorcery/config
diff --git a/ChangeLog b/ChangeLog
index 1455e16..d784441 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2008-06-17 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * sorcery_config.5: clarify what the internal_version is for
+ * libtablet: sped up tablet_coalesce_files to take a third of the time
+ append to the link_log, don't overwrite it each time
+
+2008-06-16 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libstate: change modify_config to store values into variables in a
manner
+ that is overridable from the environment (var=${var:-value}) #14454
+ * sorcery: store COLOR in LOCAL_MEDIA_CONFIG, so there are no
problems with
+ ordering when sourcing our libraries
+ * config: source LOCAL_CONFIG before everything else; added a
temporary
+ color() override to make the switch for the user
+ * compile_config, media, roots, url: accompanying change
+ to benefit you must convert your local configs to the new system
(ex.):
+ sed -i 's,^\(\s*\)\([^=]*\)=\(.*\),\1\2=${\2:-\3},'
/etc/sorcery/config
+
2008-06-07 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* libcodex: fixed an ancient minibug in codex_check_cache - the error
message was printing the wrong variable
diff --git a/etc/sorcery/compile_config b/etc/sorcery/compile_config
index 5e1fcc5..d89846b 100644
--- a/etc/sorcery/compile_config
+++ b/etc/sorcery/compile_config
@@ -1,12 +1,11 @@
- LOCAL_COMPILE_CONFIG=/etc/sorcery/local/compile_config
+
LOCAL_COMPILE_CONFIG=${LOCAL_COMPILE_CONFIG:-/etc/sorcery/local/compile_config}
+if [[ -e $LOCAL_COMPILE_CONFIG ]]; then
+ . $LOCAL_COMPILE_CONFIG
+fi
+ LOCAL_CONFIG=/etc/sorcery/local/config
+ LOCAL_ROOTS_CONFIG=/etc/sorcery/local/roots
+ LOCAL_MEDIA_CONFIG=/etc/sorcery/local/media
+ LOCAL_URL_CONFIG=/etc/sorcery/local/url
+
+# numb color, so it doesn't fail for users who have it in LOCAL_CONFIG
+# its use was moved to LOCAL_MEDIA_CONFIG; remove this in 1.16
+color() {
+ if grep -q '^ *color "*off' $LOCAL_CONFIG; then
+ echo 'color "off"' >> $LOCAL_MEDIA_CONFIG
+ fi
+ sed -i '/^\s*color "*o[nf]f*"*/d' $LOCAL_CONFIG
+}
+. $LOCAL_CONFIG
+
CAST=cast
SORCERY_BRANCH="stable"
ARCHIVE=${ARCHIVE:=on}
@@ -77,11 +92,6 @@ FORCE_BASESYSTEM_DEPENDS=${FORCE_BASESYSTEM_DEPENDS:-off}
# reverse the comments below to use rsync by default
CODEX_URL=${CODEX_URL:=$CODEX_TARBALL_URL}
#CODEX_URL=${CODEX_URL:=$CODEX_RSYNC_URL}
-
-if [[ -e $LOCAL_URL_CONFIG ]]; then
- . $LOCAL_URL_CONFIG
-fi
diff --git a/usr/sbin/sorcery b/usr/sbin/sorcery
index 8fadec8..b35b718 100755
--- a/usr/sbin/sorcery
+++ b/usr/sbin/sorcery
@@ -1583,7 +1583,7 @@ feature_menu() {
for i in ${TEMP[*]} ; do
case $i in
CCACHE) modify_config $LOCAL_COMPILE_CONFIG CCACHE $CCACHE ;;
- COLOR) modify_local_config "color" "$COLOR" "command" ;;
+ COLOR) modify_config $LOCAL_MEDIA_CONFIG "color" "$COLOR" "command"
;;
*) modify_local_config "$i" "${!i}" ;;
esac
done
diff --git a/usr/share/man/man5/sorcery_config.5
b/usr/share/man/man5/sorcery_config.5
index 921fca6..8f79f3a 100644
--- a/usr/share/man/man5/sorcery_config.5
+++ b/usr/share/man/man5/sorcery_config.5
@@ -40,7 +40,7 @@ contains the current version of sorcery.
.PP
.I internal_version
.IP
-contains 0. No discernible use.
+contains 0. It provides a quick way to check the current on-disk format
version. It has never been changed yet.
.PP
.I dialogrc
.IP
diff --git a/var/lib/sorcery/modules/libstate
b/var/lib/sorcery/modules/libstate
index c2c2304..b152a83 100755
--- a/var/lib/sorcery/modules/libstate
+++ b/var/lib/sorcery/modules/libstate
@@ -1040,11 +1040,6 @@ function modify_config() {
local TEMP separator EQUALS_COL VARIABLE
- # what to use as separator?
- if [[ $3 == command ]]
- then separator=" "
- else separator="=" ; fi
-
if ! test -f $FILE; then
if ! test -d $(smgl_dirname $FILE); then
if test -e $(smgl_dirname $FILE); then
@@ -1072,8 +1067,13 @@ function modify_config() {
done
debug "libstate" "modify_config() - entering new value $VARIABLE
$seperator $@ into $tFILE"
- # put new value and justification in
- echo "${TEMP}${1}${separator}\"$2\"" >> $tFILE
+ # put the new value and justification in
+ # assign the value in a way that can be overriden from the environment
#14454
+ if [[ $3 == command ]]; then
+ echo "${TEMP}${1} \"$2\""
+ else
+ echo "${TEMP}${1}=\"\${$1:-$2}\""
+ fi >> $tFILE
lock_commit_transaction $FILE
@@ -1084,7 +1084,7 @@ function modify_config() {
## @param variable
## @param command (optional)
##
-## Modifies (or adds) an entry in the local/config.
+## Removes an entry in the local/config.
## If "command" is the third argument, a space will separate the
## variable and value rather than the equals sign.
##
diff --git a/var/lib/sorcery/modules/libtablet
b/var/lib/sorcery/modules/libtablet
index 0f9e641..276bf35 100755
--- a/var/lib/sorcery/modules/libtablet
+++ b/var/lib/sorcery/modules/libtablet
@@ -923,12 +923,13 @@ function tablet_coalesce_files() {
local total_files=$(find $dir -type f 2>/dev/null|wc -l)
message "Computing md5sum of $total_files tablet files"
- function tablet_coalesce_files_sub() {
- hash_append tablet_coalesce $(md5sum $1 2>/dev/null)
+ # the + makes find stack found files, so md5sum is invoked a lot less often
+ find $dir -type f -exec md5sum {} + 2>/dev/null |
+ while read line; do
+ hash_append tablet_coalesce $line
progress_bar $i $total_files
let i+=1
- }
- iterate tablet_coalesce_files_sub $'\n' "$(find $dir -type f)"
+ done
message ""
# hash_get_table dumps out the table values one per line
@@ -938,7 +939,7 @@ function tablet_coalesce_files() {
hash_get_table tablet_coalesce| while read -a cdr; do
car=${cdr[0]}
for (( i=1 ; i<${#cdr[*]} ; i++ )) ; do
- echo "Linking $car to ${cdr[$i]}" > $link_log
+ echo "Linking $car to ${cdr[$i]}" >> $link_log
ln -f $car ${cdr[$i]}
done
done
[SM-Commit] GIT changes to master sorcery by Jaka Kranjc (65e5df81052237ed6050d9fceefb6bcc0e6e9d38),
Jaka Kranjc, 06/17/2008