From c5501640d444217e7cdbb5e42e31166cd1fe2db6 Mon Sep 17 00:00:00 2001 From: Ansgar Burchardt Date: Fri, 15 Jun 2012 15:41:47 +0200 Subject: [PATCH] fstransactions.py: also use mode for directories --- daklib/fstransactions.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/daklib/fstransactions.py b/daklib/fstransactions.py index 8fb73767..468e2859 100644 --- a/daklib/fstransactions.py +++ b/daklib/fstransactions.py @@ -38,10 +38,19 @@ class _FilesystemCopyAction(_FilesystemAction): self.destination = destination self.need_cleanup = False + dirmode = 0o2755 + if mode is not None: + dirmode = 0o2700 | mode + # Allow +x for group and others if they have +r. + if dirmode & 0o0040: + dirmode = dirmode | 0o0010 + if dirmode & 0o0004: + dirmode = dirmode | 0o0001 + self.check_for_temporary() destdir = os.path.dirname(self.destination) if not os.path.exists(destdir): - os.makedirs(destdir, 0o2775) + os.makedirs(destdir, dirmode) if symlink: os.symlink(source, self.destination) elif link: -- 2.39.5