A bit more then 24h later, but I'm now happier with the results of my own testing. I ended up replacing the 'sed' commands with the pattern replacement variation of the parameter expansion (which is a feature of the shell itself). This way no costly "outside" call to 'sed' was required. Another significant change was to bring the replacement operations "inside" of the 'local_recursive_scan()' and 'remote_recursive_scan()' functions, as otherwise a functional regression for nested kernel module dependencies was observed (e.g. for test case: 'wxcam.tcz').
--- /usr/bin/tce-load
+++ tce-load
@@ -62,4 +62,5 @@
push_dep(){
- DEPLIST="$1""/""$DEPLIST"
+ DEPLIST="${1}/${DEPLIST}"
}
+
pop_dep(){
@@ -69,6 +70,2 @@
-dep_vars(){
- sed -i "s@KERNEL@$KERNELVER@" $1
-}
-
copyInstall() {
@@ -149,6 +146,7 @@
local_recursive_scan() {
- push_dep ${1}
+ EXT="${1//-KERNEL.tcz/-${KERNELVER}.tcz}"
+ push_dep ${EXT}
deps=""
- if [ -f ${1}.dep ]; then
- deps=`cat ${1}.dep`
+ if [ -f ${EXT}.dep ]; then
+ deps=$( cat ${EXT}.dep )
for d in $deps; do
@@ -160,6 +158,8 @@
remote_recursive_scan() {
- push_dep ${1}
+ EXT="${1//-KERNEL.tcz/-${KERNELVER}.tcz}"
+ push_dep ${EXT}
deps=""
- deps=`cat "$FROMWHERE"/${1}.dep`
+ deps=$( cat "${FROMWHERE}/${EXT}.dep" )
for d in $deps; do
+ d="${d//-KERNEL.tcz/-${KERNELVER}.tcz}"
push_dep ${d}
@@ -168,3 +168,2 @@
if [ "$?" == 0 ]; then
- dep_vars ${d}.dep
[ "$SUPPRESS" ] || echo ${d}.dep OK
@@ -192,2 +191,4 @@
if [ ${TARGETAPP} == ${APPNAME} ]; then TARGETAPP=${TARGETAPP}.tcz; fi
+APPNAME="${APPNAME/-KERNEL/-${KERNELVER}}"
+TARGETAPP="${TARGETAPP/-KERNEL.tcz/-${KERNELVER}.tcz}"
@@ -212,3 +213,2 @@
if [ "$?" == 0 ]; then
- dep_vars $DEPLIST
DEPLIST=""
I've done my own (limited) testing where I measured the installation time of a single extension (e.g. 'compiletc.tcz') multiple times and averaged out the measured results. Comparing the TC 3.8.4 version with my patched one showed that my version appeared to be in my tests always a tiny bit faster then the Core one. Maybe the elimination of the 'sed' call in 'dep_vars()' gained enough to "pay" for the additional multiple pattern replacement operations.
Clearly it is vital that these findings of my limited testing can be substantiated trough the testing of others (e.g. robc). If the result can be replicated then maybe, just maybe, what was meant to be an improvement for the few could become something to the benefit of the many.