[libsecret] libsecret: Don't use non-portable sed -i shell command



commit 8d297361de86da651bf9caf809cf3f778cfad10e
Author: Stef Walter <stefw gnome org>
Date:   Wed Dec 11 09:41:27 2013 +0100

    libsecret: Don't use non-portable sed -i shell command
    
    https://bugzilla.gnome.org/show_bug.cgi?id=720087

 .gitignore            |    2 +-
 libsecret/Makefile.am |   19 ++++++++++++++-----
 2 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 90c3a85..f57066d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -70,7 +70,7 @@ stamp*
 /egg/tests/test-*
 !/egg/tests/test-*.c
 
-/libsecret/secret-dbus-generated.[ch]
+/libsecret/*-dbus-generated.[ch]
 /libsecret/secret-enum-types.[ch]
 /libsecret/tests/test-*
 /libsecret/tests/*.metadata
diff --git a/libsecret/Makefile.am b/libsecret/Makefile.am
index 04ef1db..6e1fe7b 100644
--- a/libsecret/Makefile.am
+++ b/libsecret/Makefile.am
@@ -91,13 +91,18 @@ libsecret_testable_la_LDFLAGS = -rpath /force/shared
 DBUS_XML_DEFINITIONS = \
        $(srcdir)/org.freedesktop.Secrets.xml
 
-secret-dbus-generated.c: $(DBUS_XML_DEFINITIONS) Makefile.am
+temp-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 \
+               --generate-c-code temp-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
+secret-dbus-generated.c: temp-dbus-generated.c Makefile.am
+       $(AM_V_GEN) sed -e '1i #define GLIB_DISABLE_DEPRECATION_WARNINGS' \
+               -e 's/secret_gen_/_secret_gen_/g' -e 's/type-/type/g' \
+               -e 's/temp-dbus-generated.h/secret-dbus-generated.h/g' \
+               temp-dbus-generated.c > secret-dbus-generated.c
+secret-dbus-generated.h: temp-dbus-generated.c Makefile.am
+       $(AM_V_GEN) sed -e 's/secret_gen_/_secret_gen_/g' -e 's/type-/type/g' \
+               temp-dbus-generated.h > secret-dbus-generated.h
 
 secret-enum-types.h: secret-enum-types.h.template $(HEADER_FILES)
        $(AM_V_GEN) $(GLIB_MKENUMS) --template $^ > $@
@@ -212,9 +217,13 @@ CLEANFILES += \
        $(pkgconfig_DATA) \
        $(gir_DATA) \
        $(typelibs_DATA) \
+       temp-dbus-generated.c \
+       temp-dbus-generated.h \
        $(NULL)
 
 DISTCLEANFILES = \
+       secret-dbus-generated.c \
+       secret-dbus-generated.h \
        $(NULL)
 
 check-memory:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]