]> git.proxmox.com Git - libarchive-perl.git/commitdiff
buildsys: make build-dir generation atomic
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 23 Jun 2023 14:11:50 +0000 (16:11 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 23 Jun 2023 14:11:50 +0000 (16:11 +0200)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Makefile

index c7c0eac5430474d6c9d88232e7156d43d1699689..5e374afd2c79acd309fc6a0f33faeed1e4b9ce2f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -23,11 +23,12 @@ update-bindings:
 
 .PHONY: $(BUILDSRC)
 $(BUILDSRC):
-       rm -rf $(BUILDSRC)
-       cp -a $(PPSRC)/ $(BUILDSRC)
-       cp -a debian $(BUILDSRC)
-       perl -MDevel::PPPort -e 'Devel::PPPort::WriteFile("$(BUILDSRC)/ppport.h");'
-       echo "git clone git://git.proxmox.com/git/libarchive-perl\\ngit checkout $(shell git rev-parse HEAD)" >$(BUILDSRC)/debian/SOURCE
+       rm -rf $@ $@.tmp
+       cp -a $(PPSRC)/ $@.tmp
+       cp -a debian $@.tmp
+       perl -MDevel::PPPort -e 'Devel::PPPort::WriteFile("$@.tmp/ppport.h");'
+       echo "git clone git://git.proxmox.com/git/libarchive-perl\\ngit checkout $(shell git rev-parse HEAD)" >$@.tmp/debian/SOURCE
+       mv $@.tmp $@
 
 .PHONY: dsc
 dsc: