Skip to content

Commit

Permalink
Merge pull request #146 from angelabriel/master
Browse files Browse the repository at this point in the history
jsc#TEAM-6598 - add detection of orphaned solution overrides
  • Loading branch information
angelabriel authored Sep 9, 2024
2 parents 36e2cd2 + 419b989 commit 002b3e4
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions actions/serviceacts.go
Original file line number Diff line number Diff line change
Expand Up @@ -847,11 +847,21 @@ func CheckOrphanedOverrides() {
if err != nil {
system.ErrorExit("Problems reading override directory '%s' (%v). Please check your saptune installation\n", OverrideTuningSheets, err)
}
customName := ""
object := "note"
workDir := NoteTuningSheets
for _, entry := range dirCont {
ovFile := entry.Name()
_, _, err := chkFileName(ovFile, NoteTuningSheets, ExtraTuningSheets)
if strings.HasSuffix(ovFile, ".sol") {
object = "solution"
workDir = SolutionSheets
customName = ovFile
} else {
customName = ovFile + ".conf"
}
_, _, err := chkFileName(ovFile, workDir, ExtraTuningSheets)
if os.IsNotExist(err) {
system.WarningLog("Found an orphaned override file '%s' in '%s'!\n Could not find a note definition file named '%s' in the working area '%s' nor '%s.conf' in the custom location '%s'. Please check and remove the override file, if it is a left over\n", ovFile, OverrideTuningSheets, ovFile, NoteTuningSheets, ovFile, ExtraTuningSheets)
system.WarningLog("Found an orphaned override file '%s' in '%s'!\n Could not find a %s definition file named '%s' in the working area '%s' nor '%s' in the custom location '%s'. Please check and remove the override file, if it is a left over\n", ovFile, OverrideTuningSheets, object, ovFile, workDir, customName, ExtraTuningSheets)
orphanedOverrides = append(orphanedOverrides, ovFile)
}
}
Expand Down

0 comments on commit 002b3e4

Please sign in to comment.