projects
/
mirror
/
dsa-puppet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3b94861
)
Replace the target tarfile atomically
author
Peter Palfrader
<peter@palfrader.org>
Wed, 8 May 2013 09:14:53 +0000
(11:14 +0200)
committer
Peter Palfrader
<peter@palfrader.org>
Fri, 10 May 2013 12:22:36 +0000
(14:22 +0200)
modules/porterbox/files/setup-dchroot
patch
|
blob
|
history
diff --git
a/modules/porterbox/files/setup-dchroot
b/modules/porterbox/files/setup-dchroot
index
db27d5a
..
6fa9e66
100755
(executable)
--- a/
modules/porterbox/files/setup-dchroot
+++ b/
modules/porterbox/files/setup-dchroot
@@
-231,4
+231,6
@@
chroot "$rootdir" apt-get install -y --no-install-recommends zsh locales-all bui
rm -f "$rootdir/etc/apt/sources.list" "$rootdir/etc/apt/sources.list.d/*"
umount "$rootdir/sys" || true
-(cd "$rootdir" && tar caf "$target" .)
+tartmp=$(tempfile --directory "$basedir" --suffix=".tar.gz")
+cleanup+=("rm -f $tartmp")
+(cd "$rootdir" && tar caf "$tartmp" . && mv "$tartmp" "$target")