I tried the new version.
Now if I have both gakuen king.chd cmpro shows no errors.
If I delete the CHD of fmtowns_cd, cmpro shows missing set (but not missing CHD in set) for fmtowns_cd
If I delete both CHDs, cmpro shows missing set and missing CHD for both sets
For the issue of renamed/unneed sets with a name of a new set, cmpro shows nothing. No error, no missing, no wrong path, etc. Like if happytr.7z on msx1_cart was deleted (but it is always there in msx1_cart folder). So it was better before, that I could check any wrong path by hand and I could choose what to do and not having dead files around.
As I understood the logic of cmpro, I will ask if it possible to change the behavior in this way:
Now cmpro scans for files, it finds happytr.7z (so it assumes that is the set "happytr"), looks for this set and finds that it is in msx1_cass (not msx1_cart where it found it). Tries to move in right place (in this specific case, it fails because it finds a file named happytr.7z in right place, instead of merging two archives together having an happytr.7z contains 2. cas and 1.rom files, like cmpro does with CHDs, it skips to move the 7z file) and in a second scan discovers that the 7z contains a rom unneeded for this set. It deletes it and if it is a rom of another set (because mamedev simply renamed the set and used the same name for another set in another soflist), cmpro rebuilder does the magic.
My idea is that scans for files, it finds happytr.7z (so it assumes that is the set "happytr"), looks for this set and finds that it should be in msx1_cass (not msx1_cart where it found it). Instead to move it in right place, scans inside this set and discovers that:
1) is a rom of another set of same softlist (ie: softlist\apple2\alice.7z that was renamed in softlist\apple2\alcwndrl.7z)
and it renames the 7z or add the rom to existent alcwndrl.7z file because it a old-parent rom become clone rom
2) is a rom not present in any set of any softlist and it marks it unneeded
3) is a rom that really misplaced and it moves it in the right place.
In this way I think that it will be solved the same issue with CHD. For example burning fight (japan) [slps-00518].chd, in previous mame it was a parent rom of set softlist\psx\burningr. Now is a clone rom of set softlist\psx\broad (the parent rom is the USA version of CHD), but there is a parent set named burningr in softlist\saturn and cmpro wants to move the psx CHD in saturn set, deleting it in second pass scan because is not in the right set, but ignoring that is a CHD for the softlist\psx\broad set.
What do you think?