Skip to content

Reformatting and the "fixrepo" command

tobil4sk edited this page Apr 14, 2022 · 1 revision

In order to fix an issue with libraries with upper case letters in their names, a command was introduced which modifies Haxelib repositories to ensure all previously installed libraries work properly with all commands.

Warnings

When running any Haxelib command which accesses a repository which has been created by Haxelib 4.0.2 or earlier, the following warning is displayed:

Warning: Repository requires reformatting. To reformat, run `haxelib fixrepo`.

Or, when accessing a global repository:

Warning: Repository requires reformatting. To reformat, run `haxelib fixrepo --global`.

Running this command will make the required changes to the repository in question and the warning will no longer show up in future usage of the repository. While it is not recommended to use the repository with an older version of Haxelib after running this command, as the warning will no longer show up, any problems that are caused by this can be fixed by running the command again.

Changes

When reformatting from 4.0.2 (or earlier) to nightly

  • All library directories are changed to be all lowercase (may result in directory contents being merged)
  • All existing library versions are moved to the new lowercase directory
  • .name files are added to libraries with uppercase names, so that the correct name can be displayed in commands like list etc.

The fixrepo command may fail if there are two libraries installed which have names which Haxelib considers to be the same (library names are case insensitive). For example, if LIBRARY and library exist, then there is potential for the command to fail if both of these directories have dev paths set, or if both have 1.0.0 installed for example. In such cases, an error will be shown before any changes are made.

Via Code

The functionality of the fixrepo command is also available using the RepoReformatter class in the haxelib.api package.

Clone this wiki locally