Skip to Content.
Sympa Menu

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

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 (1ccac5992e22a516f00447c9e7df8bce419167c4)
  • Date: Fri, 12 Sep 2008 07:19:21 -0500

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

ChangeLog | 5 +++++
usr/sbin/resurrect | 23 +++++++++++++++--------
var/lib/sorcery/modules/libtrack | 6 +++++-
3 files changed, 25 insertions(+), 9 deletions(-)

New commits:
commit 1ccac5992e22a516f00447c9e7df8bce419167c4
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

resurrect: use the volume label if it is available

commit 1ba07aa8a06e969385bf879b849d41bb799a148e
Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>

libtrack: add the queuing factors to the volume label of the cache,
to make lookups from caches easier and faster #14723

diff --git a/ChangeLog b/ChangeLog
index 7d33455..eed85c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-09-12 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
+ * libtrack: add the queuing factors to the volume label of the cache,
+ to make lookups from caches easier and faster #14723
+ * resurrect: use the volume label if it is available
+
2008-09-10 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
* resurrect*: added a --check option and made the exit status equal
the
number of failures
diff --git a/usr/sbin/resurrect b/usr/sbin/resurrect
index b3c106e..dd9ea8f 100755
--- a/usr/sbin/resurrect
+++ b/usr/sbin/resurrect
@@ -145,21 +145,28 @@ function direct_resurrect() {
return 1
fi

- local tablet_path=var/state/sorcery/tablet
- #TODO: when we get other ARCHIVEBINs, we'll need to check which was used
- # get the spellname/date part of the path
- tmp=$(tar tOfOO "$cache" 2>&1 $tablet_path | sed -n "1 s,$tablet_path/,,p;
q")
- tmp=${tmp%/}
+ # check if we have a labelled cache, otherwise we have to use a fallback
+ local label=$(tar --test-label --file "$cache")
+ if [[ -n $label ]]; then
+ spell=$(cut -d" " -f1 <<< "$label")
+ version=$(cut -d" " -f2 <<< "$label")
+ else
+ local tablet_path=var/state/sorcery/tablet
+ # get the spellname/date part of the path
+ tmp=$(tar tOfOO "$cache" 2>&1 $tablet_path | sed -n "1
s,$tablet_path/,,p; q")
+ tmp=${tmp%/}
+
+ spell=${tmp%/*}
+ date=${tmp#*/}
+ version=$(tar fOx "$cache" 2>&1 $tablet_path/$spell/$date/version)
+ fi

- spell=${tmp%/*}
if [[ -z $spell ]]; then
error_message "$error_base the spell name couldn't be
determined!$DEFAULT_COLOR"
error_message "Please notify the Sorcery team!"
return 1
fi

- date=${tmp#*/}
- version=$(tar fOx "$cache" 2>&1 $tablet_path/$spell/$date/version)
if [[ -z $version ]]; then
error_message "$error_base the version couldn't be
determined!$DEFAULT_COLOR"
error_message "This can happen if the cache is corrupted."
diff --git a/var/lib/sorcery/modules/libtrack
b/var/lib/sorcery/modules/libtrack
index b2166dd..ff88e54 100755
--- a/var/lib/sorcery/modules/libtrack
+++ b/var/lib/sorcery/modules/libtrack
@@ -404,6 +404,10 @@ function create_cache_archive() {

message "${MESSAGE_COLOR}Creating cache file" \
"${FILE_COLOR}${CACHE_COMP}${DEFAULT_COLOR}"
+ # gather the queuing factors, so we can include them in the label, saving
us the
+ # need to compute the spell name and a few untars when dealing with just a
cache
+ local label
+ label="$SPELL ${VERSION:-0} ${PATCHLEVEL:-0} ${SECURITY_PATCH:-0}
${UPDATED:-0}"

local TMP_DATA=$TMP_DIR/foo.data
local TMP_MDATA=$TMP_DIR/foo.mdata
@@ -413,7 +417,7 @@ function create_cache_archive() {
tar)
pushd $STATE_ROOT/ &>/dev/null
install_log_filter $STATE_ROOT "." < $TMP_MDATA |
- tar --no-recursion -cPf "$CACHE" -T -
+ tar --no-recursion -cPf "$CACHE" -T - -V "$label"
popd &>/dev/null

pushd $INSTALL_ROOT/ &>/dev/null



  • [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (1ccac5992e22a516f00447c9e7df8bce419167c4), Jaka Kranjc, 09/12/2008

Archive powered by MHonArc 2.6.24.

Top of Page