This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=79fc3db3e9992b2f548f8bfadd31307451f86339

commit 79fc3db3e9992b2f548f8bfadd31307451f86339
Author: Guillem Jover <[email protected]>
AuthorDate: Fri Feb 11 20:17:15 2022 +0100

    build: Switch sed pseudo-in-place replace invocations with copy then move
    
    Instead of copying into a temporary, replacing, then removing the
    leftover, do the more concise replace with copy then move back.
---
 scripts/Makefile.am    |  9 ++++-----
 scripts/mk/Makefile.am | 18 ++++++++----------
 2 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 20f744ff4..2568cf348 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -168,11 +168,10 @@ endif
 
 # Ideally we'd use '$(SED) -i', but unfortunately that's not portable.
 install-data-hook:
-       mv $(DESTDIR)$(perllibdir)/Dpkg.pm \
-          $(DESTDIR)$(perllibdir)/Dpkg.pm.tmp
-       $(do_perl_subst) <$(DESTDIR)$(perllibdir)/Dpkg.pm.tmp \
-                        >$(DESTDIR)$(perllibdir)/Dpkg.pm
-       rm -f $(DESTDIR)$(perllibdir)/Dpkg.pm.tmp
+       $(do_perl_subst) <$(DESTDIR)$(perllibdir)/Dpkg.pm \
+                        >$(DESTDIR)$(perllibdir)/Dpkg.pm.new
+       mv $(DESTDIR)$(perllibdir)/Dpkg.pm.new \
+          $(DESTDIR)$(perllibdir)/Dpkg.pm
 
 uninstall-local:
 if BUILD_POD_DOC
diff --git a/scripts/mk/Makefile.am b/scripts/mk/Makefile.am
index 62d8592d2..cedf705a0 100644
--- a/scripts/mk/Makefile.am
+++ b/scripts/mk/Makefile.am
@@ -15,14 +15,12 @@ SUFFIXES =
 include $(top_srcdir)/build-aux/subst.am
 
 install-data-hook:
-       mv $(DESTDIR)$(pkgdatadir)/default.mk \
-          $(DESTDIR)$(pkgdatadir)/default.mk.tmp
-       $(do_make_subst) <$(DESTDIR)$(pkgdatadir)/default.mk.tmp \
-                        >$(DESTDIR)$(pkgdatadir)/default.mk
-       rm -f $(DESTDIR)$(pkgdatadir)/default.mk.tmp
+       $(do_make_subst) <$(DESTDIR)$(pkgdatadir)/default.mk \
+                        >$(DESTDIR)$(pkgdatadir)/default.mk.new
+       mv $(DESTDIR)$(pkgdatadir)/default.mk.new \
+          $(DESTDIR)$(pkgdatadir)/default.mk
 
-       mv $(DESTDIR)$(pkgdatadir)/buildtools.mk \
-          $(DESTDIR)$(pkgdatadir)/buildtools.mk.tmp
-       $(do_make_subst) <$(DESTDIR)$(pkgdatadir)/buildtools.mk.tmp \
-                        >$(DESTDIR)$(pkgdatadir)/buildtools.mk
-       rm -f $(DESTDIR)$(pkgdatadir)/buildtools.mk.tmp
+       $(do_make_subst) <$(DESTDIR)$(pkgdatadir)/buildtools.mk \
+                        >$(DESTDIR)$(pkgdatadir)/buildtools.mk.new
+       mv $(DESTDIR)$(pkgdatadir)/buildtools.mk.new \
+          $(DESTDIR)$(pkgdatadir)/buildtools.mk

-- 
Dpkg.Org's dpkg

Reply via email to