@@ -21,15 +21,18 @@ WORKDIR="$WORKROOT/$CASE_ID"
2121
2222mkdir -p " $LOGDIR " " $WORKDIR "
2323
24+ RUNLOG=" $LOGDIR /run.log"
25+ exec > >( tee -a " $RUNLOG " ) 2>&1
26+
2427echo " === [$CASE_ID ] Starting case ==="
25- echo " Base product: $BASE_PRODUCT " | tee " $LOGDIR /case-info.log "
28+ echo " Base product: $BASE_PRODUCT "
2629
2730# Build the base installation into "$WORKDIR/eclipse"
2831ECLIPSE_HOME=" $WORKDIR /eclipse"
2932
3033if [[ " $BASE_PRODUCT " == " eclipse-cdt" ]]; then
3134 : " ${ECLIPSE_URL:? ECLIPSE_URL required for eclipse-cdt} "
32- echo " Downloading Eclipse from: $ECLIPSE_URL " | tee " $LOGDIR /eclipse-download.log "
35+ echo " Downloading Eclipse from: $ECLIPSE_URL "
3336 curl -fsSL " $ECLIPSE_URL " -o " $WORKDIR /eclipse.tar.gz"
3437 tar -xzf " $WORKDIR /eclipse.tar.gz" -C " $WORKDIR "
3538
@@ -43,15 +46,15 @@ if [[ "$BASE_PRODUCT" == "eclipse-cdt" ]]; then
4346
4447elif [[ " $BASE_PRODUCT " == " espressif-ide" ]]; then
4548 : " ${ESPRESSIF_IDE_SOURCE:? ESPRESSIF_IDE_SOURCE not set (path to preinstalled IDE or extracted IDE root)} "
46- echo " Copying Espressif-IDE from: $ESPRESSIF_IDE_SOURCE " | tee " $LOGDIR /ide-copy.log "
47- mkdir -p " $ECLIPSE_HOME "
48- cp -a " $ESPRESSIF_IDE_SOURCE " /. " $ECLIPSE_HOME " /
49+ echo " Copying Espressif-IDE from: $ESPRESSIF_IDE_SOURCE "
50+ mkdir -p " $ECLIPSE_HOME "
51+ cp -a " $ESPRESSIF_IDE_SOURCE " /. " $ECLIPSE_HOME " /
4952else
5053 echo " Unknown BASE_PRODUCT: $BASE_PRODUCT "
5154 exit 1
5255fi
5356
54- echo " ECLIPSE_HOME=$ECLIPSE_HOME " | tee " $LOGDIR /eclipse-home.log "
57+ echo " ECLIPSE_HOME=$ECLIPSE_HOME "
5558
5659if [[ -x " $ECLIPSE_HOME /eclipse" ]]; then
5760 LAUNCHER=" $ECLIPSE_HOME /eclipse"
6265 ls -la " $ECLIPSE_HOME " || true
6366 exit 1
6467fi
65- echo " Using launcher: $LAUNCHER " | tee " $LOGDIR /launcher.log "
68+ echo " Using launcher: $LAUNCHER "
6669
6770# Common director flags: IMPORTANT to keep same destination/profile/bundlepool across steps
6871P2_DEST_ARGS=( -destination " $ECLIPSE_HOME " -profile SDKProfile -bundlepool " $WORKDIR /p2" -roaming )
@@ -79,29 +82,25 @@ build_repo_list() {
7982
8083install_iu () {
8184 local repo=" $1 "
82- local log=" $2 "
8385 " $LAUNCHER " \
8486 -nosplash \
8587 -application org.eclipse.equinox.p2.director \
8688 -repository " $repo " \
8789 -installIU " $FEATURE_ID " \
8890 " ${P2_DEST_ARGS[@]} " \
89- -consoleLog \
90- | tee " $LOGDIR /$log "
91+ -consoleLog
9192}
9293
9394replace_iu () {
9495 local repo=" $1 "
95- local log=" $2 "
9696 " $LAUNCHER " \
9797 -nosplash \
9898 -application org.eclipse.equinox.p2.director \
9999 -repository " $repo " \
100100 -uninstallIU " $FEATURE_ID " \
101101 -installIU " $FEATURE_ID " \
102102 " ${P2_DEST_ARGS[@]} " \
103- -consoleLog \
104- | tee " $LOGDIR /$log "
103+ -consoleLog
105104}
106105
107106list_ius () {
@@ -112,7 +111,7 @@ list_ius () {
112111 -listInstalledIUs \
113112 " ${P2_DEST_ARGS[@]} " \
114113 -consoleLog \
115- | tee " $LOGDIR /$out "
114+ > " $LOGDIR /$out " 2>&1 || true
116115}
117116
118117list_roots () {
@@ -123,35 +122,39 @@ list_roots () {
123122 -listInstalledRoots \
124123 " ${P2_DEST_ARGS[@]} " \
125124 -consoleLog \
126- | tee " $LOGDIR /$out "
125+ > " $LOGDIR /$out " 2>&1 || true
127126}
128127
129128# --- Step A: install stable ---
130129if [[ " ${SKIP_STABLE_INSTALL:- 0} " != " 1" ]]; then
131- echo " Installing STABLE from $IEP_STABLE_REPO " | tee " $LOGDIR /stepA.log "
132- install_iu " $( build_repo_list " $IEP_STABLE_REPO " " ${ECLIPSE_P2_REPO:- } " ) " " stable-install.log "
130+ echo " Installing STABLE from $IEP_STABLE_REPO "
131+ install_iu " $( build_repo_list " $IEP_STABLE_REPO " " ${ECLIPSE_P2_REPO:- } " ) "
133132else
134- echo " Skipping STABLE install (SKIP_STABLE_INSTALL=1)" | tee " $LOGDIR /stepA.log "
133+ echo " Skipping STABLE install (SKIP_STABLE_INSTALL=1)"
135134fi
136135
137136# --- Step B: optional update to dev/nightly ---
138137if [[ " ${DO_DEV_UPDATE:- 0} " == " 1" ]]; then
139- echo " Updating to DEV/NIGHTLY from $IEP_DEV_REPO " | tee " $LOGDIR /stepB.log "
140- replace_iu " $( build_repo_list " $IEP_DEV_REPO " " ${ECLIPSE_P2_REPO:- } " ) " " dev-update.log "
138+ echo " Updating to DEV/NIGHTLY from $IEP_DEV_REPO "
139+ replace_iu " $( build_repo_list " $IEP_DEV_REPO " " ${ECLIPSE_P2_REPO:- } " ) "
141140fi
142141
143- # Diagnostics
144- list_ius " installed-ius.txt" || true
145- list_roots " installed-roots.txt" || true
142+ # Diagnostics (kept as small separate files)
143+ list_ius " installed-ius.txt"
144+ list_roots " installed-roots.txt"
146145
147- # Extract versions from logs (best-effort)
148- STABLE_VER=" $( grep -Eo " Installing $FEATURE_ID [^[:space:]]+" " $LOGDIR /stable-install.log " | awk ' {print $3}' | tail -n1 || true) "
149- DEV_VER=" $( grep -Eo " Installing $FEATURE_ID [^[:space:]]+" " $LOGDIR /dev-update.log " | awk ' {print $3}' | tail -n1 || true) "
150- REMOVED_VER=" $( grep -Eo " Uninstalling $FEATURE_ID [^[:space:]]+" " $LOGDIR /dev-update.log " | awk ' {print $3}' | tail -n1 || true) "
146+ # Extract versions from combined log (best-effort)
147+ STABLE_VER=" $( grep -Eo " Installing $FEATURE_ID [^[:space:]]+" " $RUNLOG " | awk ' {print $3}' | tail -n1 || true) "
148+ DEV_VER=" $( grep -Eo " Installing $FEATURE_ID [^[:space:]]+" " $RUNLOG " | awk ' {print $3}' | tail -n1 || true) "
149+ REMOVED_VER=" $( grep -Eo " Uninstalling $FEATURE_ID [^[:space:]]+" " $RUNLOG " | awk ' {print $3}' | tail -n1 || true) "
151150
152- # Conflict scan (store excerpt )
151+ # Conflict scan (from combined log )
153152ERROR_PATTERNS=' conflict|cannot complete|missing requirement|Only one of the following can be installed'
154- grep -Ein " $ERROR_PATTERNS " " $LOGDIR " /* .log > " $LOGDIR /conflicts.txt" || true
153+ if grep -Ein " $ERROR_PATTERNS " " $RUNLOG " > /dev/null 2>&1 ; then
154+ HAS_CONFLICTS=1
155+ else
156+ HAS_CONFLICTS=0
157+ fi
155158
156159# Report
157160{
@@ -173,9 +176,9 @@ grep -Ein "$ERROR_PATTERNS" "$LOGDIR"/*.log > "$LOGDIR/conflicts.txt" || true
173176 echo " Dev replaced: ${REMOVED_VER:- <unknown>} "
174177 fi
175178 echo " "
176- echo " Conflicts (grep excerpt ):"
177- if [[ -s " $LOGDIR /conflicts.txt " ]]; then
178- cat " $LOGDIR /conflicts.txt "
179+ echo " Conflicts (grep scan in logs/run.log ):"
180+ if [[ " $HAS_CONFLICTS " == " 1 " ]]; then
181+ echo " Found (see logs/run.log) "
179182 echo " "
180183 echo " STATUS: FAILED (conflict patterns detected)"
181184 exit_code=2
0 commit comments