X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Ffstransactions.py;h=f76a4bc67611fa0cab5f32d5f5d26bc883e4c456;hb=36cc95dbcd4f564647726201b117f03b4183c232;hp=468e2859b2d5ee804714b002734c981ab1a0ff23;hpb=c5501640d444217e7cdbb5e42e31166cd1fe2db6;p=dak.git diff --git a/daklib/fstransactions.py b/daklib/fstransactions.py index 468e2859..f76a4bc6 100644 --- a/daklib/fstransactions.py +++ b/daklib/fstransactions.py @@ -134,6 +134,9 @@ class FilesystemTransaction(object): symlink (bool): Create a symlink instead mode (int): Permissions to change `destination` to. """ + if isinstance(mode, str) or isinstance(mode, unicode): + mode = int(mode, 8) + self.actions.append(_FilesystemCopyAction(source, destination, link=link, symlink=symlink, mode=mode)) def move(self, source, destination, mode=None): @@ -169,6 +172,9 @@ class FilesystemTransaction(object): Returns: file handle of the new file """ + if isinstance(mode, str) or isinstance(mode, unicode): + mode = int(mode, 8) + destdir = os.path.dirname(path) if not os.path.exists(destdir): os.makedirs(destdir, 0o2775)