use mv/sed/rm on a temporary file instead of "sed -i" which is not
author09:00:28 Tim Janik <timj@imendio.com>
Fri, 11 Jan 2008 08:01:44 +0000 (08:01 +0000)
committerTim Janik <timj@src.gnome.org>
Fri, 11 Jan 2008 08:01:44 +0000 (08:01 +0000)
2008-01-11 09:00:28  Tim Janik  <timj@imendio.com>

        * glib/Makefile.am (install-exec-hook): use mv/sed/rm on a temporary
        file instead of "sed -i" which is not portable enough.

svn path=/trunk/; revision=6291

ChangeLog
glib/Makefile.am

index 92ea3bf..16d1f39 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-11 09:00:28  Tim Janik  <timj@imendio.com>
+
+       * glib/Makefile.am (install-exec-hook): use mv/sed/rm on a temporary
+       file instead of "sed -i" which is not portable enough.
+
 2008-01-08  Alexander Larsson  <alexl@redhat.com>
 
        * tests/cxx-test.C:
index 917ab93..ba66d53 100644 (file)
@@ -326,12 +326,12 @@ CONFIGVARS = \
 
 install-exec-hook:
        for sf in ${auto_config_binscripts} ; do \
-         sed -i.bak \
+         mv -f "$(DESTDIR)$(bindir)/$$sf" "$(DESTDIR)$(bindir)/$$sf".tmp \
+         && sed < "$(DESTDIR)$(bindir)/$$sf".tmp > "$(DESTDIR)$(bindir)/$$sf" \
            -e '1,24s|^ *#@PKGINSTALL_CONFIGVARS_IN24LINES@|  ${CONFIGVARS}|' \
            -e '1,1s|#!/usr/bin/env python\([0-9]\+\(\.[0-9]\+\)\?\)\?|#!${PYTHON}|' \
-           "$(DESTDIR)$(bindir)/$$sf" \
-         || exit $$? \
-         && rm -f "$(DESTDIR)$(bindir)/$$sf".bak ; \
+         || exit $$? ; \
+         rm -f "$(DESTDIR)$(bindir)/$$sf".tmp ; \
        done
 
 endif