Reinplace warnings
Joshua Root
jmr at macports.org
Tue Mar 21 13:06:30 UTC 2017
On 2017-3-21 23:07 , Craig Treleaven wrote:
> 1) What happens if my port uses ‘reinplace -q …’ but the user hasn’t updated to MacPorts 2.4.1? Does the port fail or is the -q flag ignored?
With 2.4.0, the flag is accepted; with older versions, it fails. If the
user has updated the ports tree they should update base as well. Our
documentation recommends running selfupdate instead of sync if possible.
> 2) My MythTV ports have scores of Perl and Python scripts where I need to reinplace the shebang lines. That works but the user now gets over 100 reinplace warnings. As the port maintainer, I may sometimes want to see those warnings to assure myself that they remain harmless. Would it be possible to have the ‘port -d ‘ flag override the ‘-q’ flag so that I can see the warnings when needed?
It wouldn't be straightforward. There's a whole extra exec to do the
check and it uses ui_warn to report a negative result.
Having different checks done based on whether the -d flag is given would
be unusual as debug output is always generated and sent to the log file
regardless of the verbosity level.
You could however do this in the Portfile:
# change to 1 to print reinplace warnings
set maintainer_mode 0
if {!$maintainer_mode} {
set qflag -q
} else {
set qflag ""
}
...
reinplace {*}$qflag "somepattern" somefile
...
- Josh
More information about the macports-dev
mailing list