Project

General

Profile

select_standard.sh

Roger Borrello, 02/11/2026 11:51 AM

Download (809 Bytes)

 
1
#!/bin/bash
2
set -euo pipefail
3

    
4
data_rel="$1"
5
jar_path="$2"
6

    
7
# Get version line
8
output="$(java -jar "$jar_path")"
9

    
10
# Expect format: FWD v4.0.0_p2j_<branch>_<revision>
11
if [[ ! "$output" =~ _p2j_([^_]+)_([0-9]+) ]]; then
12
   echo "ERROR: Unable to parse p2j output: $output" >&2
13
   exit 1
14
fi
15

    
16
branch="${BASH_REMATCH[1]}"
17
revision="${BASH_REMATCH[2]}"
18

    
19
use_post=false
20

    
21
# ---- Policy Rules ----
22
if [[ "$branch" == "trunk" && "$revision" -ge 16415 ]]; then
23
   use_post=true
24
fi
25

    
26
# Future policy example
27
#if [[ "$branch" == "9986c" && "$revision" -ge 16300 ]]; then
28
#   use_post=true
29
#fi
30
# ----------------------
31

    
32
if $use_post; then
33
   echo post9950
34
   exit 0
35
fi
36

    
37
# Fallback handling for pre9950
38
if [[ ! -f "$data_rel/standard_pre9950.df" && -f "$data_rel/standard.df" ]]; then
39
   echo skip
40
   exit 0
41
fi
42

    
43
echo pre9950