cinera: Resolve output location clashes
This commit adds support for tracking and resolving clashes of output locations. Previously open-ended clash dependency chains could passively resolve across multiple Cinera invocations (undesirable, but possible); whereas closed-loop dependency chains could not resolve without the user manually resolving them by moving one clash to a temporary location (not acceptable). This new support handles such clashes in one fell swoop. Other smaller changes in this commit: • Change message_control to use memory_book • Fix deletion of old .index files when reorganising projects • Fix deletion of moved entries when subdividing projects
This commit is contained in:
parent
6576a91d11
commit
44a5008aa7
1560
cinera/cinera.c
1560
cinera/cinera.c
File diff suppressed because it is too large
Load Diff
|
@ -4532,22 +4532,18 @@ PrintLineage(string Lineage, bool AppendNewline)
|
|||
if(AppendNewline) { Print(stderr, "\n"); }
|
||||
}
|
||||
|
||||
int
|
||||
CopyLineageToBarePtr(char *Ptr, string Lineage, bool AppendNewline)
|
||||
void
|
||||
ExtendLineageInBook(memory_book *M, string Lineage, bool AppendNewline)
|
||||
{
|
||||
int Length = 0;
|
||||
|
||||
string Parent = StripComponentFromPath(Lineage);
|
||||
Length += CopyStringCToBarePtr(CS_BLACK_BOLD, Ptr + Length, Parent);
|
||||
ExtendStringCInBook(M, CS_BLACK_BOLD, Parent);
|
||||
if(Parent.Length > 0)
|
||||
{
|
||||
Length += CopyStringCToBarePtr(CS_BLACK_BOLD, Ptr + Length, Wrap0("/"));
|
||||
ExtendStringCInBook(M, CS_BLACK_BOLD, Wrap0("/"));
|
||||
}
|
||||
string Us = GetFinalComponent(Lineage);
|
||||
Length += CopyStringCToBarePtr(CS_BLUE_BOLD, Ptr + Length, Us);
|
||||
if(AppendNewline) { Length += CopyStringToBarePtr(Ptr + Length, Wrap0("\n")); }
|
||||
|
||||
return Length;
|
||||
ExtendStringCInBook(M, CS_BLUE_BOLD, Us);
|
||||
if(AppendNewline) { ExtendStringInBook(M, Wrap0("\n")); }
|
||||
}
|
||||
|
||||
uint8_t
|
||||
|
@ -5073,7 +5069,7 @@ PositionRolesInConfig(config *C, resolution_errors *E, config_verifiers *V, scop
|
|||
config_pair *Position = GetPair(*Role, IDENT_POSITION);
|
||||
if(IsPositioned(Position))
|
||||
{
|
||||
int TargetPos;
|
||||
int TargetPos = 0;
|
||||
if(Position->int64_t < 0)
|
||||
{
|
||||
TargetPos = SlotCount + Position->int64_t;
|
||||
|
|
Loading…
Reference in New Issue