GNOME Bugzilla – Bug 720087
non-portable use of 'sed -i' in libsecret Makefile.am
Last modified: 2014-08-12 06:06:12 UTC
sed -i is not POSIX secret-dbus-generated.c: $(DBUS_XML_DEFINITIONS) Makefile.am $(AM_V_GEN) gdbus-codegen --interface-prefix org.freedesktop.Secret. \ --generate-c-code secret-dbus-generated --c-namespace SecretGen \ $(DBUS_XML_DEFINITIONS) $(AM_V_GEN) sed -i -e 's/secret_gen_/_secret_gen_/g' -e 's/type-/type/g' secret-dbus-generated.[ch] $(AM_V_GEN) sed -i -e '1i #define GLIB_DISABLE_DEPRECATION_WARNINGS' secret-dbus-generated.c secret-dbus-generated.h: secret-dbus-generated.c
This rule is also dangerous because of how it creates the target even in the case of failure -- causing a rerun of 'make' to use the incorrect result. Probably the best thing to do here is to generate a tmp file and use non-inplace sed to move it to another tmp file which you can then atomically 'mv' into its final name. Either that, or you could figure out a way to avoid the whole mess... As for the #define, you could always just use -D... (although, I guess the point of this is that you only want that for one file...). Our policy these days anyway is that you shouldn't dist these files, so they should always build without warning (because they were generated by the same version of gdbus-codegen as the GLib you're using). nodist_*_SOURCES = helps...
Pushed a fix to git master.
Created attachment 263984 [details] [review] libsecret: more sed portability changes As per POSIX, a '\' and a newline is expected after the 'i' command.
Review of attachment 263984 [details] [review]: With this additional patch I can confirm it is working fine with OpenBSD sed(1).
Comment on attachment 263984 [details] [review] libsecret: more sed portability changes Looks good. Thanks!
Comment on attachment 263984 [details] [review] libsecret: more sed portability changes Looks like you pushed it for me :)
*** Bug 734630 has been marked as a duplicate of this bug. ***