File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,7 +45,19 @@ for yaml_file in "$@"; do
4545
4646 # Extract version and epoch from the file on the main branch using git show
4747 # Treat missing file as version 0 and epoch 0
48- main_content=" $( git show main:" $yaml_file " 2> /dev/null) "
48+ # Try all three known package directories so epoch bumps are enforced when
49+ # a package is moved between os/, enterprise-packages/, and extra-packages/.
50+ first_component=" ${yaml_file%%/* } "
51+ rest_of_path=" ${yaml_file#*/ } "
52+ main_content=" "
53+ if [[ " $first_component " == " os" || " $first_component " == " enterprise-packages" || " $first_component " == " extra-packages" ]]; then
54+ for prefix in " os" " enterprise-packages" " extra-packages" ; do
55+ main_content=" $( git show main:" ${prefix} /${rest_of_path} " 2> /dev/null) "
56+ [ -n " $main_content " ] && break
57+ done
58+ else
59+ main_content=" $( git show main:" $yaml_file " 2> /dev/null) "
60+ fi
4961 if [ -z " $main_content " ]; then
5062 version_main=" 0"
5163 epoch_main=" 0"
You can’t perform that action at this time.
0 commit comments