@@ -2075,6 +2075,7 @@ function handle_package_changes() {
2075
2075
# "manual action needed" report.
2076
2076
2077
2077
local warnings_dir=" ${REPORTS_DIR} "
2078
+ local updates_dir=" ${REPORTS_DIR} /updates"
2078
2079
2079
2080
local pkg_idx=0
2080
2081
local old_name new_name old_repo new_repo
@@ -2086,9 +2087,9 @@ function handle_package_changes() {
2086
2087
local hpc_cmp_result
2087
2088
local -A hpc_only_old_slots_set hpc_only_new_slots_set hpc_common_slots_set
2088
2089
local -a lines
2089
- local hpc_update_dir
2090
+ local update_dir
2090
2091
local -A empty_map_or_set
2091
- local hpc_changed hpc_slot_changed hpc_update_dir_non_slot hpc_category_dir
2092
+ local hpc_changed hpc_slot_changed update_dir_non_slot hpc_slot_dirname hpc_category_dir
2092
2093
local which slots_set_var_name_var_name slot_verminmax_map_var_name_var_name filtered_slots_set_var_name verminmax
2093
2094
local -A hpc_old_filtered_slots_set hpc_new_filtered_slots_set
2094
2095
empty_map_or_set=()
@@ -2194,17 +2195,17 @@ function handle_package_changes() {
2194
2195
pkg_debug " slots only for old name: ${! hpc_only_old_slots_set[*]} "
2195
2196
pkg_debug " slots only for new name: ${! hpc_only_new_slots_set[*]} "
2196
2197
2197
- update_dir_non_slot " ${new_name} " hpc_update_dir_non_slot
2198
- mkdir -p " ${hpc_update_dir_non_slot } "
2198
+ update_dir_non_slot= " ${updates_dir} / ${ new_name}"
2199
+ mkdir -p " ${update_dir_non_slot } "
2199
2200
2200
2201
package_output_paths_declare hpc_package_output_paths
2201
- hpc_package_output_paths[POP_OUT_DIR_IDX]=" ${REPORTS_DIR} /updates "
2202
- hpc_package_output_paths[POP_PKG_OUT_DIR_IDX]=${hpc_update_dir_non_slot }
2202
+ hpc_package_output_paths[POP_OUT_DIR_IDX]=" ${updates_dir} "
2203
+ hpc_package_output_paths[POP_PKG_OUT_DIR_IDX]=${update_dir_non_slot }
2203
2204
# POP_PKG_SLOT_OUT_DIR_IDX will be set in loops below
2204
2205
2205
- generate_non_ebuild_diffs " ${hpc_update_dir_non_slot } " " ${OLD_PORTAGE_STABLE} " " ${NEW_PORTAGE_STABLE} " " ${old_name} " " ${new_name} "
2206
- generate_full_diffs " ${hpc_update_dir_non_slot } " " ${OLD_PORTAGE_STABLE} " " ${NEW_PORTAGE_STABLE} " " ${old_name} " " ${new_name} "
2207
- generate_package_mention_reports " ${hpc_update_dir_non_slot } " " ${NEW_STATE} " " ${old_name} " " ${new_name} "
2206
+ generate_non_ebuild_diffs " ${update_dir_non_slot } " " ${OLD_PORTAGE_STABLE} " " ${NEW_PORTAGE_STABLE} " " ${old_name} " " ${new_name} "
2207
+ generate_full_diffs " ${update_dir_non_slot } " " ${OLD_PORTAGE_STABLE} " " ${NEW_PORTAGE_STABLE} " " ${old_name} " " ${new_name} "
2208
+ generate_package_mention_reports " ${update_dir_non_slot } " " ${NEW_STATE} " " ${old_name} " " ${new_name} "
2208
2209
2209
2210
hpc_changed=
2210
2211
pkg_debug ' going over common slots'
@@ -2223,9 +2224,10 @@ function handle_package_changes() {
2223
2224
" - minmax: ${new_verminmax} "
2224
2225
continue
2225
2226
fi
2226
- update_dir " ${new_name} " " ${s} " " ${s} " hpc_update_dir
2227
- mkdir -p " ${hpc_update_dir} "
2228
- hpc_package_output_paths[POP_PKG_SLOT_OUT_DIR_IDX]=${hpc_update_dir}
2227
+ slot_dirname " ${s} " " ${s} " hpc_slot_dirname
2228
+ update_dir=" ${update_dir_non_slot} /${hpc_slot_dirname} "
2229
+ mkdir -p " ${update_dir} "
2230
+ hpc_package_output_paths[POP_PKG_SLOT_OUT_DIR_IDX]=${update_dir}
2229
2231
old_version=${old_verminmax%%:* }
2230
2232
new_version=${new_verminmax##*: }
2231
2233
gentoo_ver_cmp_out " ${new_version} " " ${old_version} " hpc_cmp_result
@@ -2238,7 +2240,7 @@ function handle_package_changes() {
2238
2240
hpc_slot_changed=
2239
2241
handle_pkg_as_is hpc_package_output_paths " ${pkg_to_tags_mvm_var_name} " " ${old_name} " " ${new_name} " " ${old_version} " hpc_slot_changed
2240
2242
if [[ -z ${hpc_slot_changed} ]]; then
2241
- rm -rf " ${hpc_update_dir } "
2243
+ rm -rf " ${update_dir } "
2242
2244
else
2243
2245
hpc_changed=x
2244
2246
fi
@@ -2267,9 +2269,10 @@ function handle_package_changes() {
2267
2269
" - slot: ${hpc_new_s} " \
2268
2270
" - minmax: ${new_verminmax} "
2269
2271
else
2270
- update_dir " ${new_name} " " ${hpc_old_s} " " ${hpc_new_s} " hpc_update_dir
2271
- mkdir -p " ${hpc_update_dir} "
2272
- hpc_package_output_paths[POP_PKG_SLOT_OUT_DIR_IDX]=${hpc_update_dir}
2272
+ slot_dirname " ${hpc_old_s} " " ${hpc_new_s} " hpc_slot_dirname
2273
+ update_dir=" ${update_dir_non_slot} /${hpc_slot_dirname} "
2274
+ mkdir -p " ${update_dir} "
2275
+ hpc_package_output_paths[POP_PKG_SLOT_OUT_DIR_IDX]=${update_dir}
2273
2276
old_version=${old_verminmax%%:* }
2274
2277
new_version=${new_verminmax##*: }
2275
2278
gentoo_ver_cmp_out " ${new_version} " " ${old_version} " hpc_cmp_result
@@ -2282,7 +2285,7 @@ function handle_package_changes() {
2282
2285
hpc_slot_changed=
2283
2286
handle_pkg_as_is hpc_package_output_paths " ${pkg_to_tags_mvm_var_name} " " ${old_name} " " ${new_name} " " ${old_version} " hpc_slot_changed
2284
2287
if [[ -z ${hpc_slot_changed} ]]; then
2285
- rm -rf " ${hpc_update_dir } "
2288
+ rm -rf " ${update_dir } "
2286
2289
else
2287
2290
hpc_changed=x
2288
2291
fi
@@ -2324,8 +2327,8 @@ function handle_package_changes() {
2324
2327
# sys-apps)
2325
2328
if [[ -z ${hpc_changed} ]]; then
2326
2329
pkg_debug ' no changes, dropping reports'
2327
- rm -rf " ${hpc_update_dir_non_slot } "
2328
- dirname_out " ${hpc_update_dir_non_slot } " hpc_category_dir
2330
+ rm -rf " ${update_dir_non_slot } "
2331
+ dirname_out " ${update_dir_non_slot } " hpc_category_dir
2329
2332
if dir_is_empty " ${hpc_category_dir} " ; then
2330
2333
rmdir " ${hpc_category_dir} "
2331
2334
fi
@@ -2945,6 +2948,29 @@ function update_dir() {
2945
2948
dir_ref=" ${ud_non_slot_dir} /${slot_dir} "
2946
2949
}
2947
2950
2951
+ # Gets a slot-specific directory name for ebuild diffs.
2952
+ #
2953
+ # Params:
2954
+ #
2955
+ # 1 - old slot
2956
+ # 2 - new slot
2957
+ # 3 - name of a variable where the path will be stored
2958
+ function slot_dirname() {
2959
+ local old_s=${1} ; shift
2960
+ local new_s=${1} ; shift
2961
+ local -n dirname_ref=${1} ; shift
2962
+
2963
+ # slots may have slashes in them - replace them with "-slash-"
2964
+ local slot_dir
2965
+ if [[ ${old_s} = " ${new_s} " ]]; then
2966
+ slot_dir=${old_s// \/ / -slash-}
2967
+ else
2968
+ slot_dir=" ${old_s// \/ / -slash-} -to-${new_s// \/ / -slash-} "
2969
+ fi
2970
+
2971
+ dirname_ref=${slot_dir}
2972
+ }
2973
+
2948
2974
# Greps for a package name in selected directories of the passed
2949
2975
# repo. It prints, so the invocation needs to be captured.
2950
2976
#
0 commit comments