Skip to content

capgen should only overwrite modified files #278

Description

@gold2718

capgen currently always overwrites all generated code (caps, ccpp_kinds.F90). By default, it should only overwrite an existing file if that file has been modified. Here is the proposed solution.

  • Generate all files to a temporary directory (e.g., if the capgen directory is ccpp, generate into ccpp_tmp).
  • Only copy files from the temporary directory if they do not exist in the configured destination or have changed.
  • Remove the temporary directory.

In addition, capgen will have a new switch, --force, which reproduces the current behavior (i.e., regnerate all files). This could be implemented as first removing the existing directory or by specifying that the temporary directory is the same as the existing directory (my preference as it would not overwrite anything unless the analysis phase is successful).

Metadata

Metadata

Assignees

Labels

bugFor issues describing bugs, or PRs fixing bugscapgenbugs, requests, etc. that involve ccpp_capgencapgen-unificationIssues/PRs necessary for capgen/prebuild unification

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions