MacPorts 2.4.1 shows a new warning when a reinplace command doesn't change 
anything. The purpose of reinplace is to change something in a file, so when 
that doesn't happen, it may be a developer error that we want to alert the 
developer about. Portfile developers should remove these warnings in the 
appropriate way, which may be to fix the reinplace or use a patchfile instead; 
remove the reinplace; or silence the warning.

The most common situation will probably be a portfile that contains a reinplace 
that changes something in a source file, and it worked at one time, but then 
the port was updated to a new version of the software, which changed that 
source file in such a way that the reinplace no longer works. Examine the 
source file and the reinplace to figure out what was being changed. You may 
find it easier to go back to the old version of the software that the port was 
using at the time the reinplace was last modified. (Use "git blame" to find out 
when that was.) Once you figure out what was being changed, determine whether 
it still needs to be changed in the new version. If so, update the reinplace so 
it works again or preferably, if practical, change the reinplace to a 
patchfile; you'll probably need to increase the port's revision, if the change 
has any bearing on what the port installs. If the reinplace is no longer 
needed, just remove it from the portfile.

Another possibility is a reinplace in a portfile or portgroup that the 
developer intended to be a no-op in some situations. For example, you might be 
reinplacing "/opt/local" with the value of ${prefix}; if the value of ${prefix} 
*is* "/opt/local", this wouldn't change anything, and that's fine, though in 
this situation, we prefer that the file to be changed contains a placeholder, 
like "@PREFIX@", and then you reinplace "@PREFIX@" with the value of ${prefix}. 
Or, you might be using fs-traverse to loop over many files, reinplacing each 
one, even if not all of the files need the reinplacement -- for example, 
looping over all python files to change the shebang line. In these cases, 
silence the warning by using reinplace's new "-q" ("quiet") flag.


Reply via email to