macports-base icon indicating copy to clipboard operation
macports-base copied to clipboard

Make the reinplace warning an error

Open kurthindenburg opened this issue 4 years ago • 6 comments

This changes the warning "reinplace didn't change anything in" to an error. This will force maintainers to fix these issues. This can be bypassed by using the quiet (-q) option. Two tests are added to verify the code.

Closes: https://trac.macports.org/ticket/60844

kurthindenburg avatar Mar 23 '21 14:03 kurthindenburg

It's an easy change to the code, certainly, and I do want to make this change, but it's going to break so many ports.

ryandesign avatar Mar 23 '21 14:03 ryandesign

I'd prefer this to be an opt-in option, enabled via a new parameter.

This is similar in spirit to optional "strict" mode, used in some CMake (and/or Configure) scripts.

mascguy avatar Oct 28 '21 00:10 mascguy

Just an example of port where reinplace is used to adjust different files. Not all of them contains pattern: https://github.com/macports/macports-ports/blob/master/emulators/xhyve/Portfile#L31-L36

Another example of port which uses reinplace to clean up platform-specified traces to make universal variant: https://github.com/macports/macports-ports/blob/master/devel/icu/Portfile#L98-L116

@kurthindenburg do you see any another way to solve that issues after your patch? Call sed by hand instead of reinplace?

catap avatar Jun 15 '23 12:06 catap

I think this should not be a default option. Totally agree with @mascguy – opt-in is fine.

barracuda156 avatar Jun 15 '23 12:06 barracuda156

Just an example of port where reinplace is used to adjust different files. Not all of them contains pattern: https://github.com/macports/macports-ports/blob/master/emulators/xhyve/Portfile#L31-L36

Use reinplace's -q flag in this case.

Another example of port which uses reinplace to clean up platform-specified traces to make universal variant: https://github.com/macports/macports-ports/blob/master/devel/icu/Portfile#L98-L116

You can use -q here too if there's no better solution. A better solution might be to do the reinplace only if you know it will replace something. I haven't tried to determine if that's workable in that specific situation.

ryandesign avatar Jun 16 '23 00:06 ryandesign

@ryandesign thanks for -q option. It is that I'm looking for.

catap avatar Jun 16 '23 17:06 catap