|
| 1 | += halfileupdate(1) |
| 2 | + |
| 3 | +== NAME |
| 4 | + |
| 5 | +halfileupdate - Update HAL configuration files after component, pin and parameter renames |
| 6 | + |
| 7 | +== SYNOPSIS |
| 8 | + |
| 9 | +*halfileupdate* [--in-place] [--no-backup] [--quiet] _file.hal_|_file.ini_... |
| 10 | + |
| 11 | +== DESCRIPTION |
| 12 | + |
| 13 | +Removing the 32-bit HAL types renames the components, pins and |
| 14 | +parameters whose name spells a type that no longer exists, for example |
| 15 | +*conv_s32_float* becomes *conv_sint_real* and *mux-gen.00.in-s32-00* |
| 16 | +becomes *mux-gen.00.in-sint-00*. A configuration using the old names |
| 17 | +fails to start. *halfileupdate* rewrites those names in HAL files, |
| 18 | +both *.hal* and haltcl *.tcl*. |
| 19 | + |
| 20 | +Run it on the INI file of the configuration: |
| 21 | + |
| 22 | +---- |
| 23 | +halfileupdate mymachine.ini |
| 24 | +---- |
| 25 | + |
| 26 | +This prints a diff of what would change and writes nothing. Every HAL |
| 27 | +file the INI names is read, in the order LinuxCNC runs them, which is |
| 28 | +what makes the names resolvable: a *loadrt* in one file and the pins it |
| 29 | +creates in another is normal in a configuration, and the INI file is |
| 30 | +what ties the two together. Files named by a key of a user interface's |
| 31 | +own, such as *CUSTOM_HALFILE*, and keys outside the *[HAL]* section are |
| 32 | +picked up as well. Add *--in-place* to make the changes, |
| 33 | +keeping a *.bak* of every file it touches: |
| 34 | + |
| 35 | +---- |
| 36 | +halfileupdate -i mymachine.ini |
| 37 | +---- |
| 38 | + |
| 39 | +A single HAL file can be converted on its own, but then only the |
| 40 | +components that file loads itself can be converted; anything else is |
| 41 | +reported, with a message saying to run the INI file instead. |
| 42 | + |
| 43 | +Signal names are never changed: they are yours, and no rename applies |
| 44 | +to them, though the type word on a *newsig* line is converted, since the |
| 45 | +type names changed with everything else. A *net* line keeps its signal and gets new pin names. |
| 46 | +Instance names you chose with *names=* are kept as well; only the |
| 47 | +component name on the *loadrt* line changes. |
| 48 | + |
| 49 | +== WHAT YOU HAVE TO DO BY HAND |
| 50 | + |
| 51 | +*halfileupdate* converts the names it can resolve and reports the rest |
| 52 | +with the file and the line, so what is left is on screen when it |
| 53 | +finishes. It does not touch: |
| 54 | + |
| 55 | +* Names that are not spelled out in the file, such as a haltcl name |
| 56 | + built in a loop or a procedure (*abs-s32.$i.gain*), or a name built |
| 57 | + from an INI variable. |
| 58 | +* Comments. A comment that still names something that changed is |
| 59 | + reported. |
| 60 | +* Pin names outside HAL files: the Python *hal* module, custom user |
| 61 | + interfaces, pyvcp and qtvcp panels, and halui bindings in other |
| 62 | + sections of the INI file. |
| 63 | + |
| 64 | +HAL files that come with LinuxCNC, whether written *LIB:name.tcl* or |
| 65 | +found in the HAL library, are updated with LinuxCNC and are left alone. |
| 66 | + |
| 67 | +Review the diff and test the configuration before running a machine |
| 68 | +with it. |
| 69 | + |
| 70 | +== OPTIONS |
| 71 | + |
| 72 | +_file.hal_|_file.ini_...:: |
| 73 | +The files to convert. An INI file pulls in the HAL files it names, |
| 74 | +including those behind a *HALCMD* line; a HAL file is converted on its |
| 75 | +own. In a haltcl file the Tcl form *hal setp name value* is understood |
| 76 | +as well as the plain *setp name value*. |
| 77 | + |
| 78 | +*-i*, *--in-place*:: |
| 79 | +Rewrite the files in place. A backup with the suffix *.bak* is kept |
| 80 | +unless *--no-backup* is given. |
| 81 | + |
| 82 | +*--no-backup*:: |
| 83 | +With *--in-place*, do not keep a *.bak* backup. |
| 84 | + |
| 85 | +*-q*, *--quiet*:: |
| 86 | +Suppress warnings and notes on stderr. |
| 87 | + |
| 88 | +== EXIT STATUS |
| 89 | + |
| 90 | +0 on success, 2 when a file given on the command line could not be |
| 91 | +read. Names left for you to convert do not change the exit status. |
| 92 | + |
| 93 | +== SEE ALSO |
| 94 | + |
| 95 | +*halcmd*(1), *halcompile*(1), *halcompupdate*(1), *haltcl*(1) |
0 commit comments